Skip to content

Commit

Permalink
change csv path to be case sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
FlxPo committed May 2, 2024
1 parent 2895740 commit a038319
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
trans_mode_cm = mobility.TransportModeChoiceModel(travel_costs, cost_of_time=20.0)
work_dest_cm = mobility.WorkDestinationChoiceModel(transport_zones, travel_costs, cost_of_time=20.0, radiation_model_alpha=0.2, radiation_model_beta=0.8)

population = mobility.Population(transport_zones, 1000)
population = mobility.Population(transport_zones, 100)

trips = mobility.Trips(population)
loc_trips = mobility.LocalizedTrips(trips, cost_of_time=20.0, work_alpha=0.2, work_beta=0.8)
Expand Down
9 changes: 2 additions & 7 deletions mobility/parsers/jobs_active_population_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@ def create_and_get_asset(self) -> pd.DataFrame:

data_folder = pathlib.Path(os.environ["MOBILITY_PACKAGE_DATA_FOLDER"]) / "insee"
zip_path = data_folder / "base-cc-emploi-pop-active-2019.zip"
csv_path = data_folder / "base-cc-emploi-pop-active-2019.csv"
csv_path = data_folder / "base-cc-emploi-pop-active-2019.CSV"

download_file(url, zip_path)

logging.info("Zip downloaded." if zip_path.exists() else "Zip download failed.")


# Unzip the content
with zipfile.ZipFile(zip_path, "r") as zip_ref:
logging.info("csv in zip." if "base-cc-emploi-pop-active-2019.csv" in zip_ref.namelist() else "csv not in zip.")
zip_ref.extractall(data_folder)

logging.info("csv extracted." if csv_path.exists() else "csv not extracted.")

# Informations about jobs and active population for each city
jobs_active_population = pd.read_csv(
csv_path,
Expand Down

0 comments on commit a038319

Please sign in to comment.