carputils
Doxygen code documentation for the python framework controlling openCARP
Functions
carputils.bundle.bundleio Namespace Reference

Functions

def load_pscript (exp_file)
 Reads and returns the content of a script. More...
 
def write_pscript (pscript, pscript_name, bundle_dir)
 Copy the protocol script to the experiment bundle folder. More...
 
def write_metadata_file (metadata_s, bundle_dir)
 Copy the metadata file into the bundle. More...
 
def copy_folder_in_bundle (folder_name, exp_dir, bundle_dir)
 Copy a folder from the experiment folder to the bundle folder. More...
 
def copy_mesh_dir_in_bundle (exp_name, bundle_dir)
 Copy the folder MESH_DIR/exp_name/ (configured in settings.yaml) in the bundle folder if it exists. More...
 
def create_zip (dir_path)
 Creates a zip archive of the given directory, at the same location. More...
 

Function Documentation

◆ copy_folder_in_bundle()

def carputils.bundle.bundleio.copy_folder_in_bundle (   folder_name,
  exp_dir,
  bundle_dir 
)

Copy a folder from the experiment folder to the bundle folder.

Parameters
folder_namestr name of the folder to copy (path must be relative to exp_dir)
exp_dirstr absolute path to experiment directory
bundle_dirstr absolute path to bundle directory

◆ copy_mesh_dir_in_bundle()

def carputils.bundle.bundleio.copy_mesh_dir_in_bundle (   exp_name,
  bundle_dir 
)

Copy the folder MESH_DIR/exp_name/ (configured in settings.yaml) in the bundle folder if it exists.

Can erase mesh data already put in the bundle.

Parameters
exp_namestr name of the experiment
bundle_dirstr directory of the bundle folder

◆ create_zip()

def carputils.bundle.bundleio.create_zip (   dir_path)

Creates a zip archive of the given directory, at the same location.

Parameters
dir_pathstr path to the directory to archive

◆ load_pscript()

def carputils.bundle.bundleio.load_pscript (   exp_file)

Reads and returns the content of a script.

Parameters
exp_filestr path to the input file
Returns
string containing the content of the input file

◆ write_metadata_file()

def carputils.bundle.bundleio.write_metadata_file (   metadata_s,
  bundle_dir 
)

Copy the metadata file into the bundle.

Parameters
metadata_sstr string containing the content of the yml metadata file
bundle_dirstr path to the bundle folder

◆ write_pscript()

def carputils.bundle.bundleio.write_pscript (   pscript,
  pscript_name,
  bundle_dir 
)

Copy the protocol script to the experiment bundle folder.

Parameters
pscriptstr string to write in the file
pscript_namestr name of the file to write
bundle_dirstr path to the bundle folder