Skip to content

Commit a68298a

Browse files
authored
Merge pull request #426 from EnergySystemsModellingLab/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents c4fc04d + 0113c9c commit a68298a

35 files changed

Lines changed: 166 additions & 70 deletions

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repos:
99
- id: trailing-whitespace
1010
- id: end-of-file-fixer
1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.5.2
12+
rev: v0.6.2
1313
hooks:
1414
- id: ruff-format
1515
types_or: [python, pyi, jupyter]

docs/advanced-guide/extending-muse.ipynb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@
9191
"source": [
9292
"from typing import Optional\n",
9393
"\n",
94-
"from muse.outputs.sector import market_quantity, register_output_quantity\n",
9594
"from xarray import DataArray, Dataset\n",
9695
"\n",
96+
"from muse.outputs.sector import market_quantity, register_output_quantity\n",
97+
"\n",
9798
"\n",
9899
"@register_output_quantity\n",
99100
"def consumption_zero(\n",
@@ -181,9 +182,10 @@
181182
"source": [
182183
"from pathlib import Path\n",
183184
"\n",
184-
"from muse import examples\n",
185185
"from toml import dump, load\n",
186186
"\n",
187+
"from muse import examples\n",
188+
"\n",
187189
"model_path = examples.copy_model(name=\"default_retro\", overwrite=True)\n",
188190
"settings = load(model_path / \"settings.toml\")\n",
189191
"new_output = {\n",
@@ -289,6 +291,7 @@
289291
"\n",
290292
"import pandas as pd\n",
291293
"import xarray as xr\n",
294+
"\n",
292295
"from muse.outputs.cache import consolidate_quantity, register_cached_quantity\n",
293296
"\n",
294297
"\n",
@@ -361,9 +364,10 @@
361364
"source": [
362365
"from pathlib import Path\n",
363366
"\n",
364-
"from muse import examples\n",
365367
"from toml import dump, load\n",
366368
"\n",
369+
"from muse import examples\n",
370+
"\n",
367371
"model_path = examples.copy_model(name=\"default_retro\", overwrite=True)\n",
368372
"settings = load(model_path / \"settings.toml\")\n",
369373
"new_output = {\n",
@@ -503,9 +507,10 @@
503507
"source": [
504508
"from pathlib import Path\n",
505509
"\n",
506-
"from muse import examples\n",
507510
"from toml import dump, load\n",
508511
"\n",
512+
"from muse import examples\n",
513+
"\n",
509514
"model_path = examples.copy_model(name=\"default_retro\", overwrite=True)\n",
510515
"settings = load(model_path / \"settings.toml\")\n",
511516
"settings[\"sectors\"][\"residential\"][\"outputs\"] = [\n",

docs/advanced-guide/further-extending-muse.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23+
"from xarray import DataArray, Dataset\n",
24+
"\n",
2325
"from muse.agents import Agent\n",
2426
"from muse.filters import register_filter\n",
25-
"from xarray import DataArray, Dataset\n",
2627
"\n",
2728
"\n",
2829
"@register_filter\n",
@@ -100,9 +101,10 @@
100101
"source": [
101102
"from typing import Any\n",
102103
"\n",
103-
"from muse.decisions import register_decision\n",
104104
"from xarray import DataArray, Dataset\n",
105105
"\n",
106+
"from muse.decisions import register_decision\n",
107+
"\n",
106108
"\n",
107109
"@register_decision\n",
108110
"def median_objective(objectives: Dataset, parameters: Any, **kwargs) -> DataArray:\n",

docs/tutorial-code/0-new-decision-metric/new_decision.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from typing import Any
22

3-
from muse.decisions import register_decision
43
from xarray import DataArray, Dataset
54

5+
from muse.decisions import register_decision
6+
67

78
@register_decision
89
def median_objective(objectives: Dataset, parameters: Any, **kwargs) -> DataArray:

docs/tutorial-code/1-add-new-technology/generate_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pathlib import Path
44

55
import pandas as pd
6+
67
from muse import examples
78
from muse.wizard import (
89
add_new_commodity,

docs/tutorial-code/2-add-agent/generate_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pathlib import Path
44

55
import pandas as pd
6+
67
from muse import examples
78
from muse.wizard import add_agent, get_sectors
89

docs/tutorial-code/3-add-region/generate_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pathlib import Path
33

44
import pandas as pd
5+
56
from muse.wizard import add_region
67

78
parent_path = Path(__file__).parent

docs/tutorial-code/4-modify-timing-data/generate_models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
from pathlib import Path
33

44
import pandas as pd
5-
from muse.wizard import add_timeslice, get_sectors, modify_toml
65
from tomlkit import dumps, parse
76

7+
from muse.wizard import add_timeslice, get_sectors, modify_toml
8+
89
parent_path = Path(__file__).parent
910

1011

docs/tutorial-code/5-add-service-demand/generate_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from pathlib import Path
33

44
import pandas as pd
5+
56
from muse.wizard import add_new_commodity, add_new_process
67

78
parent_path = Path(__file__).parent

docs/tutorial-code/7-min-max-timeslice-constraints/1-min-constraint/output.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Optional
22

33
import xarray as xr
4+
45
from muse.outputs.sector import market_quantity, register_output_quantity
56

67

0 commit comments

Comments
 (0)