Skip to content

Commit

Permalink
apply ruff for code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
awais307 committed Feb 2, 2024
1 parent b0f9abe commit 63aad7c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion message_ix_models/tests/model/water/test_cooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_non_cooling_tec(test_context):
s.add_horizon(year=[2020, 2030, 2040])
s.add_set("technology", ["tech1", "tech2"])
s.add_set("node", ["loc1", "loc2"])
s.add_set("year", [2020,2030, 2040])
s.add_set("year", [2020, 2030, 2040])

# TODO: this is where you would add
# "node_loc": ["loc1", "loc2"],
Expand Down
3 changes: 1 addition & 2 deletions message_ix_models/tests/model/water/test_irrigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def test_add_irr_structure(test_context):

context = test_context
mp = context.get_platform()
scenario_info = {
Expand All @@ -20,7 +19,7 @@ def test_add_irr_structure(test_context):
s.add_horizon(year=[2020, 2030, 2040])
s.add_set("technology", ["tech1", "tech2"])
s.add_set("node", ["loc1", "loc2"])
s.add_set("year", [2020,2030, 2040])
s.add_set("year", [2020, 2030, 2040])

# Mock the DataFrame read from CSV
df_node = pd.DataFrame({"BCU_name": ["1", "2"], "REGION": ["region1", "region2"]})
Expand Down
6 changes: 2 additions & 4 deletions message_ix_models/tests/model/water/test_water_supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def test_add_water_supply(test_context):
s.add_horizon(year=[2020, 2030, 2040])
s.add_set("technology", ["tech1", "tech2"])
s.add_set("node", ["loc1", "loc2"])
s.add_set("year", [2020,2030, 2040])
s.add_set("year", [2020, 2030, 2040])
# Mock the DataFrames read from CSV
df_node = pd.DataFrame({"BCU_name": ["test_BCU"], "REGION": ["test_REGION"]})

Expand Down Expand Up @@ -153,9 +153,7 @@ def test_add_e_flow():
return_value=(df_sw, df_sw),
), patch(
"message_ix_models.util.private_data_path", return_value="path/to/file"
), patch(
"pandas.read_csv", return_value=df_sw
):
), patch("pandas.read_csv", return_value=df_sw):
# Call the function to be tested
result = add_e_flow(context)

Expand Down

0 comments on commit 63aad7c

Please sign in to comment.