-
Notifications
You must be signed in to change notification settings - Fork 51
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
ENH: add helpers to merge extra data into a cycler instance #47
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #47 +/- ##
==========================================
- Coverage 100% 98.41% -1.59%
==========================================
Files 1 1
Lines 184 189 +5
Branches 51 53 +2
==========================================
+ Hits 184 186 +2
- Misses 0 3 +3
Continue to review full report at Codecov.
|
From private discussions with @WeatherGod
68e832a
to
5f00bec
Compare
@WeatherGod took 18 months, but I addressed your comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also have unit test, which could just be duplicated for the docstring example I mentioned, too.
|
||
Parameters | ||
---------- | ||
inp : Iterable[Mapping[Any, Any]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be pedantic, wouldn't the first Any
be Hashable
? I haven't gotten fully into the annotation habit yet, so I don't know if Mapping
already implies Hashable
for the keys.
"""Update a cycler with some supplemental data | ||
|
||
Given a cycler, add extra keys to each entry based | ||
on the value of ``index_key`` in that entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name here doesn't match the name in the call signature.
A mapping between the values of ``index_key`` in ``source`` | ||
and mappings of additional keys and values. | ||
|
||
Each mapping must have the same set of keys. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring would greatly benefit from an example. As it stands right now, I have to think really hard to understand the use-cases for this function (and I am the one who originally thought of this idea!).
Is there a reason these are stand alone functions? I would have expected
|
@timhoffm Fair, but I think that one level of nesting Still not sure this is a good idea. Maybe this should just go into the docs as an example? |
From private discussions with @WeatherGod
This still needs: