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

[BUG] Change key word missing from project card bug #117

Open
1 task
DavidOry opened this issue Mar 11, 2021 · 0 comments
Open
1 task

[BUG] Change key word missing from project card bug #117

DavidOry opened this issue Mar 11, 2021 · 0 comments
Assignees
Labels
fix Something isn't working/bug fix
Milestone

Comments

@DavidOry
Copy link
Member

Describe the bug

Project card with changes key word is failing for single change

To Reproduce

See Python notebook here

Failing tests

  • No applicable test failed, need to create.

Triggering line of code

Thoughts on resolution

Is the changes keyword needed when only one change is being made?

Full stack trace

---------------------------------------------------------------------------
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'

Environment

Operating system:
Context (conda, jupyter, etc): Jupyter
Environment (e.g. output from conda list): Lasso develop branch, network_wrangler develop branch

@DavidOry DavidOry added the fix Something isn't working/bug fix label Mar 11, 2021
i-am-sijia added a commit that referenced this issue Mar 16, 2021
i-am-sijia added a commit to BayAreaMetro/Lasso that referenced this issue Apr 15, 2021
@e-lo e-lo added this to the Release X milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Something isn't working/bug fix
Projects
None yet
Development

No branches or pull requests

4 participants