cellpy.utils.batch_tools.batch_experiments
#
Module Contents#
Classes#
Load experimental data into memory. |
|
Attributes#
- class CyclingExperiment(*args, **kwargs)[source]#
Bases:
cellpy.utils.batch_tools.batch_core.BaseExperiment
Load experimental data into memory.
This is a re-implementation of the old batch behaviour where all the data-files are processed sequentially (and optionally exported) while the summary tables are kept and processed. This implementation also saves the step tables (for later use when using look-up functionality).
- journal (
obj: LabJournal): information about the experiment.
- force_cellpy#
tries only to load the cellpy-file if True.
- Type:
bool
- force_raw#
loads raw-file(s) even though appropriate cellpy-file exists if True.
- Type:
bool
- save_cellpy#
saves a cellpy-file for each cell if True.
- Type:
bool
- accept_errors#
in case of error, dont raise an exception, but continue to the next file if True.
- Type:
bool
- all_in_memory#
store the cellpydata-objects in memory if True.
- Type:
bool
- export_cycles#
export voltage-capacity curves if True.
- Type:
bool
- shifted_cycles#
set this to True if you want to export the voltage-capacity curves using the shifted-cycles option (only valid if you set export_cycles to True).
- Type:
bool
- export_raw#
export the raw-data if True.
- Type:
bool
- export_ica#
export dq-dv curves if True.
- Type:
bool
- last_cycle#
sets the last cycle (i.e. the highest cycle number) that you would like to process dq-dv on). Use all if None (the default value).
- Type:
int
- selected_summaries#
a list of summary labels defining what summary columns to make joint summaries from (optional).
- Type:
list
- errors#
contains a dictionary listing all the errors encountered.
- Type:
dict
- Parameters:
db_reader (str or object) – custom db_reader (see doc on db_reader).
Example:
- export_cellpy_files(path=None, **kwargs)[source]#
Export all cellpy-files to a given path.
- Remarks:
This method can only export to local folders (OtherPath objects are not formally supported, but might still work if the path is local).
- Parameters:
path (str, pathlib.Path) – path to export to (default: current working directory)
- link(**kwargs)[source]#
Ensure that an appropriate link to the cellpy-files exists for each cell.
The experiment will then contain a CellpyCell object for each cell (in the cell_data_frames attribute) with only the step-table stored.
Remark that running update persists the summary frames instead (or everything in case you specify all_in_memory=True). This might be considered “a strange and unexpected behaviour”. Sorry for that (but the authors of this package is also a bit strange…).
(OK, I will change it. Soon.)
- **kwargs: passed to _link_cellpy_file
- max_cycle (int): maximum cycle number to link/load (remark that the
cellpy objects will get the property overwrite_able set to False if you give a max_cycle to prevent accidentally saving a “truncated” file (use c.save(filename, overwrite=True) to force overwrite))
- parallel_update(all_in_memory=None, cell_specs=None, logging_mode=None, **kwargs)[source]#
Updates the selected datasets in parallel.
- Parameters:
all_in_memory (bool) – store the cellpydata in memory (default False)
cell_specs (dict of dicts) – individual arguments pr. cell. The cellspecs key-word argument dictionary will override the **kwargs and the parameters from the journal pages for the indicated cell.
logging_mode (str) – sets the logging mode for the loader(s).
kwargs –
transferred all the way to the instrument loader, if not picked up earlier. Remark that you can obtain the same pr. cell by providing a cellspecs dictionary. The kwargs have precedence over the parameters given in the journal pages, but will be overridden by parameters given by cellspecs.
- Merging:
- recalc (Bool): set to False if you don’t want automatic “recalc” of
cycle numbers etc. when merging several data-sets.
- Loading:
selector (dict): selector-based parameters sent to the cellpy-file loader (hdf5) if loading from raw is not necessary (or turned off).
- Debugging:
debug (Bool): set to True if you want to run in debug mode (should never be used by non-developers).
- Debug-mode:
runs only for the first item in your journal
Examples
>>> # Don't perform recalculation of cycle numbers etc. when merging >>> # All cells: >>> b.update(recalc=False) >>> # For specific cell(s): >>> cell_specs_cell_01 = {"name_of_cell_01": {"recalc": False}} >>> b.update(cell_specs=cell_specs_cell_01)
- recalc(save=True, step_opts=None, summary_opts=None, indexes=None, calc_steps=True, testing=False)[source]#
Run make_step_table and make_summary on all cells.
- Parameters:
save (bool) – Save updated cellpy-files if True.
step_opts (dict) – parameters to inject to make_steps.
summary_opts (dict) – parameters to inject to make_summary.
indexes (list) – Only recalculate for given indexes (i.e. list of cell-names).
calc_steps (bool) – Run make_steps before making the summary.
testing (bool) – Only for testing purposes.
- Returns:
None
- save_cells(**kwargs)[source]#
Save all cells in the experiment.
- Parameters:
kwargs – passed to the save method of the CellpyData-object.
- Returns:
None
- update(all_in_memory=None, cell_specs=None, logging_mode=None, accept_errors=None, **kwargs)[source]#
Updates the selected datasets.
- Parameters:
all_in_memory (bool) – store the cellpydata in memory (default False)
cell_specs (dict of dicts) – individual arguments pr. cell. The cellspecs key-word argument dictionary will override the **kwargs and the parameters from the journal pages for the indicated cell.
logging_mode (str) – sets the logging mode for the loader(s).
accept_errors (bool) – if True, the loader will continue even if it encounters errors.
kwargs –
transferred all the way to the instrument loader, if not picked up earlier. Remark that you can obtain the same pr. cell by providing a cellspecs dictionary. The kwargs have precedence over the parameters given in the journal pages, but will be overridden by parameters given by cellspecs.
- Merging:
- recalc (Bool): set to False if you don’t want automatic “recalc” of
cycle numbers etc. when merging several data-sets.
- Loading:
selector (dict): selector-based parameters sent to the cellpy-file loader (hdf5) if loading from raw is not necessary (or turned off).
- Debugging:
debug (Bool): set to True if you want to run in debug mode (should never be used by non-developers).
- Debug-mode:
runs only for the first item in your journal
Examples
>>> # Don't perform recalculation of cycle numbers etc. when merging >>> # All cells: >>> b.update(recalc=False) >>> # For specific cell(s): >>> cell_specs_cell_01 = {"name_of_cell_01": {"recalc": False}} >>> b.update(cell_specs=cell_specs_cell_01)