Module markov.api.recording.experiments.experiments_api
Functions
def create_experiment_conda_environment(experiment_id: str, path: str = None)
-
Create a conda environment with package dependencies for this experiment including the python version used. If the python_version information is not available with the experiment, the active python version on this machine is used.
To use the conda environment: $ cd
$ conda activate Args
experiment_id
:str
- The id of the experiment for which you need to create the virtualenv environment
path
:str
- The path of the conda environment to be created. Note: If the directories in the path
do not exist, they will be created. If path is none, an environment called
<experiment_id>_conda_end
is created in the current working directory.Returns
None Side effects: A conda environment at given path with the python version used to run this experiment
def create_experiment_requirements_file(experiment_id: str, requirement_file_path: str = 'requirements.txt')
-
Create a requirements.txt file out of the packages required for running the given experiment (by its id) The requirements.txt file will contain the exact versions of the packages used in running the experiment.
Args
experiment_id
- id of the experiment for which you want to get the packages requirements for
requirement_file_path
- The path of the file where you want to store the created requirements.txt file.
By default, we create a file named "requirements.txt" in the current working directory.
Returns
None Side effects: A file is created at the speicified location that contains the package requirements for the given experiment.
Examples
>>> import markov >>> markov.experiments.create_experiment_requirements_file(experiment_id="exp_id")
def create_experiment_virtualenv(experiment_id: str, path: str = None)
-
Create a virtualenv environment with the packages required to run this experiment, using the active python version.
To create a virtual environment with a separate python version, use
create_conda_environment
. You can read more about conda and pip here: https://www.anaconda.com/blog/understanding-conda-and-pipTo use the virtualenv environment: $ cd
$ source base_directory_path/environment_name/bin/activate Note: Virtualenv environment will be created using the python version you are using to run this program. virtualenv does not support installation of different python versions. To use different python versions, use conda environment.
Args
experiment_id
:str
- The id of the experiment for which you need to create the virtualenv environment
path
:str
- The path of the virtualenv to be created. Note: If the directories in the path do not exist,
they will be created. If path is none, an environment called
<experiment_id>_conda_end
is created in the current working directory.Returns
None Side effects: A virtualenv environment is created in the provided
with the name
Classes
class ExperimentPackagesWithPythonVersion (packages, python_version)
-
ExperimentPackagesWithPythonVersion(packages, python_version)
Ancestors
- builtins.tuple
Instance variables
var packages
-
Alias for field number 0
var python_version
-
Alias for field number 1