Skip to content

Commit

Permalink
Rename transformation -> transform
Browse files Browse the repository at this point in the history
  • Loading branch information
jl-wynen committed Mar 11, 2024
1 parent 3a51a10 commit 99a6a48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/ess/reduce/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def load_detector(
"""Load a single detector (bank) from a NeXus file.
The detector positions are computed automatically from NeXus transformations,
and the combined transformation is stored under the name 'transformation'.
and the combined transformation is stored under the name 'transform'.
Parameters
----------
Expand Down Expand Up @@ -109,7 +109,7 @@ def load_monitor(
"""Load a single monitor from a NeXus file.
The monitor position is computed automatically from NeXus transformations,
and the combined transformation is stored under the name 'transformation'.
and the combined transformation is stored under the name 'transform'.
Parameters
----------
Expand Down Expand Up @@ -153,7 +153,7 @@ def load_source(
"""Load a source from a NeXus file.
The source position is computed automatically from NeXus transformations,
and the combined transformation is stored under the name 'transformation'.
and the combined transformation is stored under the name 'transform'.
Parameters
----------
Expand Down Expand Up @@ -240,7 +240,7 @@ def _load_group_with_positions(
sc.DataGroup, _unique_child_group(instrument, nx_class, group_name)[()]
)

transform_out_name = 'transformation'
transform_out_name = 'transform'
if transform_out_name in loaded:
raise RuntimeError(
f"Loaded data contains an item '{transform_out_name}' but we want to "
Expand Down
4 changes: 2 additions & 2 deletions tests/nexus_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def _source_data() -> sc.DataGroup:
'probe': 'neutron',
'type': 'Spallation Neutron Source',
'position': sc.vector([0, 0, 0], unit='m'),
'transformation': sc.spatial.translation(value=[0, 0, 0], unit='m'),
'transform': sc.spatial.translation(value=[0, 0, 0], unit='m'),
}
)

Expand Down Expand Up @@ -216,7 +216,7 @@ def test_load_detector(nexus_file, expected_bank12, entry_name):
sc.testing.assert_identical(detector['bank12_events'], expected_bank12)
offset = detector_transformation_components()['offset']
sc.testing.assert_identical(
detector['transformation'],
detector['transform'],
sc.spatial.translation(unit=offset.unit, value=offset.value),
)

Expand Down

0 comments on commit 99a6a48

Please sign in to comment.