diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 3402a7ba3..54e494ae2 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -199,6 +199,7 @@ jobs: - name: Run tests with pytest & coverage shell: bash -l {0} run: | + # set -vxeuo pipefail coverage run --concurrency=thread --parallel-mode -m pytest -vvv --exitfirst . coverage combine coverage report --precision 3 diff --git a/apstools/callbacks/nexus_writer.py b/apstools/callbacks/nexus_writer.py index 5f1b8001c..998f4408c 100644 --- a/apstools/callbacks/nexus_writer.py +++ b/apstools/callbacks/nexus_writer.py @@ -224,9 +224,9 @@ def get_sample_title(self): """ return the title for this sample - default title: {plan_name}-S{scan_id}-{short_uid} + default title: S{scan_id}-{plan_name}-{short_uid} """ - return f"{self.plan_name}-S{self.scan_id:04d}-{self.uid[:7]}" + return f"S{self.scan_id:04d}-{self.plan_name}-{self.uid[:7]}" def get_stream_link(self, signal, stream=None, ref=None): """ @@ -444,7 +444,8 @@ def write_entry(self): if self.warn_on_missing_content: logger.warning("No data for /entry/run_cycle") - nxentry["title"] = self.get_sample_title() + title = self.root.get("/entry/instrument/bluesky/metadata/title") + nxentry["title"] = title or self.get_sample_title() nxentry["plan_name"] = self.root["/entry/instrument/bluesky/metadata/plan_name"] nxentry["entry_identifier"] = self.root["/entry/instrument/bluesky/uid"]