cellpy.parameters.internal_settings
#
Internal settings and definitions and functions for getting them.
Module Contents#
Classes#
Subclass of BaseSetting including option to add postfixes. |
|
Base class for internal cellpy settings. |
|
These are the limits used inside |
|
Base class for meta-data in cellpy. |
|
Common (not test-dependent) meta-data for cellpy. |
|
Test-dependent meta-data for cellpy. |
|
These are the units used inside Cellpy. |
|
Add some dunder-methods so that it does not break old code that used |
|
A Sub-class of dict to allow for tab-completion. |
|
Headers used for the journal (batch) (used as column headers for the journal pandas DataFrames) |
|
Headers used for the normal (raw) data (used as column headers for the main data pandas DataFrames) |
|
Headers used for the steps table (used as column headers for the steps pandas DataFrames) |
|
Headers used for the summary data (used as column headers for the main data pandas DataFrames) |
|
Base class for instrument settings. |
Functions#
|
Returns an augmented global dictionary with units |
|
Returns a dictionary with units to use as default for old versions of cellpy files |
|
Returns an augmented dictionary that can be used to create custom header-strings for the summary |
|
Returns an augmented dictionary with units to use as default. |
|
Returns an augmented dictionary with units as default for raw data |
|
Returns a dictionary with units as default for raw data |
|
Returns an augmented global dictionary containing the header-strings for the journal (batch) |
|
Returns an augmented global dictionary containing the header-strings for the normal data |
|
Returns an augmented global dictionary containing the header-strings for the steps table |
|
Returns an augmented global dictionary containing the header-strings for the summary |
Attributes#
- class BaseHeaders[source]#
Bases:
BaseSettings
Subclass of BaseSetting including option to add postfixes.
Example
>>> header["key_postfix"] # returns "value_postfix"
- class BaseSettings[source]#
Bases:
DictLikeClass
Base class for internal cellpy settings.
Usage:
@dataclass class MyCoolCellpySetting(BaseSetting): var1: str = "first var" var2: int = 12
- class CellpyLimits[source]#
Bases:
BaseSettings
These are the limits used inside
cellpy
for finding step types.Since all instruments have an inherent inaccuracy, it is naive to assume that for example the voltage within a constant voltage step does not change at all. Therefore, we need to define some limits for what we consider to be a constant and what we assume to be zero.
- class CellpyMeta[source]#
Base class for meta-data in cellpy.
- class CellpyMetaCommon[source]#
Bases:
CellpyMeta
Common (not test-dependent) meta-data for cellpy.
- class CellpyMetaIndividualTest[source]#
Bases:
CellpyMeta
Test-dependent meta-data for cellpy.
- class CellpyUnits[source]#
Bases:
BaseSettings
These are the units used inside Cellpy.
At least two sets of units needs to be defined; cellpy_units and raw_units. The data.raw dataframe is given in raw_units where the units are defined inside the instrument loader used. Since the data.steps dataframe is a summary of the step statistics from the data.raw dataframe, this also uses the raw_units. The data.summary dataframe contains columns with values directly from the data.raw dataframe given in raw_units as well as calculated columns given in cellpy_units.
Remark that all input to cellpy through user interaction (or utils) should be in cellpy_units. This is also true for meta-data collected from the raw files. The instrument loader needs to take care of the translation from its raw units to cellpy_units during loading the raw data file for the meta-data (remark that this is not necessary and not recommended for the actual “raw” data that is going to be stored in the data.raw dataframe).
As of 2022.09.29, cellpy does not automatically ensure unit conversion for input of meta-data, but has an internal method (CellPyData.to_cellpy_units) that can be used.
These are the different attributes currently supported for data in the dataframes:
current: str = "A" charge: str = "mAh" voltage: str = "V" time: str = "sec" resistance: str = "Ohms" power: str = "W" energy: str = "Wh" frequency: str = "hz"
And here are the different attributes currently supported for meta-data:
# output-units for specific capacity etc. specific_gravimetric: str = "g" specific_areal: str = "cm**2" # used for calculating specific capacity etc. specific_volumetric: str = "cm**3" # used for calculating specific capacity etc. # other meta-data nominal_capacity: str = "mAh/g" # used for calculating rates etc. mass: str = "mg" length: str = "cm" area: str = "cm**2" volume: str = "cm**3" temperature: str = "C"
- class DictLikeClass[source]#
Add some dunder-methods so that it does not break old code that used dictionaries for storing settings
Remarks: it is not a complete dictionary experience - for example, setting new attributes (new keys) is not supported (raises
KeyError
if using the typical dict setting method) since it uses thedataclasses.fields
method to find its members.
- class HeaderDict(dict=None, /, **kwargs)[source]#
Bases:
collections.UserDict
A Sub-class of dict to allow for tab-completion.
- class HeadersJournal[source]#
Bases:
BaseHeaders
Headers used for the journal (batch) (used as column headers for the journal pandas DataFrames)
- class HeadersNormal[source]#
Bases:
BaseHeaders
Headers used for the normal (raw) data (used as column headers for the main data pandas DataFrames)
- class HeadersStepTable[source]#
Bases:
BaseHeaders
Headers used for the steps table (used as column headers for the steps pandas DataFrames)
- class HeadersSummary[source]#
Bases:
BaseHeaders
Headers used for the summary data (used as column headers for the main data pandas DataFrames)
In addition to the headers defined here, the summary might also contain specific headers (ending in _gravimetric or _areal).
- class InstrumentSettings[source]#
Bases:
DictLikeClass
Base class for instrument settings.
Usage:
@dataclass class MyCoolInstrumentSetting(InstrumentSettings): var1: str = "first var" var2: int = 12
Remark! Try to use it as you would use a normal dataclass.
- get_cellpy_units(*args, **kwargs) CellpyUnits [source]#
Returns an augmented global dictionary with units
- get_default_cellpy_file_raw_units(*args, **kwargs) CellpyUnits [source]#
Returns a dictionary with units to use as default for old versions of cellpy files
- get_default_custom_headers_summary() HeadersSummary [source]#
Returns an augmented dictionary that can be used to create custom header-strings for the summary (used as column headers for the summary pandas DataFrames)
This function is mainly implemented to provide an example.
- get_default_output_units(*args, **kwargs) CellpyUnits [source]#
Returns an augmented dictionary with units to use as default.
- get_default_raw_limits() CellpyLimits [source]#
Returns an augmented dictionary with units as default for raw data
- get_default_raw_units(*args, **kwargs) CellpyUnits [source]#
Returns a dictionary with units as default for raw data
- get_headers_journal() HeadersJournal [source]#
Returns an augmented global dictionary containing the header-strings for the journal (batch) (used as column headers for the journal pandas DataFrames)
- get_headers_normal() HeadersNormal [source]#
Returns an augmented global dictionary containing the header-strings for the normal data (used as column headers for the main data pandas DataFrames)
- get_headers_step_table() HeadersStepTable [source]#
Returns an augmented global dictionary containing the header-strings for the steps table (used as column headers for the steps pandas DataFrames)
- get_headers_summary() HeadersSummary [source]#
Returns an augmented global dictionary containing the header-strings for the summary (used as column headers for the summary pandas DataFrames)
- ATTRS_TO_IMPORT_FROM_EXCEL_SQLITE = ['name', 'label', 'project', 'cell_group', 'cellpy_file_name', 'instrument', 'cell_type',...[source]#