Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

user27182
Copy link
Contributor

Overview

extract_values returns self.copy() for empty inputs. But the return type should be MultiBlock or UnstructuredGrid. This PR fixes this.

The scalar array validation is also redundant and is simplified - it raises the same errors which are otherwise raised automatically by set_default_active_scalars and get_array.

@pyvista-bot pyvista-bot added the maintenance Low-impact maintenance activity label Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.51%. Comparing base (d9bf85a) to head (52251ee).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7001   +/-   ##
=======================================
  Coverage   97.50%   97.51%           
=======================================
  Files         144      144           
  Lines       28554    28556    +2     
=======================================
+ Hits        27843    27845    +2     
  Misses        711      711           

@pyvista-bot
Copy link
Contributor

pyvista-bot commented Dec 18, 2024

@pyvista-bot pyvista-bot temporarily deployed to pull request December 18, 2024 22:11 Inactive
@tkoyama010 tkoyama010 self-requested a review December 18, 2024 22:36
@pyvista-bot pyvista-bot temporarily deployed to pull request December 19, 2024 01:07 Inactive
@tkoyama010 tkoyama010 added the breaking-change Changes that break backwards compatibility, especially changed default parameters. label Dec 20, 2024
Copy link
Member

@tkoyama010 tkoyama010 left a comment

Choose a reason for hiding this comment

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

LGTM. Just a minor suggestion: The variable split is accessed globally from outside the function, which made the code slightly harder to follow. It might be a good idea to modularize the internal functions for better readability. It is another PR anyway.

@tkoyama010 tkoyama010 enabled auto-merge (squash) December 20, 2024 22:07
@user27182
Copy link
Contributor Author

LGTM. Just a minor suggestion: The variable split is accessed globally from outside the function, which made the code slightly harder to follow. It might be a good idea to modularize the internal functions for better readability. It is another PR anyway.

I'm not sure I follow, extract_values has a keyword argument split, do you mean this is defined elsewhere? Should currently be defined at the root function level:

def extract_values(split):
    ...
    if split: 
        ...

@tkoyama010 tkoyama010 merged commit f4900fb into main Dec 20, 2024
34 checks passed
@tkoyama010 tkoyama010 deleted the maint/extract-values-empty branch December 20, 2024 23:58
@pyvista-bot pyvista-bot temporarily deployed to pull request December 21, 2024 00:03 Inactive
@tkoyama010
Copy link
Member

LGTM. Just a minor suggestion: The variable split is accessed globally from outside the function, which made the code slightly harder to follow. It might be a good idea to modularize the internal functions for better readability. It is another PR anyway.

I'm not sure I follow, extract_values has a keyword argument split, do you mean this is defined elsewhere? Should currently be defined at the root function level:

def extract_values(split):
    ...
    if split: 
        ...

I meant my comment in the sense that I was a bit confused because _validate_values_and_ranges does not have split as an argument. But this is a minor issue since, as you say, it is immediately obvious that it is in the extract_values.

@user27182
Copy link
Contributor Author

Oh I understand now, the variable scope is not local. Yes that can be confusing (and buggy).

@banesullivan banesullivan mentioned this pull request Apr 17, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Changes that break backwards compatibility, especially changed default parameters. maintenance Low-impact maintenance activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants