Skip to content

fix element array#66

Merged
cmeyer merged 3 commits into
nion-software:masterfrom
cmeyer:fix-element-array
Apr 16, 2025
Merged

fix element array#66
cmeyer merged 3 commits into
nion-software:masterfrom
cmeyer:fix-element-array

Conversation

@cmeyer
Copy link
Copy Markdown
Collaborator

@cmeyer cmeyer commented Apr 14, 2025

  • Fix and test xdata.clone_with_data method.
  • Fix issue with promote_constant allowing data parameter.
  • Ensure element data always returns actual ndarray. Test.

This addresses an issue where basic math used to generate RGB data was not able to operate on an HDF5 dataset using inline operators. The way it addresses the issue is a general solution to ensure that the 'element' step in reducing data from higher dimensions to 1d or 2d data produces a guaranteed ndarray, which supports inline operators. This data reduction is explained here.

Please review for correctness or just to learn about the code. Comments welcome. I'd like to merge this within a few working days. This is an ad-hoc solution to nion-software/nionswift#1450. There may be other or parallel solutions. However, this seems like a good approach likely to avoid similar errors that may exist now or may arise in the future.

@cmeyer cmeyer force-pushed the fix-element-array branch from 8d176fe to 23d8ad2 Compare April 14, 2025 21:42
@cmeyer cmeyer merged commit 312242b into nion-software:master Apr 16, 2025
11 checks passed
@cmeyer cmeyer deleted the fix-element-array branch April 16, 2025 14:29
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.

1 participant