This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Ecdc 3331 nxoff geometry #1040
Open
ggoneiESS
wants to merge
8
commits into
main
Choose a base branch
from
ECDC-3331-NXoff_geometry
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+112
−78
Open
Ecdc 3331 nxoff geometry #1040
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
cda64f0
failing test but geometry logic changed
ggoneiESS 54bd0b1
updated test and created new geometry
ggoneiESS 22888d0
asserting correct number of vertexes!
ggoneiESS 6490006
name adjuted to cross-check geometry key
ggoneiESS f4d52df
GO FORMAT YOURSELF (black)
cow-bot 6b5d898
Update NeXus HTML documentation
cow-bot d53144f
Merge branch 'main' into ECDC-3331-NXoff_geometry
ggoneiESS 74cca06
Update NeXus HTML documentation
cow-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
from PySide6.QtGui import QMatrix4x4, QVector3D | ||
|
||
from nexus_constructor.common_attrs import ( | ||
GEOMETRY_NX_CLASS, | ||
OFF_GEOMETRY_NX_CLASS, | ||
NX_BOX, | ||
SHAPE_GROUP_NAME, | ||
SHAPE_NX_CLASS, | ||
|
@@ -191,11 +191,11 @@ def __init__( | |
Group.__init__(self, name) | ||
self._size = [length, width, height] | ||
self._units = units | ||
self.nx_class = GEOMETRY_NX_CLASS | ||
self.nx_class = OFF_GEOMETRY_NX_CLASS | ||
self._create_datasets_and_add_to_shape_group() | ||
Comment on lines
+194
to
195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method If not, then this file may need a bigger change to translate all NXshape geometries to use NXoff_geometry |
||
|
||
@property | ||
def detector_number(self) -> List[int]: | ||
def detector_number(self) -> Optional[List[int]]: | ||
if self._detector is None: | ||
return None | ||
return self._detector.tolist() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
from nexus_constructor.common_attrs import ( | ||
CYLINDRICAL_GEOMETRY_NX_CLASS, | ||
GEOMETRY_GROUP_NAME, | ||
GEOMETRY_NX_CLASS, | ||
OFF_GEOMETRY_NX_CLASS, | ||
PIXEL_SHAPE_GROUP_NAME, | ||
SHAPE_GROUP_NAME, | ||
|
@@ -714,14 +713,14 @@ def test_GIVEN_valid_pixel_mapping_and_cylindrical_shape_WHEN_reading_pixel_data | |
def test_GIVEN_box_shape_json_WHEN_reading_shape_THEN_geometry_object_has_expected_properties( | ||
box_shape_reader, box_shape_json, mock_component | ||
): | ||
# no detector faces | ||
name = box_shape_json[CommonKeys.NAME] | ||
box_shape_reader.add_shape_to_component() | ||
shape = mock_component[name] | ||
assert isinstance(shape, BoxGeometry) | ||
assert isinstance(shape, OFFGeometryNexus) | ||
assert shape.name == name | ||
assert shape.nx_class == GEOMETRY_NX_CLASS | ||
assert shape.size[0] == 6.0 | ||
assert shape.size[1] == 12.0 | ||
assert shape.size[2] == 15.0 | ||
assert shape.nx_class == OFF_GEOMETRY_NX_CLASS | ||
assert len(shape.faces[0]) == 4 | ||
assert len(shape.faces) == 6 | ||
Comment on lines
+723
to
+724
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall we assert the dimensions of the shape like length/width/height? |
||
assert shape.units == "m" | ||
assert shape.name == GEOMETRY_GROUP_NAME |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?