Skip to content

Draft: scansaving: autocomplete for newcollection and newdataset

Valentin Valls requested to merge real-new-dataset into master

This PR add an argument autocomplete for both newcollection and newdataset in order to simplify some use case.

Previously newcollection was not always creating a new collection

  • Now you can use newcollection("mycollection", autocomplete=True), if "mycollection" it will create a new collection with a suffix like newdataset

Previously is was not possible to enforce a name for the dataset, newdataset was always picking a new dataset

  • Now to can use newdataset("mydataset", autocomplete=False), if the dataset already exists, it fails

(notice that the behaviour is the exact reverse, so default value is not the same to let them work as before)

As result i can now create random collections with fixed dataset names

newcollection("zseries", autocomplete=True)
# here we are sure the collection is empty, so we can pick fixed names
# (if it fails there is a problem on our code)
newdataset("layer1", autocomplete=False)
somescan()
newdataset("layer2", autocomplete=False)
somescan()
newdataset("layer3", autocomplete=False)
somescan()
Edited by Valentin Valls

Merge request reports