Skip to content

update defaults behaviour - #65

Merged
DanPorter merged 9 commits into
masterfrom
dp/add_get_default_name
Aug 28, 2026
Merged

update defaults behaviour#65
DanPorter merged 9 commits into
masterfrom
dp/add_get_default_name

Conversation

@DanPorter

Copy link
Copy Markdown
Collaborator

Adds a new function to return default dataset or group name

eval_functions.py

  • refactor prepare_expression, adding separate functions for each replacement.

hdfmap_class.py

  • Add HdfMap.get_default_name()
  • move generate_alt_name() into eval_functions.py
  • move Dataset and Group into objects.py
  • add HdfMap.generate_eval_expression() - This new function is useful for debugging and returns the prepared expression and dict of data, prior to evaluation.
  • add HdfMap.merge_default_names

reloader_class.py

  • add HdfLoader.generate_expression()
  • Move HdfMap Interpreter from HdfMap class to reloader class.

Tests

  • add additional tests
  • All tests pass

Adds a new function to return default dataset or group name

## hdfmap_class.py
 - Add *HdfMap.get_default_name()*
 - add test
## hdfmap_class.py
 - move *generate_alt_name()* into eval_functions.py
 - move Dataset and Group into objects.py
change *prepare_expression()* to use a dict of Dataset objects rather than the hdf file, so that prepare_expression can be used in HdfMap without opening the file.

In practice, this doesn't work as a complete list of datasets needs to be built, testing each dataset in the list against the hdf file, which is much slower than the old way of only testing the identifiers that exist in the expression.

Tests pass except test_compare_many_files, which shows a significant slow down.

This commit will be reverted.
This new function is useful for debugging and returns the prepared expression and dict of data, prior to evaluation.

## hdfmap_class.py
 - add *HdfMap.generate_eval_expression()*
 - add test for this

## reloader_class.py
 - add *HdfLoader.generate_expression()*

All tests pass.
Move HdfMap Interpreter from HdfMap class to reloader class.

All tests pass.
## eval_functions.py
 - refactor *prepare_expression*, adding seperate functions for each replacement.

## hdfmap_class.py
 - add *HdfMap.merge_default_names*
 - add tests
@DanPorter
DanPorter merged commit 8bad266 into master Aug 28, 2026
10 checks passed
@DanPorter
DanPorter deleted the dp/add_get_default_name branch August 28, 2026 14:27
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