From 7e043ebe1dc42658f01187e3a3a23080c39c8091 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Tue, 9 Jan 2024 09:53:24 -0600 Subject: [PATCH 1/4] MNT #876 title --- apstools/callbacks/nexus_writer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apstools/callbacks/nexus_writer.py b/apstools/callbacks/nexus_writer.py index 5f1b8001c..4273c5860 100644 --- a/apstools/callbacks/nexus_writer.py +++ b/apstools/callbacks/nexus_writer.py @@ -226,7 +226,8 @@ def get_sample_title(self): default title: {plan_name}-S{scan_id}-{short_uid} """ - return f"{self.plan_name}-S{self.scan_id:04d}-{self.uid[:7]}" + title = self.metadata.get("title") + return title or f"{self.plan_name}-S{self.scan_id:04d}-{self.uid[:7]}" def get_stream_link(self, signal, stream=None, ref=None): """ From 8c4b45e666c64a3c36d48a7d6e1f85b101f707e7 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Tue, 9 Jan 2024 10:08:52 -0600 Subject: [PATCH 2/4] MNT #876 use a link instead --- apstools/callbacks/nexus_writer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apstools/callbacks/nexus_writer.py b/apstools/callbacks/nexus_writer.py index 4273c5860..998f4408c 100644 --- a/apstools/callbacks/nexus_writer.py +++ b/apstools/callbacks/nexus_writer.py @@ -224,10 +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} """ - title = self.metadata.get("title") - return title or 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): """ @@ -445,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"] From 4d7513e42d671cad57e609471eb9b3afc9b7b5ab Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Tue, 9 Jan 2024 10:24:14 -0600 Subject: [PATCH 3/4] CI #876 --- .github/workflows/unit_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 3402a7ba3..f033adb47 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 From 717b1c4c16f6a8a89bc05d7835ee984462a5dd74 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Tue, 9 Jan 2024 10:41:14 -0600 Subject: [PATCH 4/4] CI #876 disable until #905 --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index f033adb47..54e494ae2 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -199,7 +199,7 @@ jobs: - name: Run tests with pytest & coverage shell: bash -l {0} run: | - set -vxeuo pipefail + # set -vxeuo pipefail coverage run --concurrency=thread --parallel-mode -m pytest -vvv --exitfirst . coverage combine coverage report --precision 3