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

Commit

Permalink
GO FORMAT YOURSELF (black)
Browse files Browse the repository at this point in the history
  • Loading branch information
cow-bot committed Sep 25, 2023
1 parent 6490006 commit f4d52df
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nexus_constructor/json/load_from_json_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
NodeType,
)

DEPENDS_ON_IGNORE = [None, 'None', ".", ""]
DEPENDS_ON_IGNORE = [None, "None", ".", ""]


def _find_shape_information(children: List[Dict]) -> Union[Dict, None]:
Expand Down
10 changes: 6 additions & 4 deletions nexus_constructor/json/shape_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,9 +431,7 @@ def _all_in_list_have_expected_type(
)
return False

def _get_values_attribute(
self, dataset: Dict, parent_name: str
) -> Optional[List]:
def _get_values_attribute(self, dataset: Dict, parent_name: str) -> Optional[List]:
"""
Attempts to get the values attribute in a dataset. Creates an error message if it cannot be found.
:param dataset: The dataset we hope to find the values attribute in.
Expand Down Expand Up @@ -575,7 +573,11 @@ def _handle_mapping(self, children: List[Dict]):
detector_faces_dataset = self._get_shape_dataset_from_list(
DETECTOR_FACES, shape_group[CommonKeys.CHILDREN], False
)
if detector_faces_dataset and not isinstance(self.shape, BoxGeometry) and not isinstance(self.shape, CylindricalGeometry):
if (
detector_faces_dataset
and not isinstance(self.shape, BoxGeometry)
and not isinstance(self.shape, CylindricalGeometry)
):
self.shape.detector_faces = detector_faces_dataset[CommonKeys.VALUES]

def _find_and_add_pixel_offsets_to_component(
Expand Down
4 changes: 3 additions & 1 deletion nexus_constructor/model/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ def nx_class(self):
def nx_class(self, new_nx_class: str):
self.attributes.set_attribute_value(CommonAttrs.NX_CLASS, new_nx_class)

def set_field_value(self, name: str, value: Any, dtype: Optional[str], unit: str = ""):
def set_field_value(
self, name: str, value: Any, dtype: Optional[str], unit: str = ""
):
self[name] = Dataset(parent_node=self, name=name, type=dtype, values=value)
if unit:
self[name].attributes.set_attribute_value(CommonAttrs.UNITS, unit)
Expand Down
7 changes: 1 addition & 6 deletions tests/json/test_load_from_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,7 @@ def test_GIVEN_json_with_component_depending_on_non_existent_transform_WHEN_load

@pytest.mark.parametrize(
"depends_on_path",
[
".",
"",
'None',
None
],
[".", "", "None", None],
)
def test_GIVEN_json_with_component_with_null_depends_on_WHEN_loaded_THEN_no_effect(
json_dict_with_component, json_reader, depends_on_path
Expand Down

0 comments on commit f4d52df

Please sign in to comment.