Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ENH: add helpers to merge extra data into a cycler instance #47

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

Open
tacaswell wants to merge 2 commits into matplotlib:main
base: main
Choose a base branch
Loading
from tacaswell:enh_suplemental_data

Conversation

@tacaswell
Copy link
Member

@tacaswell tacaswell commented Apr 23, 2018

From private discussions with @WeatherGod

This still needs:

  • is this actually a good idea to include?
  • tests
  • make sure it is in the docs + example

Copy link

codecov-io commented Apr 23, 2018
edited
Loading

Codecov Report

Merging #47 into master will decrease coverage by 1.58%.
The diff coverage is 40%.

Impacted file tree graph

@@ 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
Impacted Files Coverage Δ
cycler.py 98.41% <40%> (-1.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dc2965...5f00bec. Read the comment docs.

Copy link
Member Author

@WeatherGod took 18 months, but I addressed your comments!

Copy link
Member

@WeatherGod WeatherGod left a 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]]
Copy link
Member

@WeatherGod WeatherGod Sep 14, 2019

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.
Copy link
Member

@WeatherGod WeatherGod Sep 14, 2019

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.
Copy link
Member

@WeatherGod WeatherGod Sep 14, 2019

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!).

Copy link
Member

Is there a reason these are stand alone functions? I would have expected

  • a class method Cycler.from_dicts
  • an instance method Cycler.merge_supplemental

Copy link
Member Author

@timhoffm Fair, but I think that one level of nesting cycler.Cycler.from_dicts and neither function needs access to the class object.

Still not sure this is a good idea. Maybe this should just go into the docs as an example?

danielballan reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@WeatherGod WeatherGod WeatherGod requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /