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

Standardized constructor signature with dimensions as positional args #1946

Merged
merged 8 commits into from Oct 8, 2017

Conversation

Projects
None yet
3 participants
@philippjfr
Member

philippjfr commented Oct 1, 2017

As suggested in #1938 this PR standardizes the constructors of Dimensioned objects such that kdims and vdims are the second and third argument respectively for Elements and kdims are the second argument for dimensioned containers (NdMapping, HoloMap, NdOverlay etc.). Currently Histogram and Annotations are the exceptions to this.

@philippjfr philippjfr added the API label Oct 1, 2017

@jlstevens

This comment has been minimized.

Member

jlstevens commented Oct 3, 2017

Are there backwards compatibility implications? Otherwise I support the idea.

@philippjfr

This comment has been minimized.

Member

philippjfr commented Oct 3, 2017

Not as far as I know but I have yet to go through all the errors.

@property
def deep_dimensions(self): return self.ddims

This comment has been minimized.

@jlstevens

jlstevens Oct 4, 2017

Member

I suppose we haven't used them in a long time so they should be ok to remove now.

This comment has been minimized.

@philippjfr

philippjfr Oct 5, 2017

Member

You would think that, turns out Columnar_Data still had a reference:

  3 error_hmap = hv.HoloMap({(i, j): hv.Image(j*np.random.randn(3, 3), bounds=extents)
  4                          for i, j in product(range(3), np.linspace(0, 1, 3))},
  5                         key_dimensions=['Observation', 'noise'])
@philippjfr

This comment has been minimized.

Member

philippjfr commented Oct 4, 2017

Also addresses #1619

@philippjfr

This comment has been minimized.

Member

philippjfr commented Oct 5, 2017

Okay, I've now gone through everything. There were two causes for errors:

  1. In some very old tests we passed Image bounds as the second positional argument. Since bounds is now optional and is only used when passing a numpy array to Image I think moving away from that is sensible.
  2. In some cases some internal code was passing NdMapping kdims as tuples, which used to be allowed but is now interpreted as a single dimension specification.

I think better exception messages will be sufficient to address both cases.

@jbednar

This comment has been minimized.

Member

jbednar commented Oct 5, 2017

Sounds reasonable, but be sure to link to this PR in the changelog section on backwards compatibility.

@jlstevens

This comment has been minimized.

Member

jlstevens commented Oct 5, 2017

All sounds good to me!

I definitely wouldn't want bounds to be passed by position to Image anymore.

@philippjfr

This comment has been minimized.

Member

philippjfr commented Oct 6, 2017

Tests now passing, I suppose I'll add some tests to ensure Elements follow this signature.

@philippjfr

This comment has been minimized.

Member

philippjfr commented Oct 8, 2017

Ready to merge once test pass.

if edges is not None:
self.warning("Histogram edges should be supplied as a tuple "
"along with the values, passing the edges will "
"be deprecated in holoviews 2.0.")

This comment has been minimized.

@jlstevens

jlstevens Oct 8, 2017

Member

Something to mention in the next changelog/release notes. It will be good to get histogram working consistently with everything else.

@jlstevens

This comment has been minimized.

Member

jlstevens commented Oct 8, 2017

Looks good to me. I made one comment about histogram but nothing that needs action. Merging.

@jlstevens jlstevens merged commit 1e0cd19 into master Oct 8, 2017

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.04%) to 79.916%
Details
s3-reference-data-cache Test data is cached.
Details

@philippjfr philippjfr deleted the standardize_constructors branch Oct 9, 2017

@pyup-bot pyup-bot referenced this pull request Nov 3, 2017

Closed

Update holoviews to 1.9.0 #104

@pyup-bot pyup-bot referenced this pull request Nov 13, 2017

Closed

Update holoviews to 1.9.1 #120

@pyup-bot pyup-bot referenced this pull request Dec 12, 2017

Merged

Update holoviews to 1.9.2 #139

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