Skip to content
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

Set the bounds of the kdims List parameter #5667

Merged
merged 5 commits into from
Apr 11, 2023
Merged

Set the bounds of the kdims List parameter #5667

merged 5 commits into from
Apr 11, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Mar 17, 2023

I just ran the unit test suite of HoloViews with Param installed from holoviz/param#605 and a few tests failed. They failed when kdims List is overridden in a sub Parameterized class, and the overriding List is not defining explicitly the new bounds. In the current state of Param (1.x) , bounds is not inherited from any super class but is always the default of (0, None) (meaning a list of any length). With the tested PR bounds is inherited.

The change made in this PR was to set explicitly the bounds in the subclasses. Alternatively, one could have loosen bounds in the super classes. The commits list what change was made and why. For instance, one could have set bounds of Chart.kdims (super class) to (0, None) instead of updating bounds on Spikes.kdims (sub class) to (0, None). I didn't spend much time thinking about doing the alternative

I noticed there are a few typos in the commits, here are the changes made:

  • set bounds to (0,None) to Spikes.vdims to override Chart.vdims bounds of (1, None)
  • set bounds to (3,3) to Path3D.vdims to override Geometry.vdims bounds of (2, 2)
  • set bounds to (3,3) to Scatter3D.vdims to override Geometry.vdims bounds of (2, 2)
  • set bounds to (3,3) to TriSurface.vdims to override Geometry.vdims bounds of (2, 2)

@codecov-commenter
Copy link

codecov-commenter commented Mar 17, 2023

Codecov Report

Merging #5667 (1e2b99f) into main (9abcf4e) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #5667      +/-   ##
==========================================
- Coverage   88.29%   88.29%   -0.01%     
==========================================
  Files         302      302              
  Lines       62541    62541              
==========================================
- Hits        55220    55219       -1     
- Misses       7321     7322       +1     
Impacted Files Coverage Δ
holoviews/element/chart3d.py 85.29% <ø> (ø)
holoviews/element/chart.py 96.84% <100.00%> (ø)
holoviews/element/tabular.py 51.56% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@maximlt
Copy link
Member Author

maximlt commented Apr 11, 2023

@hoxbro this could be merged safely, and need to be merged not to break HoloViews with Param 2.0.

@hoxbro hoxbro merged commit 31d00db into main Apr 11, 2023
@hoxbro hoxbro deleted the fix_bounds branch April 11, 2023 17:27
@hoxbro
Copy link
Member

hoxbro commented Apr 11, 2023

Thank you for this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants