runs
Setup
Create a run
Example to create a new run.
from pyhectiqlab import Run
run = Run(name="Hello world", project="lab/demo")
If a run exists with the slugified version of the name Hello world
-> hello-world
, the existing run will be attached. You can leave the name empty to generate a temporary name.
You can check the state of your run with
print(run)
Output:
<Run 1 hello-world>
Name : Hello world
Project : demo (lab/demo)
author : John Smith
mode : read-write
url : https://lab.hectiq.ai/lab/demo/runs/hello-world
The mode (run.action_mode
) can be either dry
or read-write
. The dry
mode occurs when the initial connection with the global state did not succeeded or if the argument read_only=True
was provided. A dry
mode means that the run is disconnected with the global state and push method will fail to update the run state.
Read only mode
The read only mode disconnects the run from the global state server-side. Any method that usually sends state to the server will be on pause. For example,
run = Run(name="Hello world", project="lab/demo", read_only=True)
run.add_package_versions(globals())
Output:
Run is read only. Cannot execute `add_package_versions`.
Methods
pyhectiqlab.Run
classRun(name: str, project: str, path: str = None, read_only: bool = False)
Initialize a run.
Parameters
Property | Type | Default | Description |
---|---|---|---|
name | str | - | Run name in a readable format. Leave empty if using path . If a run with the same slugified name exists, the existing run will be fetched and a warning will be raised. |
project | str | - | The project name. The usual format is {owner}/{project-name} . |
path | str | None | The slugified name of an existing run. Use this to attach to existing run. |
read_only | bool | False | If True , the methods will have no effect on the shared state of the run. Use this when you want to execute the code without affecting the state in the cloud. Default is False . |
Run.rename(name: str)
Change the run name.
Parameters
Property | Type | Default | Description |
---|---|---|---|
name | str | - | The new name. |