Skip to content

Basic sync functionality#160

Merged
StokesMIDE merged 34 commits intodevelopfrom
feature/DCB-110_timestamp_offset
Aug 7, 2025
Merged

Basic sync functionality#160
StokesMIDE merged 34 commits intodevelopfrom
feature/DCB-110_timestamp_offset

Conversation

@StokesMIDE
Copy link
Member

@StokesMIDE StokesMIDE commented May 19, 2025

This adds functionality for syncing one Dataset to another, as well as mechanisms for copying sync info from one recording to another.

This also introduces Dataset.fingerprint for creating a hash based on IDE header data, a means of identifying a particular recording that's fast, lightweight, and more reliable than filename comparison.

…orrected data types; removed deprecated call; various fixes
@codecov-commenter
Copy link

codecov-commenter commented May 19, 2025

Codecov Report

❌ Patch coverage is 92.12598% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.37%. Comparing base (a425045) to head (4a2a242).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
idelib/sync.py 93.22% 12 Missing ⚠️
idelib/dataset.py 88.88% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #160      +/-   ##
===========================================
+ Coverage    74.86%   78.37%   +3.51%     
===========================================
  Files           13       14       +1     
  Lines         4022     5115    +1093     
===========================================
+ Hits          3011     4009     +998     
- Misses        1011     1106      +95     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@StokesMIDE StokesMIDE requested a review from pscheidler May 19, 2025 21:50
@StokesMIDE StokesMIDE self-assigned this May 21, 2025
@StokesMIDE StokesMIDE marked this pull request as ready for review July 7, 2025 14:30
Copy link
Member

@pscheidler pscheidler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry this took so long to review, but I'm really glad I got a chance to test it out

@StokesMIDE StokesMIDE merged commit 782367b into develop Aug 7, 2025
31 checks passed
@StokesMIDE StokesMIDE deleted the feature/DCB-110_timestamp_offset branch August 7, 2025 14:15
@StokesMIDE StokesMIDE restored the feature/DCB-110_timestamp_offset branch October 13, 2025 22:11
StokesMIDE added a commit that referenced this pull request Feb 17, 2026
* Fixing issue in CDB considering the channel id an int

* Updating all IDs to UInt

* Adding Python 3.13 to the tests

* Update idelib/schemata/mide_ide.xml

* Update .github/workflows/unit-tests.yml

* doc python version fix

* Added non-sync-related changes

* Some missed changes

* Removed sync-related schema changes (will be in other PR)

* Removed timestamp offset changes

* removed a bit more sync stuff

* Removed Sphinx fail-on-warning

* Updated versions in publish-to-pypi GHA

* Test update for `ebmlite` 3.4.0

* Feature/es 851 util docs (#162)

* Start of utility docs, not connected to main docs yet

* Util docs (missed last commit)

* Linked utilities docs into main page; small related edits

* Minor doc improvements

* A couple more edits

* Basic sync functionality (#160)

* Added missing Sensor attributes, docstring updates

* Fixed bad test, removed tests of impossible use

* Fixed Channel/SubChannel sensor references; added `Sensor.getChannels()`; skipped bad tests; added annotation

* Added `UserData` elements for file sync info; added some documentation to schema

* Added session offset (untested)

* First trial sync-related functions, some small fixes, removed bad tests

* Fully implemented time offset; deprecated `Session.startTime` and `Session.endTime`; cleanup

* Fixed `Sensor` hash and `__eq__()`; added start of basic sync compatibility check

* Revised sync-related schema 'user data' elements

* Implemented sync, but something's wrong

* Fixed offset scaling issue; little bit of cleanup

* Made sync reference mean index-based; Session.__repr__ improvement; corrected data types; removed deprecated call; various fixes

* Fixed compatibility w/ Python < 3.11

* Added basic sync/offset tests; removed some vestigial attributes; more documentation and type annotation

* More sync validity checks; sync using specific sensor ID; minor tweaks

* Added SyncInfo for userdata; rudimentary thread safety

* Fleshed out sync functions; added sync from/to userdata; sync-related schema revisions; misc. fixes

* More sync tests

* Revised `clear` parameter in `sync.sync`; more tests.

* Added basic `Dataset` hash mechanism (`Dataset.fingerprint`)

* More stuff for sync info copy/paste; sync parameter improvement

* A little bit more coverage

* More sync copy/paste stuff; more tests

* minor fix, minor coverage increase

* Improved logging; removed Python <3.7 hack; codecov tags

* small codecov tag test

* Added to `sync` docstring for Sphinx render.

* Docstrings and small edits

* Documentation (fixes, added sync and other excluded submodules)

* Attempted sphinx warning fix

* docstrings and cleanup (#163)

* Docstring edits (fixing tags, adding missing parameters, etc.), some code formatting cleanup

* Schema documentation edit; added text/style elements to `WarningRange`; added notes to `UserData`

* Removed schema additions (should be in different PR)

* Added a couple of elements for future userdata use (#164)

* Feature/sync (#167)

* Added missing Sensor attributes, docstring updates

* Fixed bad test, removed tests of impossible use

* Fixed Channel/SubChannel sensor references; added `Sensor.getChannels()`; skipped bad tests; added annotation

* Added `UserData` elements for file sync info; added some documentation to schema

* Added session offset (untested)

* First trial sync-related functions, some small fixes, removed bad tests

* Fully implemented time offset; deprecated `Session.startTime` and `Session.endTime`; cleanup

* Fixed `Sensor` hash and `__eq__()`; added start of basic sync compatibility check

* Revised sync-related schema 'user data' elements

* Implemented sync, but something's wrong

* Fixed offset scaling issue; little bit of cleanup

* Made sync reference mean index-based; Session.__repr__ improvement; corrected data types; removed deprecated call; various fixes

* Fixed compatibility w/ Python < 3.11

* Added basic sync/offset tests; removed some vestigial attributes; more documentation and type annotation

* More sync validity checks; sync using specific sensor ID; minor tweaks

* Added SyncInfo for userdata; rudimentary thread safety

* Fleshed out sync functions; added sync from/to userdata; sync-related schema revisions; misc. fixes

* More sync tests

* Revised `clear` parameter in `sync.sync`; more tests.

* Added basic `Dataset` hash mechanism (`Dataset.fingerprint`)

* More stuff for sync info copy/paste; sync parameter improvement

* A little bit more coverage

* More sync copy/paste stuff; more tests

* minor fix, minor coverage increase

* Improved logging; removed Python <3.7 hack; codecov tags

* small codecov tag test

* Added to `sync` docstring for Sphinx render.

* Docstrings and small edits

* Documentation (fixes, added sync and other excluded submodules)

* Attempted sphinx warning fix

* Fix for sync offsets while file lazy-loading

* Optimization/safety check in `EventArray.append()`

* Added 'fine' UTC time base elements to schema; more minor fixes (mostly sync related)

* First attempt at GNSS timebase adjustment; basic handling of 'fine' timebase values

* fixed test after exception type change

* Added more GNSS timebase functions; some sync refactoring; added GNSS timebase tests

* Fixed sync removal; added userdata revert on error; additional tests.

* Added sync CLI utility (1st draft); minor fixes/updates

* Added `--sync` option to `ideexport`, small fixes to `idesync`

* Made fixes to `idesync.syncFiles()` and added a couple of basic tests

* python < 3.11 datetime fix

* Added GNSS/userdata test

* Sync documentation and setup update (`idesync` entry point, Python versions)

* Moved `idesync` tests to `test_tools.py`; improved `idesync` output; docstring edits

* added missing `sync` arg

* Fix for applying sync to an unloaded IDE

* Added `ideexport` test w/ sync data, test applying sync to a partially-loaded IDE

* comments

* Added Python 3.14 to unit tests and PyPI classifiers; updated docs URL (#168)

Mostly just a metadata change; merging without review.

* Fix for export w/ UTC timestamps

* Schema change: added `<EscapedCharacters>` to `<SerialCommandInterface>`

* Fix for Numpy >2.2.1; removed workaround for Python < 3.7)

* Added basic `idesync` utility documentation (#171)

* Added basic `idesync` utility documentation

* Minor doc clarification

* Version bump (3.4.0)

* Fix reading files when only the first block has 1 sample (#165)

* fix: add block.numSamples = 1 condition when setting block.minMeanMax with _singleSample EventArray

* fix: replace bitwise '&' with 'and'

* type hints

---------

Co-authored-by: Peter Scheidler <pscheidler@gmail.com>
Co-authored-by: Peter Scheidler <pscheidler@mide.com>
Co-authored-by: XanthanGum <33803457+XanthanGum@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants