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

feat(core): formatlevel and extractlevel get optional patterns #61

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

coroa
Copy link
Owner

@coroa coroa commented Oct 22, 2024

To solve the common problem of extracting and formatting IAMC style variables including a common total, patterns in formatlevel and extractlevel can now be marked as optional.

df.pix.extract(variable="Emi|{gas}|{sector}", optional=["sector"])

will now extract also "Emi|CO2" as {"gas": "CO2", "sector": "Total"}.

And the inverse of formatlevel behaves identically.

@coroa coroa force-pushed the add-optional-patterns branch from 3278ea7 to c0f5e75 Compare October 22, 2024 16:52
@coroa coroa changed the base branch from add-resolver to main October 22, 2024 16:54
@coroa coroa merged commit 34f1297 into main Oct 22, 2024
@coroa coroa deleted the add-optional-patterns branch October 22, 2024 16:56
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.

1 participant