question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Active scalars regression

See original GitHub issue

Describe the bug, what’s wrong, and what you expect:

It’s my opinion that the following is a regression

#1593 introduced a regression where a mesh can have arrays but no active scalars

Take a look at my comment: https://github.com/pyvista/pyvista/pull/1881#issuecomment-981981603


To Reproduce

>>> from pyvista import examples
>>> points = examples.download_sparse_points()
>>> points
PolyData (0x7fbc79419fa0)
  N Cells:	1
  N Points:	16
  X Bounds:	-1.500e+01, 1.500e+01
  Y Bounds:	5.000e+00, 3.500e+01
  Z Bounds:	2.327e+00, 1.102e+01
  N Arrays:	1

>>> points.threshold()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bane/Software/pyvista/pyvista/pyvista/core/filters/data_set.py", line 842, in threshold
    raise ValueError('No arrays present to threshold.')
ValueError: No arrays present to threshold.
>>>

Even though there is 1 array.


System Information: on main and we’re seeing it in the docs

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
MatthewFlammcommented, Nov 29, 2021

.threshold() only uses scalars while .streamlines() only uses vectors. If we use this logic for threshold to motivate setting a default scalars, why not for vectors based on streamlines and similar?

Maybe the answer is that this should apply to both scalars or vectors? I’m not aware of any filters that use the other attributes, but I’m not really sure. This could backfire later if any exist or get added later.

It also gets tricky if this will also apply to vectors as some 3D data is actually not a vector but a 3 component scalar. How do we distinguish between them to set a default vectors? I suppose the worst that happens is we plot based on an incorrect type.

2reactions
adeakcommented, Nov 29, 2021

We can fix part of this. We now have machinery that can add data arrays both setting them active and not. It seems that (even if we don’t implement auto-activation of unambiguous arrays) all the meshes created by us (in this case in download_sparse_points()) should have their scalars activated.

And a mostly side note: I wonder if the design choice of always activating one interferes with the concept of active scalars/t_coords/normals/etc. which was also recently added (probably in the same PR, in fact).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scalar on time-by-distribution regression and its application ...
Specifically, we develop scalar on time-by-distribution regression (SOTDR) to model associations between scalar response of interest such as ...
Read more >
Generalized multilevel function-on-scalar regression and ...
This manuscript considers regression models for generalized, multilevel functional responses: functions are generalized in that they follow an exponential ...
Read more >
An introduction to semiparametric function-on-scalar regression
Function-on-scalar regression models feature a function over some domain as the response while the regressors are scalars. Collections of time series as ...
Read more >
[1806.01460] Dynamic Function-on-Scalars Regression - arXiv
The regression coefficient function for each predictor is allowed to be dynamic, which is essential for applications where the association ...
Read more >
Penalized scalar-on-functions regression with interaction term
Generalized models for scalar responses with functional covariates are extended to include linear functional interaction terms.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found