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

Refactor implementation for (skipping) validation #2

Conversation

danielhuppmann
Copy link

Description of PR

While reviewing IAMconsortium#532, I noticed that there was still a duplication of effort - first computing the aggregate values, then appending, then (optionally, true by default) again computing the aggregate values for the consistency evaluation.

This PR implements a more efficient approach: first compute the aggregate values, split them into two groups (already existing vs. new data), (optionally) perform the validation on existing data, then append the new data.

To do this efficiently, I moved the compare feature into a separate submodule and made it compatible with receiving a pd.Series directly.

Also, I moved the test data for the recursive aggregation feature into conftest.py to remove duplicate code, and I added an explicit assertion that calling the recursive aggregation with inconsistent data raises an error.

@pjuergens pjuergens merged commit f6464a8 into pjuergens:intermediate-aggregate Jun 10, 2021
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

Successfully merging this pull request may close these issues.

2 participants