Releases: echemdb/unitpackage
Releases · echemdb/unitpackage
0.12.0
Added:
- Added
Entry.apply_scaling_factorwhich multiplies a column by a given value and tracks the cumulative scaling factor in the field metadata. - Added
EchemdbEntry.scan_rateproperty returning the scan rate as an astropy quantity fromfigureDescription.scanRate. - Added
EchemdbEntry.rescale_scan_ratewhich rescales the current (density) axis by the ratio of a new scan rate to the original one, which is essentially like applying a scaling factor. - Added
entry.fieldsas a property to access the list of fields in the entry's schema (entry.resource.schema.fields). - Added
entry.rename_field(field_name, new_name, keep_original_name_as=None)for renaming a single field. - Added
entry.remove_column(field_name)for removing a single column. - Added
_modify_field_name()helper method for modifying a single field's name. - Added
deviceparameter toEntry.from_csv()to select instrument-specific loaders (e.g.,device='eclab'for BioLogic MPT files,device='gamry'for Gamry DTA files). - Added
BaseLoader.metadataproperty, which returns file structure information (loader name, delimiter, decimal, header, column headers) stored asdsvDescriptionin the entry's metadata. - Added
EchemdbEntry.from_mpt()classmethod to load BioLogic EC-Lab MPT files with automatic field updates, renaming, and filtering. - Added
eclab_fields.pymodule (renamed fromcolumn_names.py) containingbiologic_fieldsandbiologic_fields_alt_namesfor standardized electrochemistry field definitions. - Added
Entry.remove_columns(), which removes both a column from the dataframe and the fields. - Added
Entry.load_metadata()for loading metadata from YAML or JSON files with method chaining support. - Added
MetadataDescriptorclass for enhanced metadata handling with dict and attribute-style access. - Added
Entry.default_metadata_keyclass attribute to control metadata access patterns in subclasses. - Added
Entry._default_metadataproperty to access the appropriate metadata subset. - Added
encoding,header_lines,column_header_lines,decimal,delimiters, anddeviceparameters toEntry.from_csv()for handling complex CSV formats and instrument-specific file types. - Added
create_tabular_resource_from_csv()to create resources from CSV files with auto-detection of standard vs. complex formats. - Added
create_df_resource_from_csv()for creating pandas dataframe resources from CSV files with custom formats. - Added
create_df_resource_from_df()for creating resources directly from pandas DataFrames. - Added
create_df_resource_from_tabular_resource()for converting tabular resources to pandas dataframe resources. - Added
update_fields()function to update schema fields with additional information. - Added
Entry.create_example(name=None)which returns a single example entry. Defaults to'alves_2011_electrochemistry_6010_f1a_solid'when no name is provided. - Added
_create_new_df_resource(), which returns a new pandas resource when the schema of the resource changed. - Added
_df_resourceas a cached property, which transforms a tabular_resource into a pandas resource when first accessed and caches the result for improved performance. - Added
collection.rescale(units)method to rescale the units of all entries in a collection at once. Accepts a dict of{field_name: new_unit}and silently ignores fields not present in an entry.
Changed:
- Changed
entry.remove_columns(),entry.add_columns(), andentry.update_fields()to use frictionless Schema's built-in methods (schema.remove_field(),schema.add_field(),schema.update_field()). - Changed
entry.rename_fields()to perform batch rename operations on all fields at once instead of creating intermediate entries. - Changed
entry.remove_columns()to perform batch column removal at once instead of creating intermediate entries. - Changed
_modify_fields()to_modify_fields_names()for clearer naming, and updated its parameter names (original→fields,alternative→name_mappings). - Changed
update_fields()inunitpackage.localto use frictionlessschema.update_field()instead of manual field dictionary manipulation. - Changed
Entry.update_fields()andcreate_unitpackage()inunitpackage.localto delegate tolocal.update_fields()for consistent field validation and logging. - Changed all docstrings referencing
entry.resource.schema.fieldsto use the simplerentry.fieldsproperty. - Changed
Entry.field_unit()to return an empty string instead of raising a KeyError when a field does not have a unit. - Changed
Entry.from_df()to no longer require theoutdirparameter. - Changed
Entry.from_df()to directly create entries from pandas DataFrames without temporary CSV files. - Changed
Entry.from_df()to requirebasenameas a keyword-only argument. - Changed
Entry.save()to automatically convert pandas resources to CSV format. - Changed
Entry.metadatato return a cachedMetadataDescriptorobject supporting enhanced metadata operations while still reflecting metadata changes. - Changed workflows to use pixi v0.63.2.
- Changed
Collection.create_exampleto useCollection.from_localinternally.
Removed:
- Removed deprecated module
cv_collection. - Removed deprecated module
cv_entry. - Removed
metadataargument fromEntry.from_df()andEntry.from_csv(). - Removed
Entry.create_examples. UseEntry.create_exampleinstead. - Removed
entry.mutable_resource.
Fixed:
- Fixed creating plots from entries without units in the fields (#128).
- Fixed resource naming when importing complex CSV files with multiple headers.
Performance:
- Improved field handling performance by performing batch operations for
rename_fields()andremove_columns(), avoiding O(N) intermediate entry creation. - Improved schema copying efficiency in
_create_new_df_resource()by using direct schema descriptor copying when no updates are needed.
0.11.2
Added:
- Added
unitpackage.electrochemistry.reference_electrodeswhich contains reference electrode data and a dataclass to interact with the data (_reference_electrodes), and aReferenceElectrodeobject, which determining the shift of the potential between different reference scales. - Added
Entry.add_offsetwhich allows shifting the values of a specified column of the entry by a certain offset and tracking the information in the fields description. - Added
EchmdbEntry.rescale_referencewhich allows shifting the potential scale onto another potential scale known tounitpackage.electrochemistry._reference_electrodes.
0.11.1
Removed:
- Removed dependency clevercsv and used Python's csv instead.
0.11.0
Added:
- Added modules from
echemdb-converters(https://github.com/echemdb/echemdb-converters v4.0.1) as modules in unitpackage withinunitpackage.loaders. - Added support for Python 3.14.
Removed:
- Removed support for Python 3.9.
- Removed dependency on iteration_utilities.
0.10.1
Added:
- Added property
identifierstoCollection, returning a list of identifiers of the collection. - Added additional methods to
collection.__getitem__(), allowing for creating new collections from existing collections by providing a list of identifiers (db["id1","id2"]), integers (db[0,2]) or simply a slice (db[2:3]). Additionally, entries can now be selected by their position in the collection (entry = db[3]).
Changed:
- Changed
collection.bibliographyto a cached_property.
Fixed:
- Fixed showing plotly plots in the documentation, by using plotly 5 in the workflow to build the documentation.
0.10.0
Added:
- Added
unitpackage.database.echemdb_entry.CVEntryandunitpackage.database.echemdb.EchemdbEntry, with specific functionalities for the echemdb data repository. - Added tests for Python 3.13.
Changed:
- Changed metadata example keys to use camelCase for consistency with JSON naming conventions.
- Use electrochemistry-data release 0.5.0 for remote data tests.
- Changed upper version bound for plotly from "<6" to "<7".
- Changed version bound for pybtex from ">=0.24,<0.25" to ">=0.25,<0.26".
Deprecated:
- Deprecated
unitpackage.cv.cv_entry.CVEntryandunitpackage.cv.cv_collection.CVCollection.
Removed:
- Removed unused dependency
filelock.
0.9.2
Changed:
- Changed upper version bound for astropy from <=7 to <8.
0.9.1
Removed:
- Removed
unitpackage.local.collect_datapackagesince it is identical to frictionlesspackage = Package().
Fixed:
- Fixed creating and saving entries containing upper case characters, which are converted to lowercase, to match the frictionless specifications.
0.9.0
Added:
Added entry.add_column which allows adding a column to an existing pandas dataframe and extends the Data Package fields with given units.
- Added the property
entry.mutable_resource, which is a virtual modifiable copy of the original resource excluding its metadata. - Added
unitpackage.local.collect_resources, which collects all resources from a list of frictionless Data Packages. - Added
collection.from_local_fileto create a collection from the resources included in a Data Package (JSON). - Added validation to check for duplicate resource names upon creating a collection.
- Added wheel upload on new release.
Changed:
- Changed
unitpackage.entry.Entryfrom being a frictionless Data Package into a frictionless Resource. - Changed
unitpackage.collection.Collectionfrom being a collection of frictionless Data Packages into a collection of frictionless Resources forming a Data Package. - Changed the virtual
echemdbResource into anentry.mutable_resource. - Changed
unitpackage.local.create_df_resourceto create a resource from an actual frictionless Resource instead of a frictionless Data Package. - Changed packages for development to be provided by pixi instead of conda directly.
Removed:
- Removed argument
resource_nameinunitpackage.local.create_df_resourceand all other instances where resources were named "echemdb".
Fixed:
- Fixed parsing of arguments
dataandoutdirforcollection.from_remotedownloading data from the default remote url. - Fixed breaking tests on GitHub (tests should be more stable now since we switched to pixi for locked versions of dependencies.)
Performance:
- Improved loading collections via
collection.from_localorcollection.from_remoteand entries viaentry.from_local. In contrast to the previous version, dataframes are now only loaded when a method or property is called that requires access to the resource's data. This also increases the speed for filtering the data based on metadata predicates.
0.8.5
Added:
- Added
Entry.rename_fields, returning an entry with field names and dataframe column names. - Added the classmethod
Entry._modify_fieldsthat updates a list of fields, and allows keeping the original name.