data policy: sample definition
Currently the sample is defined like this (Bliss 1.6)
DEMO_SESSION [1]: newsample("myname")
Sample set to 'myname'
Data path: /tmp/scans/inhouse/id002010/id00/myname/myname_0001
DEMO_SESSION [2]: SCAN_SAVING.sample_name
Out [2]: 'myname'
DEMO_SESSION [4]: SCAN_SAVING.dataset["Sample_description"] = "some description"
DEMO_SESSION [5]: SCAN_SAVING.dataset.existing
Out [5]: Namespace containing:
.Sample_description ('some description')
When adding sample metadata support in !2982 (merged), @sole, @demariaa and myself came to the conclusion that we should decouple the "sample" from the "collection" explicitly in the Bliss API. It is already decoupled implicitly because you can do newsample("myname")
and SCAN_SAVING.dataset["Sample_name"] = "mysamplename"
.
For the sake of argument I will use the word "collection" to refer to the collection of datasets, which often but not always coincides with an actual sample.
The proposed changes which will be included in !2982 (merged):
-
Add a new command
newcollection
DEMO_SESSION [1]: newcollection("myname") Collection set to 'myname' Data path: /tmp/scans/inhouse/id002010/id00/myname/myname_0001 DEMO_SESSION [2]: SCAN_SAVING.dataset["Sample_name"] !!! === KeyError: 'Sample_name' === !!! ( for more details type cmd 'last_error' )
-
Keep the command
newsample
which is the equivalent ofnewcollection("myname") SCAN_SAVING.dataset["Sample_name"] = "myname"
-
SCAN_SAVING.collection_name
replacesSCAN_SAVING.sample_name
-
SCAN_SAVING.sample_name
returnsSCAN_SAVING.dataset["Sample_name"]
@matias.guijarro @pithan This would require a db=1
flush because the Sample
Redis node will become a DatasetCollection
Redis node. Apart from the flushing, this change would be transparent to the BCU contact and the user.
Any objections, comments, adjustment?
@marcus.oscarsson @sfisher @vergaral: GUI/MX people, you are maybe already using the word "collection" so if you have a better suggestion, let me know. Just in case you don't follow, this was added recently to support ICAT metadata in Bliss: SCAN_SAVING.dataset["some_icat_field_name"] = "some_icat_field_value"
and Sample_name
is an ICAT field which can be defined for each individual dataset. Confusingly there is the newsample
command in Bliss which sets the Sample_name
ICAT field.