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

extend pseudo-regexp in pattern_match() for $ #92

Merged
merged 6 commits into from
Sep 20, 2018

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Sep 18, 2018

Please confirm that this PR has done the following:

  • Tests Added
  • Documentation Added
  • Description in RELEASE_NOTES.md Added

Description of PR

This PR adds the $ symbol to the list of characters escaped in the pattern_match() function, to allow filtering for e.g. unit='US$'.

It also adds the option to functions using _apply_filters() to pass regexp=True as a kwarg, overriding the pseudo-regexp syntax in pattern_match(). Closes #79

@danielhuppmann
Copy link
Member Author

a litte bit disappointed by stickler...

pyam/core.py Outdated
dictionary of filters ({col: values}}); uses a pseudo-regexp syntax by
default, but accepts `regexp: True` to use direct regexp
"""
regexp = filters.pop('regexp') if 'regexp' in filters else False
Copy link
Member

Choose a reason for hiding this comment

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

this can just be regexp = filters.pop('regexp', False)

@gidden
Copy link
Member

gidden commented Sep 20, 2018

lgtm, one suggestion

@gidden gidden merged commit 27d3848 into IAMconsortium:master Sep 20, 2018
@danielhuppmann danielhuppmann deleted the pattern_match_dollar branch September 20, 2018 18:57
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