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

SFT's hidden _data should never be used. #891

Open
EmmaRenauld opened this issue Feb 6, 2024 · 2 comments
Open

SFT's hidden _data should never be used. #891

EmmaRenauld opened this issue Feb 6, 2024 · 2 comments
Assignees

Comments

@EmmaRenauld
Copy link
Contributor

As discovered with François, the sft.data_per_point[key]._data is not always updated when shuffling or modifying the SFT.

This is probably true for all other usages of hidden _data.

I cleaned one line of code (see #890) , but code should be verified everyhwere.

@frheault

@arnaudbore
Copy link
Contributor

is it only dpp and dps ? or every single one like sft.streamlines._data ?

@frheault
Copy link
Member

It is true of that one too, luckily Scilpy scripts are usually doing the right thing, but this is very dangerous when modifying a script, developing a new feature or hacking away in IPython.

The array sequence use something similar to https://numpy.org/doc/stable/reference/generated/numpy.ndarray.view.html

This means that if you slice an array sequence you are playing with a view and the underlying data is untouched

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

No branches or pull requests

4 participants