Open jayich opened 6 years ago
@aransfor I am working on this issue on https://github.com/CampbellGroup/common/tree/mf/228_script_scanner_enhancements. The syntax for the docstring of the experiments to be loaded in script scanner is:
'''
### BEGIN EXPERIMENT INFO
[info]
name = AOMPowerCalibration
load_into_scriptscanner = False
### END EXPERIMENT INFO
'''
I think this docstring has to be added at the beginning of the experiment. name
is the class name in the experiment module you want to load, and load_into_scriptscanner
is a boolean value deciding whether the experiment should be loaded.
The new scriptscanner_config.py will look like,
class config(object):
scripts = []
paths = ["pydux.lib.control.experiments"]
allowed_concurrent = {}
launch_history = 1000
scripts
is now an empty list that I am going to eliminate later. paths
is a list that saves the paths that script scanner will try to look for experiments.
As long as the experiment is in paths
, name
in the experiment docstring is correct, and load_into_scriptscanner
is set to True, the script scanner should load the experiment.
Is it possible to make the headline #!scriptscanner and that is it? I want to avoid spelling errors of which I make a lot. If it was just that one line I would delete it if I didnt want it to show up
Also I think we can eliminate the config all together and just store the path in the registry the way datavault does
BTW this looks awesome, I have wanted this for a long time
@aransfor The script scanner needs to know which class in an experiment module to look for if there are multiple classes in an experiment. Therefore, I think we cannot reduce the docstring to only a headline. Also, I want to follow the docstring format of how labrad web manager finds servers.
You can copy the same docstring to different experiments and only change the name
variable and potentially change load_into_scriptscanner
.
I think eliminating the config and moving to registry is a good idea.
@fanmingyu212 I suppose I agree. I would only suggest two things then, At least for the time being SS should be backward compatible with the config file and also the allowed concurrent should be an optional tag in the experiment header not the config/registry. Also perhaps an 'allow all' argument should be added while your deep in this
Have script scanner look in a directory and subdirectories for experiments. Experiments should automatically load into script scanner based on a variable in the experiment.py file, similar to how labrad finds servers.