Skip to content

add parents to Groups and Datasets objects - #59

Merged
DanPorter merged 4 commits into
masterfrom
58-incorrect-choice-of-default-axes
Aug 24, 2026
Merged

add parents to Groups and Datasets objects#59
DanPorter merged 4 commits into
masterfrom
58-incorrect-choice-of-default-axes

Conversation

@DanPorter

Copy link
Copy Markdown
Collaborator

To fix the issue #58 , a redesign of the NexusMap.nexus_default_names() function was required. As part of this I added parents to Group and Dataset objects and also performed some other major refactoring. I also added new tests to ensure old and new defaults stay the same, however there were some changes to the choices of scannables made. They are now more consistent.

eval_functions.py

  • omit /data when generating identifiers
  • join matching substrings before replacing '.' with '_' in generate_identifiers()

hdfmap_class.py

  • add parent to Group object
  • add default to Group object
  • add parent to Dataset object
  • populate parents
  • only populate array if default or not in array (fixes scannable paths)
  • add 'data' for image data groups (because it is removed with change to generate_ids)
  • generate_scannables_from_names() now uses default dataset name
  • first_last_scannables() refactored to be much simpler.

nexus.py

  • names_from_scan_fields now uses generate_identifier
  • default_nexus_names re-written to be simpler and more reliable. Now using default NeXus paths and checking these are in scannables first.

tests

  • add tests for parents, defaults and population speed.
  • add tests fro default names
  • updated edge_cases
  • added additional edge_cases

## eval_functions.py
 - omit /data when generating identifiers
 - join matching substrings before replacing '.' with '_' in generate_identifiers()

## hdfmap_class.py
 - add parent to Group object
 - add default to Group object
 - add parent to Dataset object
 - populate parents
 - only populate array if default or not in array (fixes scannable paths)
 - add 'data' for image data groups (because it is removed with change to generate_ids)
 - generate_scannables_from_names() now uses default dataset name
 - first_last_scannables() refactored to be much simpler.

## nexus.py
 - names_from_scan_fields now uses generate_identifier
 - default_nexus_names re-written to be simpler and more reliable. Now using default NeXus paths and checking these are in scannables first.

## tests
 - add tests for parents, defaults and population speed.
 - add tests fro default names
 - updated edge_cases
 - added additional edge_cases
@DanPorter DanPorter linked an issue Aug 24, 2026 that may be closed by this pull request
Test is too slow on CI tests and fails, instead compare the time between reading two files.
note that squeeze returns float if np.float64 is given, causing assert to fail. Change to asarray instead.
@DanPorter DanPorter self-assigned this Aug 24, 2026
@DanPorter
DanPorter merged commit 5e0cb52 into master Aug 24, 2026
10 checks passed
@DanPorter
DanPorter deleted the 58-incorrect-choice-of-default-axes branch August 24, 2026 10:39
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.

Incorrect choice of default axes

1 participant