iblrig.transfer_experiments.SessionCopier

Inheritance diagram of SessionCopier

class iblrig.transfer_experiments.SessionCopier[source]

Initialize and copy session data to a remote server.

__init__(session_path, remote_subjects_folder=None, tag=None)[source]

Initialize and copy session data to a remote server.

Parameters:
  • session_path (str, pathlib.Path) – The partial or session path to copy.

  • remote_subjects_folder (str, pathlib.Path) – The remote server path to which to copy the session data.

  • tag (str) – The device name (adds this to the experiment description stub file on the remote server).

copy_collections(*args, **kwargs)[source]

Recursively copies the collection folders into the remote session path.

Do not overload, overload _copy_collections instead.

copy_snapshots()[source]

Copy snapshots files from root session path.

Unlike the collection folders defined in the experiment description folder, the snapshots folder is optional and may exist on multiple acquisition PCs. This method will copy any files over if the snapshots folder exists, however it will fail if a file of the same name already exists. This ensures snapshots from multiple computers don’t get overwritten.

Returns:

True if transfer successfully completed.

Return type:

bool

finalize_copy(number_of_expected_devices=None)[source]

At the end of the copy, check if all the files are there and if so, aggregate the device files.

get_state()[source]

Gets the current copier state.

State 0: this device experiment has not been initialized for this device State 1: this device experiment is initialized (the experiment description stub is present on the remote) State 2: this device experiment is copied on the remote server, but other devices copies are still pending State 3: the whole experiment is finalized and all data is on the server :return:

Return type:

tuple[CopyState | None, str]

glob_file_remote_copy_status(status='*')[source]

status: pending / complete

initialize_experiment(acquisition_description=None, overwrite=True)[source]

Copy acquisition description yaml to the server and local transfers folder.

Parameters:
  • acquisition_description (dict) – The data to write to the experiment.description.yaml file.

  • overwrite (bool) – If true, overwrite any existing file with the new one, otherwise, update the existing file.

run(number_of_expected_devices=None)[source]

Run the copy of this device experiment.

Will try to get as far as possible in the copy process (from states 0 init experiment to state 3 finalize experiment) if possible, and return earlier if the process can’t be completed.

assert_connect_on_init = True

Raise error if unable to write stub file to remote server.

Type:

bool

property experiment_description
property file_experiment_description

Returns the local experiment description file, if none found, returns one with the tag.

property file_remote_experiment_description

Return the remote path to the remote stub file.

property remote_experiment_description_stub
property remote_session_path
property state
tag = 'fv-az1114-731_155186403758979'

The device name (adds this to the experiment description stub file on the remote server).

Type:

str