cellpy package

Subpackages

Submodules

cellpy.cli module

cellpy.cli.check_if_needed_modules_exists()[source]
cellpy.cli.check_it(var=None)[source]
cellpy.cli.create_cellpy_folders()[source]
cellpy.cli.function_new(template, directory, local_user_template, serve_, run_, lab, list_)[source]

Set up a batch experiment.

cellpy.cli.get_default_config_file_path(init_filename=None)[source]

gets the path to the default config-file

cellpy.cli.get_dst_file(user_dir, init_filename)[source]
cellpy.cli.get_package_prm_dir()[source]

gets the folder where the cellpy package lives

cellpy.cli.modify_config_file()[source]
cellpy.cli.save_prm_file(prm_filename)[source]

saves (writes) the prms to file

cellpy.exceptions module

Exceptions defined within cellpy

exception cellpy.exceptions.ConfigFileNotRead[source]

Bases: Error

Raised when the configuration file cannot be read

exception cellpy.exceptions.ConfigFileNotWritten[source]

Bases: Error

Raised when the configuration file cannot be written

exception cellpy.exceptions.DeprecatedFeature[source]

Bases: Error

Raised when the feature is recently deprecated

exception cellpy.exceptions.Error[source]

Bases: Exception

Base class for other exceptions

exception cellpy.exceptions.ExportFailed[source]

Bases: Error

Raised when exporting data failed

exception cellpy.exceptions.FileNotFound[source]

Bases: Error

Raised when the given file is not found

exception cellpy.exceptions.IOError[source]

Bases: Error

Raised when exporting data failed

exception cellpy.exceptions.NoCellFound[source]

Bases: Error

Raised when there are no cells, but a cell is needed.

exception cellpy.exceptions.NullData[source]

Bases: Error

Raised when required data is missing (e.g. voltage = None or summary_frames are missing)

exception cellpy.exceptions.UnderDefined[source]

Bases: Error

Raised when trying something that requires you to set a missing prm first

exception cellpy.exceptions.WrongFileVersion[source]

Bases: Error

Raised when the file version is wrong

cellpy.log module

Set up logger instance

cellpy.log.setup_logging(default_json_path=None, default_level=None, env_key='LOG_CFG', custom_log_dir=None, reset_big_log=False, max_size=5000000, testing=False)[source]

Setup logging configuration.

Parameters
  • default_level – default log-level to screen (std.out).

  • default_json_path – path to config file for setting up logging.

  • env_key (str) – use this environment prm to try to get default_json_path.

  • custom_log_dir – path for saving logs.

  • reset_big_log (bool) – reset log if too big (max_size).

  • max_size (int) – if reset_log, this is the max limit.

  • testing (bool) – set as True if testing, and you don’t want to create any .log files

Module contents

cellpy.get(filename=None, mass=None, instrument=None, instrument_file=None, nominal_capacity=None, logging_mode=None, cycle_mode=None, auto_summary=True, testing=False, **kwargs)[source]

Create a CellpyData object

Parameters
  • filename (str, os.PathLike, or list of raw-file names) – path to file(s)

  • mass (float) – mass of active material (mg) (defaults to mass given in cellpy-file or 1.0)

  • instrument (str) – instrument to use (defaults to the one in your cellpy config file)

  • instrument_file (str or path) – yaml file for custom file type

  • nominal_capacity (float) – nominal capacity for the cell (e.g. used for finding C-rates)

  • logging_mode (str) – “INFO” or “DEBUG”

  • cycle_mode (str) – the cycle mode (e.g. “anode” or “full_cell”)

  • auto_summary (bool) – (re-) create summary.

  • testing (bool) – set to True if testing (will for example prevent making .log files)

  • **kwargs – sent to the loader

Returns

CellpyData object (if successful, None if not)