Skip to content
Merged
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
Expand Up @@ -4,12 +4,12 @@ ci:

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.9
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.2
hooks:
- id: check-github-workflows
- repo: https://github.com/asottile/blacken-docs
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def campaigns(request, bemservercore):
campaigns = []
for i in range(max(2, request.param)):
campaign_i = model.Campaign.new(
name=f"Campaign {i+1}",
name=f"Campaign {i + 1}",
start_time=dt.datetime(2020, 1, 1, tzinfo=dt.timezone.utc),
end_time=dt.datetime(2020, 2, 1, tzinfo=dt.timezone.utc),
)
Expand Down Expand Up @@ -252,8 +252,8 @@ def timeseries(request, bemservercore, campaigns, campaign_scopes):
ts_l = []
for i in range(request.param):
ts_i = model.Timeseries.new(
name=f"Timeseries {i+1}",
description=f"Test timeseries #{i+1}",
name=f"Timeseries {i + 1}",
description=f"Test timeseries #{i + 1}",
campaign=campaigns[i % len(campaigns)],
campaign_scope=campaign_scopes[i % len(campaign_scopes)],
)
Expand Down
10 changes: 5 additions & 5 deletions tests/input_output/test_sites_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def test_site_data_io_import_csv_data_error(self, users, campaigns):
csv_file = "Name,Description,IFC_ID\n" + 100 * "A" + ",Great site 1,\n"
with CurrentUser(admin_user):
with pytest.raises(
SitesCSVIOError, match=f"Site \"{100 * 'A'}\" can't be created."
SitesCSVIOError, match=f'Site "{100 * "A"}" can\'t be created.'
):
sites_csv_io.import_csv(campaign_1, sites_csv=csv_file)

Expand Down Expand Up @@ -282,7 +282,7 @@ def test_building_data_io_import_csv_data_error(self, users, campaigns, sites):
)
with CurrentUser(admin_user):
with pytest.raises(
SitesCSVIOError, match=f"Building \"{100 * 'A'}\" can't be created."
SitesCSVIOError, match=f'Building "{100 * "A"}" can\'t be created.'
):
sites_csv_io.import_csv(campaign_1, buildings_csv=csv_file)

Expand Down Expand Up @@ -449,7 +449,7 @@ def test_storey_data_io_import_csv_data_error(
)
with CurrentUser(admin_user):
with pytest.raises(
SitesCSVIOError, match=f"Storey \"{100 * 'A'}\" can't be created."
SitesCSVIOError, match=f'Storey "{100 * "A"}" can\'t be created.'
):
sites_csv_io.import_csv(campaign_1, storeys_csv=csv_file)

Expand Down Expand Up @@ -642,7 +642,7 @@ def test_space_data_io_import_csv_data_error(
)
with CurrentUser(admin_user):
with pytest.raises(
SitesCSVIOError, match=f"Space \"{100 * 'A'}\" can't be created."
SitesCSVIOError, match=f'Space "{100 * "A"}" can\'t be created.'
):
sites_csv_io.import_csv(campaign_1, spaces_csv=csv_file)

Expand Down Expand Up @@ -764,7 +764,7 @@ def test_zone_data_io_import_csv_data_error(self, users, campaigns):
csv_file = "Name,Description,IFC_ID\n" + 100 * "A" + ",Great zone 1,\n"
with CurrentUser(admin_user):
with pytest.raises(
SitesCSVIOError, match=f"Zone \"{100 * 'A'}\" can't be created."
SitesCSVIOError, match=f'Zone "{100 * "A"}" can\'t be created.'
):
sites_csv_io.import_csv(campaign_1, zones_csv=csv_file)

Expand Down
2 changes: 1 addition & 1 deletion tests/process/test_energy_consumption.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _create_data(self, campaign, campaign_scope):
timeseries = []
for i in range(9):
ts_i = Timeseries.new(
name=f"Timeseries {i+1}",
name=f"Timeseries {i + 1}",
campaign=campaign,
campaign_scope=campaign_scope,
unit_symbol=("Wh" if i < 6 else "kWh"),
Expand Down
Loading