Open DavidOry opened 3 years ago
Project card with changes key word is failing for single change
changes
See Python notebook here
Is the changes keyword needed when only one change is being made?
--------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-15-b45831b23b2d> in <module> ----> 1 build_scenario.apply_project(project.card_data) c:\users\david.ory\documents\github\network_wrangler\network_wrangler\scenario.py in apply_project(self, p) 531 for pc in p["changes"]: 532 pc["project"] = p["project"] --> 533 self.apply_project(pc) 534 535 else: c:\users\david.ory\documents\github\network_wrangler\network_wrangler\scenario.py in apply_project(self, p) 537 if not self.road_net: 538 raise ("Missing Roadway Network") --> 539 self.road_net.apply(p) 540 if p["category"] in ProjectCard.TRANSIT_CATEGORIES: 541 if not self.transit_net: c:\users\david.ory\documents\github\network_wrangler\network_wrangler\roadwaynetwork.py in apply(self, project_card_dictionary) 1333 _apply_individual_change(project_dictionary) 1334 else: -> 1335 _apply_individual_change(project_card_dictionary) 1336 1337 def apply_python_calculation( c:\users\david.ory\documents\github\network_wrangler\network_wrangler\roadwaynetwork.py in _apply_individual_change(project_dictionary) 1309 self.apply_roadway_feature_change( 1310 self.select_roadway_features(project_dictionary["facility"]), -> 1311 project_dictionary["properties"], 1312 ) 1313 elif project_dictionary["category"].lower() == "parallel managed lanes": c:\users\david.ory\documents\github\network_wrangler\network_wrangler\roadwaynetwork.py in apply_roadway_feature_change(self, link_idx, properties, in_place) 1387 else: 1388 self.links_df.loc[link_idx, attribute] = ( -> 1389 self.links_df.loc[link_idx, attribute] + p["change"] 1390 ) 1391 else: KeyError: 'change'
Operating system: Context (conda, jupyter, etc): Jupyter Environment (e.g. output from conda list): Lasso develop branch, network_wrangler develop branch
conda list
Describe the bug
Project card with
changes
key word is failing for single changeTo Reproduce
See Python notebook here
Failing tests
Triggering line of code
Thoughts on resolution
Is the
changes
keyword needed when only one change is being made?Full stack trace
Environment
Operating system: Context (conda, jupyter, etc): Jupyter Environment (e.g. output from
conda list
): Lasso develop branch, network_wrangler develop branch