Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Ecdc 3331 nxoff geometry #1040

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Ecdc 3331 nxoff geometry #1040

wants to merge 8 commits into from

Conversation

ggoneiESS
Copy link
Member

@ggoneiESS ggoneiESS commented Sep 25, 2023

Issue

https://jira.esss.lu.se/browse/ECDC-3331

We do not want to process geometries other than OFF geometries now. A release has been made as a final version supporting other types. This is in line with the NeXus standard and notes on OFF geometries can be found at https://confluence.esss.lu.se/display/ECDC/NeXus+Constructor

The Constructor almost exclusively uses OFF geometries anyway, but this makes it explicit that it will not be further supported.

Description of work

Three lines have been added to ensure that the code returns gracefully if JSON children are not present in shape processing. Otherwise, code has mostly been removed. In this removal, a tidy-up has been performed to make better use of Python typing methods.

Acceptance Criteria

Fully compatible with JSON that uses OFF geometries with no failures in the geometry section.

UI tests

No tests required except to visually determine the correct processing of a box geometry (which has been included as a unit test)

Nominate for Group Code Review

  • Nominate for code review

@ggoneiESS ggoneiESS requested a review from danesss September 25, 2023 12:00
Comment on lines -87 to -93
elif shape_type == GEOMETRY_NX_CLASS:
for child in self.shape_info[CommonKeys.CHILDREN][0][CommonKeys.CHILDREN]:
if (
child[NodeType.CONFIG][CommonKeys.NAME] == SHAPE_GROUP_NAME
and child[NodeType.CONFIG][CommonKeys.VALUES] == NX_BOX
):
self._add_box_shape_to_component()
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that this will break the loading of most existing instrument templates, because they tend to use NXgeometry in some places.

Do we need to drop support for NXgeometry? Or should we just move away from it in newly created files but still load old files correctly?

Comment on lines +723 to +724
assert len(shape.faces[0]) == 4
assert len(shape.faces) == 6
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we assert the dimensions of the shape like length/width/height?

Comment on lines +194 to 195
self.nx_class = OFF_GEOMETRY_NX_CLASS
self._create_datasets_and_add_to_shape_group()
Copy link
Contributor

@danesss danesss Sep 27, 2023

Choose a reason for hiding this comment

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

The method _create_datasets_and_add_to_shape_group(self) makes use of SHAPE_NX_CLASS. Is that still adequate when using NXoff_geometry?

If not, then this file may need a bigger change to translate all NXshape geometries to use NXoff_geometry

@ggoneiESS
Copy link
Member Author

on hold for now

@ggoneiESS ggoneiESS self-assigned this Oct 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants