Skip to content

Commit

Permalink
linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
florianjehn committed Jan 30, 2024
1 parent ba1cb8b commit 0c20738
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def remove_below_percentile(self) -> None:
self.trade_matrix = self.trade_matrix.loc[b_filter, b_filter]

print(
f"Removed countries with trade below the {int(self.percentile*100)}th percentile."
f"Removed countries with trade below the {int(self.percentile * 100)}th percentile."
)

# Save threshold for testing purposes
Expand Down
4 changes: 2 additions & 2 deletions src/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def read_faostat_bulk(faostat_zip: str) -> pd.DataFrame:
print("Finished unzipping file")
print("Reading csv from zip")
df = pd.read_csv(
zip_file.open(faostat_zip[faostat_zip.rfind("/") + 1 :].replace("zip", "csv")),
zip_file.open(faostat_zip[faostat_zip.rfind("/") + 1:].replace("zip", "csv")),
encoding="latin1",
low_memory=False,
)
Expand All @@ -75,7 +75,7 @@ def serialise_faostat_bulk(faostat_zip: str) -> None:
data = read_faostat_bulk(faostat_zip)
print("Starting to convert zip to pickle")
base_path = "data" + os.sep + "temp_files" + os.sep
formatted_filename = faostat_zip[faostat_zip.rfind("/") + 1 :].replace("zip", "pkl")
formatted_filename = faostat_zip[faostat_zip.rfind("/") + 1:].replace("zip", "pkl")
full_path = f"{base_path}{formatted_filename}"

data.to_pickle(full_path)
Expand Down

0 comments on commit 0c20738

Please sign in to comment.