Skip to content

Releases: echemdb/unitpackage

0.12.0

13 Feb 23:43

Choose a tag to compare

Added:

  • Added Entry.apply_scaling_factor which multiplies a column by a given value and tracks the cumulative scaling factor in the field metadata.
  • Added EchemdbEntry.scan_rate property returning the scan rate as an astropy quantity from figureDescription.scanRate.
  • Added EchemdbEntry.rescale_scan_rate which 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.fields as 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 device parameter to Entry.from_csv() to select instrument-specific loaders (e.g., device='eclab' for BioLogic MPT files, device='gamry' for Gamry DTA files).
  • Added BaseLoader.metadata property, which returns file structure information (loader name, delimiter, decimal, header, column headers) stored as dsvDescription in 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.py module (renamed from column_names.py) containing biologic_fields and biologic_fields_alt_names for 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 MetadataDescriptor class for enhanced metadata handling with dict and attribute-style access.
  • Added Entry.default_metadata_key class attribute to control metadata access patterns in subclasses.
  • Added Entry._default_metadata property to access the appropriate metadata subset.
  • Added encoding, header_lines, column_header_lines, decimal, delimiters, and device parameters to Entry.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_resource as 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(), and entry.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() in unitpackage.local to use frictionless schema.update_field() instead of manual field dictionary manipulation.
  • Changed Entry.update_fields() and create_unitpackage() in unitpackage.local to delegate to local.update_fields() for consistent field validation and logging.
  • Changed all docstrings referencing entry.resource.schema.fields to use the simpler entry.fields property.
  • 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 the outdir parameter.
  • Changed Entry.from_df() to directly create entries from pandas DataFrames without temporary CSV files.
  • Changed Entry.from_df() to require basename as a keyword-only argument.
  • Changed Entry.save() to automatically convert pandas resources to CSV format.
  • Changed Entry.metadata to return a cached MetadataDescriptor object supporting enhanced metadata operations while still reflecting metadata changes.
  • Changed workflows to use pixi v0.63.2.
  • Changed Collection.create_example to use Collection.from_local internally.

Removed:

  • Removed deprecated module cv_collection.
  • Removed deprecated module cv_entry.
  • Removed metadata argument from Entry.from_df() and Entry.from_csv().
  • Removed Entry.create_examples. Use Entry.create_example instead.
  • 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() and remove_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

15 Jan 20:12

Choose a tag to compare

Added:

  • Added unitpackage.electrochemistry.reference_electrodes which contains reference electrode data and a dataclass to interact with the data (_reference_electrodes), and a ReferenceElectrode object, which determining the shift of the potential between different reference scales.
  • Added Entry.add_offset which 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_reference which allows shifting the potential scale onto another potential scale known to unitpackage.electrochemistry._reference_electrodes.

0.11.1

15 Dec 13:47

Choose a tag to compare

Removed:

  • Removed dependency clevercsv and used Python's csv instead.

0.11.0

12 Dec 14:53

Choose a tag to compare

Added:

Removed:

  • Removed support for Python 3.9.
  • Removed dependency on iteration_utilities.

0.10.1

20 Aug 20:33

Choose a tag to compare

Added:

  • Added property identifiers to Collection, 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.bibliography to 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

05 Aug 12:35

Choose a tag to compare

Added:

  • Added unitpackage.database.echemdb_entry.CVEntry and unitpackage.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.CVEntry and unitpackage.cv.cv_collection.CVCollection.

Removed:

  • Removed unused dependency filelock.

0.9.2

11 Jun 20:15

Choose a tag to compare

Changed:

  • Changed upper version bound for astropy from <=7 to <8.

0.9.1

12 Apr 11:05

Choose a tag to compare

Removed:

  • Removed unitpackage.local.collect_datapackage since it is identical to frictionless package = Package().

Fixed:

  • Fixed creating and saving entries containing upper case characters, which are converted to lowercase, to match the frictionless specifications.

0.9.0

24 Feb 20:29

Choose a tag to compare

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_file to 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.Entry from being a frictionless Data Package into a frictionless Resource.
  • Changed unitpackage.collection.Collection from being a collection of frictionless Data Packages into a collection of frictionless Resources forming a Data Package.
  • Changed the virtual echemdb Resource into an entry.mutable_resource.
  • Changed unitpackage.local.create_df_resource to 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_name in unitpackage.local.create_df_resource and all other instances where resources were named "echemdb".

Fixed:

  • Fixed parsing of arguments data and outdir for collection.from_remote downloading 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_local or collection.from_remote and entries via entry.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

19 Dec 09:45

Choose a tag to compare

Added:

  • Added Entry.rename_fields, returning an entry with field names and dataframe column names.
  • Added the classmethod Entry._modify_fields that updates a list of fields, and allows keeping the original name.