Adding a batch of plans to the queue based on uploaded spreadsheet #137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Experimental feature that allows to submit a batch of plans to the queue by uploading spreadsheet to HTML server:
where
<path-to-spreadsheet>
is a path to the Excel spreadsheet. Now only custom Excel spreadsheet for submitting sequences ofxafs
plan to BMM beamline are supported. A beamline may use several types of spreadsheets for different types of experimental work. The API allows to pass spreasheet type as optionaldata_type
parameter::Spreadsheet type (
data_type
) is a user defined string, which is recognized by the beamline-specific custom function, which is called for processing the spreadsheet. There is no standard for beamline-specific spreadsheet types.By default, spreadsheets are processed by built-in default function, which generates a list of plans based on the contents of spreadsheet (this function is not implemented yet). Since many users would prefer to use custom spreadsheets and write their own code that converts the spreadsheets to lists of plans, the server implements mechanism that allows to substitute default processing function. The custom function must be named
spreadsheet_to_plan_list
with matching signature and be importable from an installed python module (from <some_module> import spreadsheet_to_plan_list
should import the function). The name of the module is passed to the server by setting environment variableBLUESKY_HTTPSERVER_CUSTOM_MODULE
to the name of the module before starting the server. For example, the server may be started with custom module for BMM beamline as follows:('-' are allowed in module name: they are automatically replaced by '_'). It is assumed that the same module will be used to keep all code that is specific for a given beamline. If the server is started with the custom module, the users will still be able to access the default processing function: if the custom function is returning
None
(in response to certain value ofdata_type
or missing datatype), then the server will call the default function. Custom function is expected to raise an exception with error message if it fails to process spreadsheet due to error.Operation of the server was tested using custom processing module for BMM beamline NSLS-II-BMM/bluesky-httpserver-bmm#1 using the following simulated startup script:
Addresses the issue #132