Skip to content

Commit

Permalink
MNT #876 use a link instead
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jan 9, 2024
1 parent 7e043eb commit 8c4b45e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apstools/callbacks/nexus_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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"]

Expand Down

0 comments on commit 8c4b45e

Please sign in to comment.