Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.2
rev: v0.14.8
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
rev: 0.35.0
hooks:
- id: check-github-workflows
2 changes: 1 addition & 1 deletion modelitool/combitabconvert.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def df_to_combitimetable(df, filename):
raise ValueError(f"df must be an instance of pandas DataFrame. Got {type(df)}")
if not isinstance(df.index, pd.DatetimeIndex):
raise ValueError(
f"DataFrame index must be an instance of DatetimeIndex. " f"Got {type(df)}"
f"DataFrame index must be an instance of DatetimeIndex. Got {type(df)}"
)
if not df.index.is_monotonic_increasing:
raise ValueError(
Expand Down
35 changes: 15 additions & 20 deletions tutorials/Modelica models Handling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"import os\n",
"from pathlib import Path"
"from pathlib import Path\n",
"\n",
"import pandas as pd"
]
},
{
Expand Down Expand Up @@ -98,10 +99,8 @@
"outputs": [],
"source": [
"reference_df = pd.read_csv(\n",
" Path(TUTORIAL_DIR) / \"resources/study_df.csv\",\n",
" index_col=0,\n",
" parse_dates=True\n",
") "
" Path(TUTORIAL_DIR) / \"resources/study_df.csv\", index_col=0, parse_dates=True\n",
")"
]
},
{
Expand Down Expand Up @@ -137,7 +136,7 @@
"source": [
"df_to_combitimetable(\n",
" df=reference_df.loc[\"2018-03-22\":\"2018-03-23\"],\n",
" filename=\"resources/boundary_temp.txt\"\n",
" filename=\"resources/boundary_temp.txt\",\n",
")"
]
},
Expand All @@ -164,11 +163,7 @@
"metadata": {},
"outputs": [],
"source": [
"output_list = [\n",
" \"T_coat_ins.T\",\n",
" \"T_ins_ins.T\",\n",
" \"Tw_out.T\"\n",
"]"
"output_list = [\"T_coat_ins.T\", \"T_ins_ins.T\", \"Tw_out.T\"]"
]
},
{
Expand Down Expand Up @@ -277,12 +272,12 @@
"outputs": [],
"source": [
"simulation_opt = {\n",
" \"startTime\": second_index[0],\n",
" \"stopTime\": second_index[-1],\n",
" \"stepSize\": 300,\n",
" \"tolerance\": 1e-06,\n",
" \"solver\": \"dassl\",\n",
" \"outputFormat\": \"csv\"\n",
" \"startTime\": second_index[0],\n",
" \"stopTime\": second_index[-1],\n",
" \"stepSize\": 300,\n",
" \"tolerance\": 1e-06,\n",
" \"solver\": \"dassl\",\n",
" \"outputFormat\": \"csv\",\n",
"}"
]
},
Expand Down Expand Up @@ -314,7 +309,7 @@
" \"Tins1_init\": 19.70 + 273.15,\n",
" \"Tins2_init\": 10.56 + 273.15,\n",
" \"Tcoat_init\": 6.4 + 273.15,\n",
" 'Lambda_ins.k': 0.04,\n",
" \"Lambda_ins.k\": 0.04,\n",
"}"
]
},
Expand All @@ -341,7 +336,7 @@
"outputs": [],
"source": [
"init_res_OM = simu_OM.simulate(\n",
" simflags = \"-initialStepSize=60 -maxStepSize=3600 -w -lv=LOG_STATS\",\n",
" simflags=\"-initialStepSize=60 -maxStepSize=3600 -w -lv=LOG_STATS\",\n",
" parameter_dict=parameter_dict_OM,\n",
" x=reference_df,\n",
" year=2024,\n",
Expand Down
Loading