-
Notifications
You must be signed in to change notification settings - Fork 127
Open
Description
@phackstock suggests to refactor the IamDataFrame.validate() function to only every return a pandas dataframe. If all data points satisfy the criteria, then an empty data frame should be returned instead of None. Dealing with two different return types usually makes for awkward code downstream and I'd consider it an anti-pattern.
If validate() would always return a pandas data frame, you would do something more readable like:
if not_valid.empty:
# do something if everything's validor
if not not_valid.empty:
# do something if there are some invalid data pointsOriginally posted by @phackstock in #930 (comment)
Metadata
Metadata
Assignees
Labels
No labels