-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add get_data_column()
, refactor filtering by the time domain
#562
Conversation
Codecov Report
@@ Coverage Diff @@
## main #562 +/- ##
=====================================
Coverage 93.7% 93.7%
=====================================
Files 50 50
Lines 5322 5332 +10
=====================================
+ Hits 4987 4997 +10
Misses 335 335
Continue to review full report at Codecov.
|
get_data_colum()
, Rrfactor filtering by the time domainget_data_column()
, refactor filtering by the time domain
While working on this PR, I noticed that pyam also has a getter I see three options:
Any thoughts @gidden or anyone else? |
For reference, the implementation is reproduced below:
In which case if I would advise against deprecation, as this is a pretty innocuous feature and we have no idea how many users are actually using it. Not to mention, it would be almost impossible to update legacy code... |
Don't quite agree that it's so innocuous... If you do But if you think a DeprecationWarning is too strong, how about a FutureWarning - so this will give users probably a year's worth of time to update any code...? |
I would strongly prefer not removing/deprecating. Have we heard anyone who has raised an issue with this? |
Ok, let's leave it - wil simply implement the more efficient approach. |
Great, thank you! |
a41e954
to
4407f85
Compare
Implemented the more efficient approach for the direct getter |
Looks great, thanks! |
Please confirm that this PR has done the following:
Name of contributors Added to AUTHORS.rstDescription of PR
This PR adds a utility function
get_data_column(name)
as short-hand (and more efficient implementation) fordf.data[name]
, because it avoids casting the internal_data
pd.Series to a pd.DataFrame.This utility function is then used to make filtering by the time domain more performant.