Skip to content

Commit

Permalink
Improve whether the sample has protein acronym or
Browse files Browse the repository at this point in the history
  • Loading branch information
FLorial Jean Baptiste committed Feb 14, 2024
1 parent ab68b4f commit 22eccef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mxcubecore/HardwareObjects/Session.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,10 @@ def get_default_prefix(self, sample_data_node=None, generic_name=False):
prefix = proposal

if sample_data_node:
if sample_data_node.has_lims_data():
if (
sample_data_node.has_lims_data()
or sample_data_node.has_protein_acronym()
):
protein_acronym = sample_data_node.crystals[0].protein_acronym
name = sample_data_node.name
if protein_acronym:
Expand Down
8 changes: 8 additions & 0 deletions mxcubecore/model/queue_model_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,14 @@ def has_lims_data(self):
except TypeError:
return False
return False

def has_protein_acronym(self):
try:
if hasattr(self.crystals[0], "protein_acronym"):
return True
except TypeError:
return False
return False

def get_name(self):
return self._name
Expand Down

0 comments on commit 22eccef

Please sign in to comment.