diff --git a/.flake8 b/.flake8 index 7da1f96..41a0a51 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,3 @@ [flake8] max-line-length = 100 +ignore = F821 diff --git a/src/model.py b/src/model.py index 688be10..92636e4 100644 --- a/src/model.py +++ b/src/model.py @@ -216,7 +216,8 @@ def remove_net_zero_countries(self) -> None: # print the number of countries removed print( - f"Removed {shape_before - self.trade_matrix.shape[0]} countries with no trade or production." + f"Removed {shape_before - self.trade_matrix.shape[0]} " + f"countries with no trade or production." ) def prebalance(self, precision=10**-3) -> None: diff --git a/src/preprocessing.py b/src/preprocessing.py index ee97b4b..5b35f26 100644 --- a/src/preprocessing.py +++ b/src/preprocessing.py @@ -74,11 +74,11 @@ def serialise_faostat_bulk(faostat_zip: str) -> None: """ data = read_faostat_bulk(faostat_zip) print("Starting to convert zip to pickle") - data.to_pickle( - f"data{os.sep}temp_files{os.sep}{faostat_zip[faostat_zip.rfind('/') + 1:].replace( - 'zip', 'pkl' - )}" - ) + base_path = "data" + os.sep + "temp_files" + os.sep + formatted_filename = faostat_zip[faostat_zip.rfind('/') + 1:].replace('zip', 'pkl') + full_path = f"{base_path}{formatted_filename}" + + data.to_pickle(full_path) print("Finished converting zip to pickle") return None diff --git a/tests/test_model.py b/tests/test_model.py index cbfdabd..54b603a 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -3,7 +3,6 @@ import os import numpy as np from src.preprocessing import rename_countries -import country_converter as coco def loading(region):