Skip to content

Commit

Permalink
fix a typo in a log message and extend a docstring (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
lumbric authored and danielhuppmann committed May 15, 2019
1 parent 4e9fc79 commit 25aa7f0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pyam/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@ def require_variable(self, variable, unit=None, year=None,
def validate(self, criteria={}, exclude_on_fail=False):
"""Validate scenarios using criteria on timeseries values
Returns all scenarios which do not match the criteria and prints a log
message or returns None if all scenarios match the criteria.
When called with `exclude_on_fail=True`, scenarios in the object not
satisfying the criteria will be marked as `exclude=True`.
Parameters
----------
criteria: dict
Expand All @@ -532,7 +538,7 @@ def validate(self, criteria={}, exclude_on_fail=False):
df = _apply_criteria(self.data, criteria, in_range=False)

if not df.empty:
msg = '{} of {} data points to not satisfy the criteria'
msg = '{} of {} data points do not satisfy the criteria'
logger().info(msg.format(len(df), len(self.data)))

if exclude_on_fail and len(df) > 0:
Expand Down Expand Up @@ -1400,6 +1406,12 @@ def _make_index(df, cols=META_IDX):
def validate(df, criteria={}, exclude_on_fail=False, **kwargs):
"""Validate scenarios using criteria on timeseries values
Returns all scenarios which do not match the criteria and prints a log
message or returns None if all scenarios match the criteria.
When called with `exclude_on_fail=True`, scenarios in `df` not satisfying
the criteria will be marked as `exclude=True` (object modified in place).
Parameters
----------
df: IamDataFrame instance
Expand Down

0 comments on commit 25aa7f0

Please sign in to comment.