cellpy.utils.batch_tools.batch_helpers
#
Module Contents#
Functions#
|
This function creates a folder structure for the batch project. |
|
Returns a re-formatted label (currently it only removes the dates |
|
Creates a dictionary with summary column headers. |
|
Exports dQ/dV data from a CellpyCell instance. |
|
Find files using cellpy.filefinder. |
|
Takes care of strange group numbers. |
|
Creates sensible folder names. |
|
parse the summaries and combine based on column (selected_summaries) |
|
Extracts table from cellpy hdf5-file. |
|
This function cleans up the group numbers a bit. |
|
picks the selected pandas.DataFrame |
|
Convenience function for storing data column-wise in a csv-file. |
Attributes#
- create_folder_structure(project_name, batch_name)[source]#
This function creates a folder structure for the batch project.
The folder structure consists of main working folder
project_name` located in the ``outdatadir
(as defined in the cellpy configuration file) with a sub-folder namedbatch_name
. It also creates a folder inside thebatch_name
folder for storing the raw data. If the folders does not exist, they will be made. The function also returns the name of the info-df.- Parameters:
project_name – name of the project
batch_name – name of the batch
Returns: (info_file, (project_dir, batch_dir, raw_dir))
- create_labels(label, *args)[source]#
Returns a re-formatted label (currently it only removes the dates from the run-name)
- create_selected_summaries_dict(summaries_list)[source]#
Creates a dictionary with summary column headers.
Examples
>>> summaries_to_output = ["discharge_capacity_gravimetric", "charge_capacity_gravimetric"] >>> summaries_to_output_dict = create_selected_summaries_dict( >>> summaries_to_output >>> ) >>> print(summaries_to_output_dict) {'discharge_capacity_gravimetric': "discharge_capacity_gravimetric", 'charge_capacity_gravimetric': "discharge_capacity_gravimetric"}
- Parameters:
summaries_list – list containing cellpy summary column id names
- Returns: dictionary of the form {cellpy id name: cellpy summary
header name,}
- export_dqdv(cell_data, savedir, sep, last_cycle=None)[source]#
Exports dQ/dV data from a CellpyCell instance.
- Parameters:
cell_data – CellpyCell instance
savedir – path to the folder where the files should be saved
sep – separator for the .csv-files.
last_cycle – only export up to this cycle (if not None)
- find_files(info_dict, file_list=None, pre_path=None, sub_folders=None, **kwargs)[source]#
Find files using cellpy.filefinder.
- Parameters:
info_dict – journal pages.
file_list – list of files names to search through.
pre_path – path to prepend found files from file_list (if file_list is given).
sub_folders (bool) – perform search also in sub-folders.
- **kwargs (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).
reg_exp(str): use regular expression instead (defaults to None). 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:
info_dict
- join_summaries(summary_frames, selected_summaries, keep_old_header=False)[source]#
parse the summaries and combine based on column (selected_summaries)
- look_up_and_get(cellpy_file_name, table_name, root=None, max_cycle=None)[source]#
Extracts table from cellpy hdf5-file.