diff --git a/nexus_constructor/field_utils.py b/nexus_constructor/field_utils.py index 2117ce07f..da79e0c27 100644 --- a/nexus_constructor/field_utils.py +++ b/nexus_constructor/field_utils.py @@ -7,7 +7,13 @@ from nexus_constructor.field_widget import FieldWidget from nexus_constructor.invalid_field_names import INVALID_FIELD_NAMES from nexus_constructor.model.group import Group -from nexus_constructor.model.module import Dataset, FileWriterModule, Link, StreamModule, FileWriter +from nexus_constructor.model.module import ( + Dataset, + FileWriterModule, + Link, + StreamModule, + FileWriter, +) from nexus_constructor.model.value_type import ValueTypes from nexus_constructor.utils.required_component_fields import required_component_fields from nexus_constructor.validators import FieldType diff --git a/nexus_constructor/field_widget.py b/nexus_constructor/field_widget.py index 0c8161a69..0eda46af7 100644 --- a/nexus_constructor/field_widget.py +++ b/nexus_constructor/field_widget.py @@ -25,7 +25,13 @@ from nexus_constructor.field_attrs import FieldAttrsDialog from nexus_constructor.invalid_field_names import INVALID_FIELD_NAMES from nexus_constructor.model.group import Group -from nexus_constructor.model.module import Dataset, FileWriter, FileWriterModule, Link, StreamModule +from nexus_constructor.model.module import ( + Dataset, + FileWriter, + FileWriterModule, + Link, + StreamModule, +) from nexus_constructor.model.value_type import VALUE_TYPE_TO_NP, ValueTypes from nexus_constructor.stream_fields_widget import StreamFieldsWidget from nexus_constructor.ui_utils import validate_line_edit @@ -456,7 +462,14 @@ def field_type_changed(self): self.streams_widget.ok_validator.validate_ok() self.streams_widget.cancel_button.clicked.connect(self.reset_field_type) elif self.field_type == FieldType.link: - self.set_visibility(True, False, False, False, show_unit_line_edit=False, show_attrs_edit=False) + self.set_visibility( + True, + False, + False, + False, + show_unit_line_edit=False, + show_attrs_edit=False, + ) self._set_up_value_validator(False) elif self.field_type == FieldType.filewriter: self.set_visibility(False, False, False, False, True, False, False) @@ -488,9 +501,7 @@ def _set_up_value_validator(self, is_link: bool): else: self.value_line_edit.setValidator( FieldValueValidator( - self.field_type_combo, - self.value_type_combo, - self.field_type.value + self.field_type_combo, self.value_type_combo, self.field_type.value ) ) tooltip_on_accept = "Value is cast-able to numpy type." diff --git a/nexus_constructor/json/load_from_json.py b/nexus_constructor/json/load_from_json.py index 24ad1a2ac..56051ef0c 100644 --- a/nexus_constructor/json/load_from_json.py +++ b/nexus_constructor/json/load_from_json.py @@ -277,10 +277,11 @@ def _read_json_object(self, json_object: Dict, parent_node: Group = None): elif CommonKeys.MODULE in json_object and NodeType.CONFIG in json_object: module_type = json_object[CommonKeys.MODULE] if ( - (module_type == WriterModules.DATASET.value or module_type == WriterModules.FILEWRITER.value) - and json_object[NodeType.CONFIG][CommonKeys.NAME] - == CommonAttrs.DEPENDS_ON - ): + module_type == WriterModules.DATASET.value + or module_type == WriterModules.FILEWRITER.value + ) and json_object[NodeType.CONFIG][ + CommonKeys.NAME + ] == CommonAttrs.DEPENDS_ON: nexus_object = None elif module_type in [x.value for x in WriterModules]: nexus_object = create_fw_module_object( diff --git a/nexus_constructor/model/module.py b/nexus_constructor/model/module.py index ac87761f9..1219310b2 100644 --- a/nexus_constructor/model/module.py +++ b/nexus_constructor/model/module.py @@ -173,7 +173,9 @@ class FileWriter(FileWriterModule): name = attr.ib(type=str) type = attr.ib(type=str, default="string") values = attr.ib(type=str, default=None) - writer_module = attr.ib(type=str, default=WriterModules.FILEWRITER.value, init=False) + writer_module = attr.ib( + type=str, default=WriterModules.FILEWRITER.value, init=False + ) def as_dict(self, error_collector: List[str]): return { @@ -395,9 +397,7 @@ def create_fw_module_object(mod_type, configuration, parent_node): ) elif mod_type == WriterModules.FILEWRITER.value: fw_mod_obj = fw_mod_class( - name=configuration[CommonKeys.NAME], - parent_node=parent_node, - type="string" + name=configuration[CommonKeys.NAME], parent_node=parent_node, type="string" ) elif mod_type == WriterModules.DATASET.value: if CommonKeys.DATA_TYPE in configuration: diff --git a/nexus_constructor/module_view.py b/nexus_constructor/module_view.py index 642b27f70..bb792a583 100644 --- a/nexus_constructor/module_view.py +++ b/nexus_constructor/module_view.py @@ -31,7 +31,10 @@ def _setup_frame(self, module): source = module.source if module.source else "not specified" self.layout.addWidget(self._get_label(f"link name: {name} | ")) self.layout.addWidget(self._get_label(f"source: {source}")) - elif module.writer_module == WriterModules.DATASET.value or module.writer_module == WriterModules.FILEWRITER.value: + elif ( + module.writer_module == WriterModules.DATASET.value + or module.writer_module == WriterModules.FILEWRITER.value + ): name = module.name if module.name else "not specified" dtype = module.type if module.type else "not specified" self.layout.addWidget(self._get_label(f"dataset name: {name} | ")) @@ -74,7 +77,8 @@ def _set_existing_items(self): if ( self.module.writer_module == WriterModules.DATASET.value or self.module.writer_module == WriterModules.LINK.value - or self.module.writer_module in [StreamMode.value for StreamMode in StreamModules] + or self.module.writer_module + in [StreamMode.value for StreamMode in StreamModules] or self.module.writer_module == WriterModules.FILEWRITER.value ): update_function = find_field_type(module, []) diff --git a/nx-class-documentation/html/applying-nexus.html b/nx-class-documentation/html/applying-nexus.html index 99ab54dc6..47ed1fa7c 100644 --- a/nx-class-documentation/html/applying-nexus.html +++ b/nx-class-documentation/html/applying-nexus.html @@ -1,13 +1,12 @@ - - + 1.3. Constructing NeXus Files and Application Definitions — nexus v2020.10 documentation @@ -790,7 +789,7 @@

Navigation

\ No newline at end of file diff --git a/nx-class-documentation/html/authorgroup.html b/nx-class-documentation/html/authorgroup.html index 736586ba3..285aabff1 100644 --- a/nx-class-documentation/html/authorgroup.html +++ b/nx-class-documentation/html/authorgroup.html @@ -1,13 +1,12 @@ - - + 9.1. Authors — nexus v2020.10 documentation @@ -152,7 +151,7 @@

Navigation

\ No newline at end of file diff --git a/nx-class-documentation/html/classes/applications/NXarchive.html b/nx-class-documentation/html/classes/applications/NXarchive.html index da46f168f..77f79b58b 100644 --- a/nx-class-documentation/html/classes/applications/NXarchive.html +++ b/nx-class-documentation/html/classes/applications/NXarchive.html @@ -1,13 +1,12 @@ - - + 3.3.2.1. NXarchive — nexus v2020.10 documentation @@ -451,7 +450,7 @@

Navigation

\ No newline at end of file diff --git a/nx-class-documentation/html/classes/applications/NXarpes.html b/nx-class-documentation/html/classes/applications/NXarpes.html index 8f214dd91..8b6d450eb 100644 --- a/nx-class-documentation/html/classes/applications/NXarpes.html +++ b/nx-class-documentation/html/classes/applications/NXarpes.html @@ -1,13 +1,12 @@ - - + 3.3.2.2. NXarpes — nexus v2020.10 documentation @@ -370,7 +369,7 @@

Navigation

\ No newline at end of file diff --git a/nx-class-documentation/html/classes/applications/NXcanSAS.html b/nx-class-documentation/html/classes/applications/NXcanSAS.html index b93292b91..fb1b7bfdb 100644 --- a/nx-class-documentation/html/classes/applications/NXcanSAS.html +++ b/nx-class-documentation/html/classes/applications/NXcanSAS.html @@ -1,13 +1,12 @@ - - + 3.3.2.3. NXcanSAS — nexus v2020.10 documentation @@ -192,7 +191,7 @@

Navigation

Use the Unidata UDunits [1] specification as this is compatible with various community standards.