Repository navigation
Releases
Releases · praneethnamburi/datanest
v1.2.0
Added
Database.__init__now detects reserved-suffix column collisions. A collision exists when both<base>and<base><suffix>are present as columns, with<suffix>in(_lim, _has, _any)— in that case the kwarg<base><suffix>=vinDatabase.__call__is ambiguous between the suffix predicate (range / set / substring) and a literal-column equality. Configurable via the new keyword-onlyon_reserved_suffixparameter:"warn"(default — emits aReservedSuffixCollisionWarning),"raise"(raisesValueError),"ignore", or"rename"(auto-rename the colliding column via_lim→_limits,_has→_contains,_any→_options; raises if the rename target already exists). The warning message in"warn"mode points users to both fixes (rename the source manually, or passon_reserved_suffix='rename'). Resolves the open question deferred from 1.1.0.ReservedSuffixCollisionWarning(subclass ofUserWarning) — exported so callers canwarnings.filterwarnings(...)against it specifically.
Notes
- Non-breaking. Existing
Database(df)calls keep working; the new check only fires when the DataFrame has both a<base>and a<base><suffix>column.DatabaseContainerdoes not re-check after its overlapping-column rename — those renames almost never produce new reserved-suffix collisions in practice. - Rename mode mutates
self._data(viaDataFrame.rename(columns=...), which returns a new frame) — the user's original DataFrame is not mutated in place.
v1.1.0
Added
DatabaseContainer— manage hierarchical relationships betweenDatabaseinstances (e.g. subject → trial →
action) with key-derivation lambdas linking levels. Supportsadd,add_data_field(via the contained
Databaseinstances), the same_lim/_has/_anykeyword-suffix query syntax asDatabase,records,
help, and parent/child column casting (_cast_column_to_db).DatabaseContaineris now exported (from datanest import DatabaseContainer).cache_me_if_you_can/cache_me_if_you_can_incremental— dill-backed file-cache decorators, migrated from
immersionToolbox/immersionlab/__init__.py. Theappend_str: str(eval'd at call time) parameter is
replaced bysuffix: Callable[..., str]; pn-projects callers updated in the same release.- GitHub Actions CI (
.github/workflows/test.yml) — pytest matrix across Python 3.8–3.12 on Ubuntu 22.04 /
macOS latest / Windows latest, triggered on push and PRs. [project.optional-dependencies] testgroup (pip install -e ".[test]") — installspytestandopenpyxl
(the latter exercisesDatabase's Excel I/O path in the test suite without bloating the runtime dep list).- README "Payload types — anything goes" section documenting the modality-agnostic design: payloads can be any
Python object, andpysampled.Datais a use convention rather than a hard dependency.
Dependencies
dillis now a required dependency (used by the newcache_me_if_you_can*decorators).- Python floor raised from 3.7 to 3.8 (3.7 is EOL and unsupported by the new CI matrix).
Tests
test_database_container.py—_make_synthetic_signalsnow returns plainnp.ndarraypayloads instead of
pysampled.Data. The two affected tests exerciseadd_data_field's modality-agnostic contract (key→object
dict), which the payload type does not influence; removing thepysampledtest-only import aligns the suite
with datanest's design philosophy and drops a test-only dep.
Notes
DatabaseContainer: this is its new home — previously implemented in
immersionToolbox/immersionlab/__init__.py. The legacy classes there become a re-export shim of the
datanestoriginals (mirroring theimmersionlab/delsys.pypattern); existing
immersionlab.DatabaseContainersubclasses continue to work unchanged.cache_me_if_you_can*: no re-export shim is left inimmersionlab(in contrast with
DatabaseContainer). pn-projects callers were flipped to import directly fromdatanestin lockstep with the
migration;immersionlab.cache_me_if_you_canno longer exists.
Deferred to 1.2.0
break_signals_into_actionsstays inimmersionlab(couples to pysampled / event semantics — does not
belong in datanest's modality-agnostic core).immersionlab.DatabaseContainerkeeps the method via a thin
subclass.- Kwarg-suffix collision detection (
_lim/_has/_anyreservations vs. real column names) — TODO at
datanest/__init__.pyDatabaseContainerdocstring.
v1.0.0
Version: 1.0.0
Date: 2024.02.04
Summary: First major release of datanest, A simple, intuitive, pandas-based database that is ideal for handling data such as time series, images, or any Python objects alongside their metadata.
Installation: pip install datanest
Dependencies: python>=3.7, numpy, pandas, and optionally openpyxl
Testing: Performed using pytest. All 7 tests passed.
Coverage: 100%
Contributors: Praneeth Namburi
License: MIT