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

Fixing error Calculating Goal Score and Likely Future for each region ... Error: Duplicate identifiers for rows (1, 9), ... #24

Open
jules32 opened this issue Jun 28, 2017 · 0 comments

Comments

@jules32
Copy link
Contributor

jules32 commented Jun 28, 2017

This was a problem MHI encountered when running CalculateAll():

Calculating Goal Score and Likely Future for each region for FIS...
Error: Duplicate identifiers for rows (1, 9), (2, 10), (3, 11), (4, 12), (5, 13), (6, 14), (7, 15), (8, 16)

In troubleshooting ohicore::CalculateAll() line-by-line, I found that while that error came to light when calculating Likely Future, the problem actually occurred earlier when creating the scores variable. The scores variable was much larger than it should be by the time it was used to calculate Likely Future. I was expecting the scores variable to be 14_goal_functions * 4_regions * 2_dimensions = 112, but it was 192! Odd, because it wasn't doubled, but was definitely too long, and upon inspection it definitely had duplicates that were causing problems when trying to calculate Likely Future.

image

SO! I went back to where the scores variable was created and walked through each iteration of the for loop, watching the scores variable to see if it was the expected multiple of 8 (4_regions * 2_dimensions). And when I got to g='HAB', it grew by about 100 rather than 8!

Looking back at the MHI repo's functions.r, I found that the HAB function was returning the wrong variable; it was returning 'scores' rather than 'scores_HAB'. So what this means is that when ohicore got to HAB, it pasted all previous scores instead of the HAB scores (and actually excluded HAB)

image

Fixing this then solved the original issue, no more Error: Duplicate identifiers for rows!

cc @eschemmel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant