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

Bugfix: panel_calculator(), error with CID-XCAT intersection #968

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

Magnus167
Copy link
Member

Closes issue #967

@Magnus167 Magnus167 changed the title Bugfix: panel_calculator(), error with incomplete CID-XCAT intersection Bugfix: panel_calculator(), error with CID-XCAT intersection Sep 11, 2023
@Magnus167 Magnus167 linked an issue Sep 11, 2023 that may be closed by this pull request

if len(singles_used) > 0:
if new_xcats == all_xcats_used:
old_xcats_used: List[str] = new_xcats
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the intention is to prevent an undue data frame reduction in cases where only new xcats are used.
However, why would be ever want to drop the panel dimensions as defined by cids? Why would that be necessary?
Even if we just pass the string: "XCAT1 = 1" for cids = cidx, it should still calculate a panel of 1s.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few lines above 165,

old_xcats_used = list(set(all_xcats_used) - set(new_xcats))
... 
# after line 167
reduce_df(xcats=old_xcats_used,...)

In case where an XCAT does not exist for a particular CID, it will be in new_xcats as well as all_xcats_used.
With context to the example in #967:

formula = "RIR_NSA = iEUR_RIR_NSA"

implying
all_xcats_used == new_xcats;

and therefore
old_xcats_used == []

Re. enhancement for allowing numerical assignment:
As of now, the example "XCAT = 1" will not work with the panel calculator. There are multiple steps at which an operation like this would fail. This would be better solved as an enhancement

@rsueppel rsueppel merged commit be64404 into develop Sep 13, 2023
3 checks passed
@Magnus167 Magnus167 deleted the bugfix/panel_calc_967 branch September 13, 2023 13:35
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.

panel_calculator cannot handle single series
2 participants