Skip to content

Commit

Permalink
lint: ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
mikapfl committed Oct 23, 2024
1 parent 4f1ef10 commit c545090
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# last_update: 2021-07-09
IPCC1996,gas,IPCC2006,comment
0,,0,
1,,1,
1,,1,
2 changes: 1 addition & 1 deletion climate_categories/tests/data/simple_categorisation_a.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ categories:
- C
- CatC
unnumbered:
title: The unnumbered category
title: The unnumbered category
2 changes: 1 addition & 1 deletion climate_categories/tests/data/simple_categorisation_b.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ categories:
comment: The second category
alternative_codes:
- B
- CatB
- CatB
16 changes: 10 additions & 6 deletions climate_categories/tests/test_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,7 @@ def get_test_data_filepath(fname: str):


def test_read_csv_in_conversion_class():
fd = get_test_data_filepath(
"example_conversion.IPCC1996.IPCC2006.csv"
)
fd = get_test_data_filepath("example_conversion.IPCC1996.IPCC2006.csv")

conv_from_conversion_spec = conversions.ConversionSpec.from_csv(fd)
conv_from_conversion_spec = conv_from_conversion_spec.hydrate(
Expand All @@ -448,9 +446,13 @@ def test_read_csv_in_conversion_class():


def test_read_conversion_from_csv_with_custom_categorizations():
categorisation_a = climate_categories.from_yaml(get_test_data_filepath("simple_categorisation_a.yaml"))
categorisation_a = climate_categories.from_yaml(
get_test_data_filepath("simple_categorisation_a.yaml")
)

categorisation_b = climate_categories.from_yaml(get_test_data_filepath("simple_categorisation_b.yaml"))
categorisation_b = climate_categories.from_yaml(
get_test_data_filepath("simple_categorisation_b.yaml")
)

cats = {"A": categorisation_a, "B": categorisation_b}

Expand All @@ -473,7 +475,9 @@ def test_read_conversion_from_csv_with_existing_categorizations():

def test_read_conversion_from_csv_with_existing_categorizations_aux_dims():
conv = climate_categories.Conversion.from_csv(
get_test_data_filepath("test_conversion_with_existing_categorizations_aux_dims.csv")
get_test_data_filepath(
"test_conversion_with_existing_categorizations_aux_dims.csv"
)
)

assert conv.categorization_a_name == "BURDI"
Expand Down

0 comments on commit c545090

Please sign in to comment.