Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor linting fixes #24

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[flake8]
max-line-length = 100
ignore = F821
3 changes: 2 additions & 1 deletion src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions src/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os
import numpy as np
from src.preprocessing import rename_countries
import country_converter as coco


def loading(region):
Expand Down
Loading