Skip to content

Fix get_data_range for nested MultiBlock#793

Merged
banesullivan merged 3 commits intomasterfrom
patch/multi-block-range
Jun 18, 2020
Merged

Fix get_data_range for nested MultiBlock#793
banesullivan merged 3 commits intomasterfrom
patch/multi-block-range

Conversation

@banesullivan
Copy link
Copy Markdown
Member

Overview

Fixes an issue if trying to plot a nested MultiBlock with a common scalars array

@banesullivan banesullivan force-pushed the patch/multi-block-range branch from 9a48ebf to f5d29a7 Compare June 12, 2020 18:10
@banesullivan banesullivan added the deprecation Deprecation involved. PRs that deprecate things. label Jun 13, 2020
@banesullivan
Copy link
Copy Markdown
Member Author

This technically includes a deprecation. Users used to be able to plot a MultiBlock data set with a scalars argument and any meshes with those scalars would show those values mapped while sub-blocks without the scalars of that name would be a solid color. Now, if any sub-blocks do not have those scalars, a ValueError is raised to require the user to plot sub-blocks individually.

This is in line with our goal to better enforce keyword arguments. If the scalars argument is passed and those scalars are not present, an error should be raised. Simply skipping over it could be confusing behavior (e.g. a user could be misspelling an array name and pull their hair out trying to figure out why those data aren't showing)

@akaszynski
Copy link
Copy Markdown
Member

Now, if any sub-blocks do not have those scalars, a ValueError is raised to require the user to plot sub-blocks individually.

This makes sense, and it operates similarly to how add_mesh(scalars= or plot operates.

Copy link
Copy Markdown
Member

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding the test as well.

Co-authored-by: Alex Kaszynski <akascap@gmail.com>
@banesullivan banesullivan merged commit 9cdc6f9 into master Jun 18, 2020
banesullivan added a commit that referenced this pull request Jun 29, 2020
banesullivan added a commit that referenced this pull request Jul 9, 2020
@banesullivan banesullivan deleted the patch/multi-block-range branch July 22, 2020 02:24
@akaszynski akaszynski mentioned this pull request Sep 8, 2020
adeak added a commit to adeak/pyvista that referenced this pull request Nov 9, 2020
* upstream/master: (37 commits)
  🔧 Fix unused variables (pyvista#847)
  Add better Unstructured Grid Documentation (pyvista#845)
  Fix typo in plotting.py (pyvista#846)
  Feat: Implement compute_derivative (pyvista#837)
  New probe filter and massively improve interpolate filter (pyvista#842)
  Clarify clip filter docstring (pyvista#840)
  Update create-structured-surface.py (pyvista#844)
  Update topo-map.py (pyvista#841)
  Add release suffix to version string (pyvista#817)
  Add pathlib Support (pyvista#836)
  Add tolerance argument to sample_over_line (pyvista#828)
  vector slice from pyvista/pyvista-support#134 (pyvista#808)
  Fix is_all_triangles (pyvista#832)
  Misc. documentation fixes (pyvista#829)
  Follow up pyvista#793: fix get_data_range (pyvista#818)
  Fix GPU info in scooby report (pyvista#825)
  Patch for auto_close warning (pyvista#798)
  Add texture demo with scalar data (pyvista#821)
  MAINT: Log init start/stop (pyvista#819)
  Add PolyData strip filter (pyvista#807)
  ...
@banesullivan banesullivan added the bug Uh-oh! Something isn't working as expected. label Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Uh-oh! Something isn't working as expected. deprecation Deprecation involved. PRs that deprecate things.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants