From c545090d03f49b969b7e8c2b1e9b5b389878f778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=20Pfl=C3=BCger?= Date: Wed, 23 Oct 2024 10:50:15 +0200 Subject: [PATCH] lint: ruff --- .../example_conversion.IPCC1996.IPCC2006.csv | 2 +- .../tests/data/simple_categorisation_a.yaml | 2 +- .../tests/data/simple_categorisation_b.yaml | 2 +- climate_categories/tests/test_conversions.py | 16 ++++++++++------ 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/climate_categories/tests/data/example_conversion.IPCC1996.IPCC2006.csv b/climate_categories/tests/data/example_conversion.IPCC1996.IPCC2006.csv index d68acba..1343a1e 100644 --- a/climate_categories/tests/data/example_conversion.IPCC1996.IPCC2006.csv +++ b/climate_categories/tests/data/example_conversion.IPCC1996.IPCC2006.csv @@ -3,4 +3,4 @@ # last_update: 2021-07-09 IPCC1996,gas,IPCC2006,comment 0,,0, -1,,1, \ No newline at end of file +1,,1, diff --git a/climate_categories/tests/data/simple_categorisation_a.yaml b/climate_categories/tests/data/simple_categorisation_a.yaml index 1656c97..beef553 100644 --- a/climate_categories/tests/data/simple_categorisation_a.yaml +++ b/climate_categories/tests/data/simple_categorisation_a.yaml @@ -32,4 +32,4 @@ categories: - C - CatC unnumbered: - title: The unnumbered category \ No newline at end of file + title: The unnumbered category diff --git a/climate_categories/tests/data/simple_categorisation_b.yaml b/climate_categories/tests/data/simple_categorisation_b.yaml index 35751f9..05e1dc0 100644 --- a/climate_categories/tests/data/simple_categorisation_b.yaml +++ b/climate_categories/tests/data/simple_categorisation_b.yaml @@ -24,4 +24,4 @@ categories: comment: The second category alternative_codes: - B - - CatB \ No newline at end of file + - CatB diff --git a/climate_categories/tests/test_conversions.py b/climate_categories/tests/test_conversions.py index fd88872..0f018ef 100644 --- a/climate_categories/tests/test_conversions.py +++ b/climate_categories/tests/test_conversions.py @@ -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( @@ -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} @@ -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"