cellpy.utils.batch_tools.batch_journals
#
Module Contents#
Classes#
A journal keeps track of the details of the experiment. |
Attributes#
- class LabJournal(db_reader='default', engine=None, batch_col=None, **kwargs)[source]#
Bases:
cellpy.utils.batch_tools.batch_core.BaseJournal
,abc.ABC
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).
Journal for selected batch.
The journal contains pages (pandas.DataFrame) with prms for each cell (one cell pr row).
- Parameters:
db_reader – either default (a simple excel reader already implemented in cellpy) or other db readers that implement the needed API.
engine –
defaults to simple_db_engine for parsing db using the db_reader
- self.pages = simple_db_engine(
self.db_reader, id_keys, **kwargs
)
batch_col – the column name for the batch column in the db (used by simple_db_engine).
**kwargs – passed to the db_reader
- duplicate_journal(folder=None) None [source]#
Copy the journal to folder.
- Parameters:
folder (str or pathlib.Path) – folder to copy to (defaults to the
folder). (current)
- from_db(project=None, name=None, batch_col=None, dbreader_kwargs=None, **kwargs)[source]#
populate journal from db.
- Parameters:
project (str) – project name.
name (str) – experiment name.
batch_col (int) – batch column.
dbreader_kwargs – sent to simple db_reader.
**kwargs: sent to engine.
- simple_db-engine -> filefinder.search_for_files:
run_name(str): run-file identification. raw_extension(str): optional, extension of run-files (without the ‘.’). cellpy_file_extension(str): optional, extension for cellpy files
(without the ‘.’).
- raw_file_dir(path): optional, directory where to look for run-files
(default: read prm-file)
- cellpy_file_dir(path): optional, directory where to look for
cellpy-files (default: read prm-file)
prm_filename(path): optional parameter file can be given. file_name_format(str): format of raw-file names or a glob pattern
(default: YYYYMMDD_[name]EEE_CC_TT_RR) [not finished yet].
reg_exp(str): use regular expression instead (defaults to None) [not finished yet]. sub_folders (bool): perform search also in sub-folders. file_list (list of str): perform the search within a given list
of filenames instead of searching the folder(s). The list should not contain the full filepath (only the actual file names). If you want to provide the full path, you will have to modify the file_name_format or reg_exp accordingly.
- pre_path (path or str): path to prepend the list of files selected
from the file_list.
- Returns:
None
- from_file(file_name=None, paginate=True, **kwargs)[source]#
Loads a DataFrame with all the needed info about the experiment
- from_file_old(file_name=None)[source]#
Loads a DataFrame with all the needed info about the experiment
- to_file(file_name=None, paginate=True, to_project_folder=True, duplicate_to_local_folder=True)[source]#
Saves a DataFrame with all the needed info about the experiment.
- Parameters:
file_name (str or pathlib.Path) – journal file name (.json or .xlsx)
paginate (bool) – make project folders
to_project_folder (bool) – save journal file to the folder containing your cellpy projects
duplicate_to_local_folder (bool) – save journal file to the folder you are in now also
- Returns:
None