Reference¶
-
simtool.
searchForSimTool
(simToolName, simToolRevision=None)[source]¶ Lookup simtool by name and revision.
Parameters: - simToolName – SimTool name.
- simToolRevision – SimTool revision, typically rNN.
Returns: - A simToolLocation dictionary containing
notebookPath - the full path name of the simtool notebook, simToolName - the simtool shortname simToolRevision - the simtool revision (if installed or published) published - boolean which is True if the notebook is published
-
simtool.
findSimTools
(querySimToolName=None, returnString=True)¶ Find all the revisions of a SimTool.
Returns: Ordered lists of installed and published revisions
-
simtool.
getSimToolInputs
(simToolLocation)[source]¶ Get required SimTool inputs definition.
Parameters: simToolLocation – A dictionary containing information on SimTool notebook location and status. Returns: A simtool.Params object defining expected inputs.
-
simtool.
getSimToolOutputs
(simToolLocation)[source]¶ Get SimTool outputs definition.
Parameters: simToolLocation – A dictionary containing information on SimTool notebook location and status. Returns: A simtool.Params object defining expected outputs.
-
simtool.
getValidatedInputs
(inputs)[source]¶ Test inputs for validity.
Any invalid inputs are reported. This function is intended for use in the ‘parameters’ cell. The following code will set parameters to default values and cause an error if default values are in error.
Note
from simtool import getValidatedInputs
defaultInputs = getValidatedInputs(INPUTS) if defaultInputs: globals().update(defaultInputs)
Parameters: inputs – YAML representation of SimTool inputs. Returns: dictionary of Params.
-
class
simtool.
Run
[source]¶ Runs a SimTool.
A copy of the SimTool will be created in the subdirectory with the same name as the current experiment. It will be run with the provided inputs.
If cache is True and the tool is published, the global cache will be used. If the tool is not published, and cache is True, a local user cache will be used.
Parameters: - simToolLocation – A dictionary containing information on SimTool notebook location and status.
- inputs – A SimTools Params object or a dictionary of key-value pairs.
- runName – An optional name for the run. A unique name will be generated if no name is supplied.
- remoteAttributes – A list of parameters used for submission to offsite resource. In the absense of remoteAttributes the notebook execution will occur locally.
- cache – If the SimTool was run with the same inputs previously, return the results from the cache. Otherwise cache the results. If this parameter is False, do neither of these. The SimTool must be published to access the global cache, otherwise each user has a local cache that can be accesed.
- venue – [None, noSubmit, local, trustedLocal, remote, trustedRemote] venue selection mode. noSubmit - to ignore presense of submit. local - to use ‘submit –local’. trustedLocal - to use ‘submit –local’ as the trusted user for global cache interaction. remote - to use ‘submit’ to execute job on remote resource. trustedRemote - to use ‘submit’ to execute job on remote resource as the trusted user for global cache interaction. None - venue is determined based on the availability of submit and the other arguments.
Returns: A Run object.
-
class
simtool.
Experiment
(name, append=True)[source]¶ Content manager for Experiments
Create a subdirectory named {name} in which to place new runs. If append is False, any existing subdirectory with the same name is removed.
You can also use set_experiment() to set the current experiment.
- with Experiment(‘my_test’, append=False):
- Run(nb, inputs1) Run(nb, inputs2)
-
name
¶ The experiment name. When this context is entered it will create a subdirectory named {name}.
-
append
¶ If True, adds runs to any existing experiment of the same name. If False, removes previous runs.
-
simtool.
set_experiment
(name, append=True)[source]¶ Create a new experiment.
Create a subdirectory named {name} in which to place new runs. If append is False, any existing subdirectory with the same name is removed. The default experiment name is ‘RUNS’.
You can also use the Experiment content manager to set the current experiment.
Parameters: - name – The name of the experiment (and the subdirectory).
- append – If True, adds runs to any existing experiment of the same name. If False, removes previous runs.