cellpy.utils.batch_tools.batch_core#

Module Contents#

Classes#

BaseAnalyzer

Base class for all the classes that do something to the experiment(s).

BaseExperiment

An experiment contains experimental data and meta-data.

BaseExporter

An exporter exports your data to a given format.

BaseJournal

A journal keeps track of the details of the experiment.

BasePlotter

Base class for all the classes that do something to the experiment(s).

BaseReporter

Base class for all the classes that do something to the experiment(s).

Data

Class that is used to access the experiment.journal.pages DataFrame.

Doer

Base class for all the classes that do something to the experiment(s).

Attributes#

empty_farm

hdr_journal

class BaseAnalyzer(*args)[source]#

Bases: Doer

Inheritance diagram of cellpy.utils.batch_tools.batch_core.BaseAnalyzer

Base class for all the classes that do something to the experiment(s).

experiments#

list of experiments.

farms#

list of farms (one pr experiment) (containing pandas DataFrames).

barn#

identifier for where to place the output-files (i.e. the animals) (typically a directory path).

Type:

str

The do-er iterates through all the connected engines and dumpers (the dumpers are run for each engine).

It is the responsibility of the engines and dumpers to iterate through the experiments. The most natural way is to work with just one experiment.

Setting up the Do-er.

Parameters:

*args – list of experiments

run_dumper(dumper)[source]#

Place the animals in the barn

run_engine(engine, **kwargs)[source]#

Run the engine, build the barn and put the animals on the farm

class BaseExperiment(*args)[source]#

An experiment contains experimental data and meta-data.

property data: Data[source]#

Property for accessing the underlying data in an experiment.

Example

>>> cell_data_one = experiment.data["2018_cell_001"]
>>> capacity, voltage = cell_data_one.get_cap(cycle=1)
property max_cycle[source]#
info()[source]#

Print information about the experiment.

abstract status()[source]#

Describe the status and health of your experiment.

abstract update()[source]#

Get or link data.

class BaseExporter(*args)[source]#

Bases: Doer

Inheritance diagram of cellpy.utils.batch_tools.batch_core.BaseExporter

An exporter exports your data to a given format.

Setting up the Do-er.

Parameters:

*args – list of experiments

run_dumper(dumper)[source]#
run_engine(engine, **kwargs)[source]#

Set the current_engine and run it.

The method sets and engages the engine (callable) and provide appropriate binding to at least the class attributes self.farms and self.barn.

Example

self.current_engine = engine self.farms, self.barn = engine(experiments=self.experiments, farms=self.farms, **kwargs)

Parameters:
  • engine (callable) – the function that should be called.

  • **kwargs – additional keyword arguments sent to the callable.

class BaseJournal[source]#

A journal keeps track of the details of the experiment.

The journal should at a mimnimum contain information about the name and project the experiment has.

pages#

table with information about each cell/file.

Type:

pandas.DataFrame

name#

the name of the experiment (used in db-lookup).

Type:

str

project#

the name of the project the experiment belongs to (used for making folder names).

Type:

str

file_name#

the file name used in the to_file method.

Type:

str or path

project_dir#

folder where to put the batch (or experiment) files and information.

batch_dir#

folder in project_dir where summary-files and information and results related to the current experiment are stored.

raw_dir#

folder in batch_dir where cell-specific information and results are stored (e.g. raw-data, dq/dv data, voltage-capacity cycles).

packable = ['name', 'project', 'time_stamp', 'project_dir', 'batch_dir', 'raw_dir'][source]#
abstract create()[source]#

Create a journal manually

from_db()[source]#

Make journal pages by looking up a database.

Default to using the simple excel “database” provided by cellpy.

If you don’t have a database, or you don’t know how to make and use one, look in the cellpy documentation for other solutions (e.g. manually create a file that can be loaded by the from_file method).

abstract from_file(file_name)[source]#
generate_file_name()[source]#

Create a file name for saving the journal.

abstract paginate()[source]#

Create folders used for saving the different output files.

abstract to_file(file_name=None)[source]#

Save journal pages to a file.

The file can then be used in later sessions using the from_file method.

class BasePlotter(*args)[source]#

Bases: Doer

Inheritance diagram of cellpy.utils.batch_tools.batch_core.BasePlotter

Base class for all the classes that do something to the experiment(s).

experiments#

list of experiments.

farms#

list of farms (one pr experiment) (containing pandas DataFrames).

barn#

identifier for where to place the output-files (i.e. the animals) (typically a directory path).

Type:

str

The do-er iterates through all the connected engines and dumpers (the dumpers are run for each engine).

It is the responsibility of the engines and dumpers to iterate through the experiments. The most natural way is to work with just one experiment.

Setting up the Do-er.

Parameters:

*args – list of experiments

abstract run_dumper(dumper)[source]#
abstract run_engine(engine, **kwargs)[source]#

Set the current_engine and run it.

The method sets and engages the engine (callable) and provide appropriate binding to at least the class attributes self.farms and self.barn.

Example

self.current_engine = engine self.farms, self.barn = engine(experiments=self.experiments, farms=self.farms, **kwargs)

Parameters:
  • engine (callable) – the function that should be called.

  • **kwargs – additional keyword arguments sent to the callable.

class BaseReporter(*args)[source]#

Bases: Doer

Inheritance diagram of cellpy.utils.batch_tools.batch_core.BaseReporter

Base class for all the classes that do something to the experiment(s).

experiments#

list of experiments.

farms#

list of farms (one pr experiment) (containing pandas DataFrames).

barn#

identifier for where to place the output-files (i.e. the animals) (typically a directory path).

Type:

str

The do-er iterates through all the connected engines and dumpers (the dumpers are run for each engine).

It is the responsibility of the engines and dumpers to iterate through the experiments. The most natural way is to work with just one experiment.

Setting up the Do-er.

Parameters:

*args – list of experiments

abstract run_dumper(dumper)[source]#
abstract run_engine(engine)[source]#

Set the current_engine and run it.

The method sets and engages the engine (callable) and provide appropriate binding to at least the class attributes self.farms and self.barn.

Example

self.current_engine = engine self.farms, self.barn = engine(experiments=self.experiments, farms=self.farms, **kwargs)

Parameters:
  • engine (callable) – the function that should be called.

  • **kwargs – additional keyword arguments sent to the callable.

class Data(experiment, *args)[source]#

Bases: collections.UserDict

Inheritance diagram of cellpy.utils.batch_tools.batch_core.Data

Class that is used to access the experiment.journal.pages DataFrame.

The Data class loads the complete cellpy-file if raw-data is not already loaded in memory. In future version, it could be that the Data object will return a link allowing querying instead to save memory usage…

Remark that some cellpy (cellreader.CellpyCell) function might not work if you have the raw-data in memory, but not summary data (if the cellpy function requires summary data or other settings not set as default).

first()[source]#

Pick out first cell from the batch

last()[source]#

Pick out last cell from the batch

sample()[source]#

Pick out one random cell from the batch

class Doer(*args)[source]#

Base class for all the classes that do something to the experiment(s).

experiments#

list of experiments.

farms#

list of farms (one pr experiment) (containing pandas DataFrames).

barn#

identifier for where to place the output-files (i.e. the animals) (typically a directory path).

Type:

str

The do-er iterates through all the connected engines and dumpers (the dumpers are run for each engine).

It is the responsibility of the engines and dumpers to iterate through the experiments. The most natural way is to work with just one experiment.

Setting up the Do-er.

Parameters:

*args – list of experiments

assign(experiment)[source]#

Assign an experiment.

do(**kwargs)[source]#

Do what is needed and dump it for each engine.

empty_the_farms()[source]#

Free all the farms for content (empty all lists).

info()[source]#

Delivers some info to you about the class.

abstract run_dumper(dumper)[source]#
abstract run_engine(engine, **kwargs)[source]#

Set the current_engine and run it.

The method sets and engages the engine (callable) and provide appropriate binding to at least the class attributes self.farms and self.barn.

Example

self.current_engine = engine self.farms, self.barn = engine(experiments=self.experiments, farms=self.farms, **kwargs)

Parameters:
  • engine (callable) – the function that should be called.

  • **kwargs – additional keyword arguments sent to the callable.

empty_farm = [][source]#
hdr_journal[source]#