diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7c0443..ef71792 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/modelitool/combitabconvert.py b/modelitool/combitabconvert.py index 31d1551..1cb7454 100644 --- a/modelitool/combitabconvert.py +++ b/modelitool/combitabconvert.py @@ -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( diff --git a/tutorials/Modelica models Handling.ipynb b/tutorials/Modelica models Handling.ipynb index 9435763..a7047a9 100644 --- a/tutorials/Modelica models Handling.ipynb +++ b/tutorials/Modelica models Handling.ipynb @@ -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" ] }, { @@ -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", + ")" ] }, { @@ -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", ")" ] }, @@ -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\"]" ] }, { @@ -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", "}" ] }, @@ -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", "}" ] }, @@ -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",