Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
romainsacchi committed Nov 11, 2023
2 parents 3218c4d + ba06a44 commit ea87415
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pathways/pathways.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,15 @@ def get_scenarios(self):

mapping_vars = [item["scenario variable"] for item in self.mapping.values()]

#check if all variables in mapping are in scenario_data
# check if all variables in mapping are in scenario_data
for var in mapping_vars:
if var not in scenario_data["variables"].values:
print(f"Variable {var} not found in scenario data.")

# remove rows which do not have a value under the `variable`
# column that correspond to any value in self.mapping for `scenario variable`

scenario_data = scenario_data[
scenario_data["variables"].isin(mapping_vars)
]
scenario_data = scenario_data[scenario_data["variables"].isin(mapping_vars)]

# convert `year` column to integer
scenario_data["year"] = scenario_data["year"].astype(int)
Expand Down

0 comments on commit ea87415

Please sign in to comment.