Experiments

Experiments are a type of resource intended to be the “anchor” resource that groups other resources into logical units that can be repeated, versioned, etc.

When you create an Experiment instance, it is immediately added to the given DMF instance. For example, the following code] adds a new experiment to the DMF workspace at “workspace/path”:

from idaes.dmf import DMF, experiment
mydmf = DMF(path='workspace/path')
exp = experiment.Experiment(mydmf, name='try1', desc='Nice try')

You can create new versions of an experiment with the Experiment.copy() method:

from idaes.dmf import DMF, experiment
from idaes.dmf.resource import R_VERSION
mydmf = DMF(path='workspace/path')
exp1 = experiment.Experiment(mydmf, name='try', version='0.0.1')
exp2 = exp1.copy(version='0.0.2')
# add a relation indicating that exp2 is a revision of exp1
exp1.link(exp2, R_VERSION)
class idaes.dmf.experiment.Experiment(dmf, **kwargs)[source]

An experiment is a way of grouping resources in a way that makes sense to the user.

It is also a useful unit for passing as an argument to functions, since it has a standard ‘slot’ for the DMF instance that created it.

add(rsrc)[source]

Add a resource to an experiment.

This does two things:

  1. Establishes an “experiment” type of relationship between the new resource and the experiment.
  2. Adds the resource to the DMF
Parameters:rsrc (resource.Resource) – The resource to add.
Returns:Added (input) resource, for chaining calls.
Return type:resource.Resource
copy(**kwargs)[source]

Get a copy of this experiment. The returned object will have been added to the DMF.

Parameters:kwargs – Values to set in new instance after copying.
Returns:A (mostly deep) copy.

Note that the DMF instance is just a reference to the same object as in the original, and they will share state.

Return type:Experiment
update()[source]

Update experiment to current values.

remove()[source]

Remove this experiment from the associated DMF instance.

link(subj, predicate='contains', obj=None)[source]

Add and update relation triple in DMF.

Parameters:
Returns:

None