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] Dependency sort does not work properly when a project is the repreq for more than one other projects #341

Open
i-am-sijia opened this issue Apr 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@i-am-sijia
Copy link
Member

Describe the bug

From Rachel:

My 2050 build scenario is still spinning but I’m noticing an issue with the project card order that is ignoring pre-reqs.

I have two managed lanes projects (94 NB and 94 SB) that use links created in another project card (mn252 hwy conversion). I set this highway project as a pre-req for both managed lanes. But 94 NB Mnpass ran before the mn252 card, ignoring the pre-req. The 94SB card ran after, correctly following the prereq. The pre-reqs look identical, so I’m confused why this might be. Any idea? I’m hoping when I review outputs tomorrow this won’t be an issue but based on this output message I’m guessing my NB lane will be missing segments.

Full output copied below, important sections highlighted
image

To Reproduce

Steps to reproduce the behavior:

  1. Sijia reproduced Rachel's error by using this notebook

Triggering line of code

for project in scenario_projects:
visited_list[project] = False
if not self.prerequisites.get(project):
continue
for prereq in self.prerequisites[project]:
if (
prereq.lower() in scenario_projects
): # this will always be true, else would have been flagged in missing prerequsite check, but just in case
adjacency_list[prereq.lower()] = [project]
# sorted_project_names is topological sorted project card names (based on prerequsiite)
sorted_project_names = topological_sort(
adjacency_list=adjacency_list, visited_list=visited_list
)

Thoughts on resolution

The sorting pre-req code is not treat more than one dependent card properly. Instead of overwriting the adjacent_list, it should append. The error is on line 481.

Full stack trace

Environment

Operating system: Win64
Context (conda, jupyter, etc):
Environment (e.g. output from conda list):
Lasso: develop_with_ranch
Wrangler: develop_with_ranch

fyi: @RachelWikenMC

@i-am-sijia i-am-sijia added the bug Something isn't working label Apr 15, 2024
@i-am-sijia i-am-sijia self-assigned this Apr 15, 2024
@i-am-sijia i-am-sijia added this to Backlog in MetCouncil Network Wrangler via automation Apr 15, 2024
@i-am-sijia
Copy link
Member Author

I tested the code fix locally and it's working. We will close this issue once Rachel confirms this is working for her.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant