Skip to content

Conversation

@jokasimr
Copy link
Contributor

Fix set variances of McStas simulation data to square of event weights.

@jokasimr jokasimr requested a review from YooSunYoung March 31, 2025 09:41
)
da = sc.DataArray(
data=counts.copy().astype(sc.DType.int32),
data=counts.copy(),
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove astype to int...?

Copy link
Contributor Author

@jokasimr jokasimr Mar 31, 2025

Choose a reason for hiding this comment

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

Because the integer dtype can't have variances for some reason 🤷 (scipp raises an error)

Is it important that the weights are integers?

Copy link
Member

Choose a reason for hiding this comment

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

Integer counts make some operations faster but where doesn't like integer anyways so maybe it's fine...?

@jokasimr jokasimr merged commit d614d5f into main Mar 31, 2025
4 checks passed
@jokasimr jokasimr deleted the odin-variances branch March 31, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants