Skip to content

Unexpected propagation of setting variances to Variable through DataArray #3458

@YooSunYoung

Description

@YooSunYoung

Christian gave me a feedback about the tutorial of scipp
that the setting variances in the DataArray propagates all the way to the original Variable.

It was
https://scipp.github.io/getting-started/quick-start.html
This page,

array = array.copy()
array.variances = np.square(rng.random((4, 5)))
sc.show(array)

He tried deleting array = array.copy() in this part and found it out.

I agree that it can be surprising to users.
Should we add the explanation whenever we have copy in the tutorial?

Or can we make it in a way that setting variances on DataArray doesn't affect the original Variable that became the DataArray.data?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions