iblrig.transfer_experiments.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()[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:
- 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:
- initialize_experiment(acquisition_description=None, overwrite=True)[source]
Copy acquisition description yaml to the server and local transfers folder.
- 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:
- 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