Depend on micromotion instead of carrying our own quantity-of-motion code - #362
Open
alexarje wants to merge 1 commit into
Open
Depend on micromotion instead of carrying our own quantity-of-motion code#362alexarje wants to merge 1 commit into
alexarje wants to merge 1 commit into
Conversation
…code _qom, _mocap, _posture and _physio move to the micromotion package and become re-export shims. Behaviour is unchanged: every one of the 53 tests in test_qom/test_mocap/test_posture/test_physio passes against micromotion unmodified, and band_limited_qom still returns 5.675 mm/s on the reference 200 Hz optical recording. Why this direction. These functions are credited in their own docstrings to the Still Standing study, which was independently extracting the same measure into micromotion — so the project's central measure was about to exist in two disagreeing copies inside one lab. micromotion needs only numpy, scipy and pandas, so depending on it costs nothing, whereas the reverse would make anyone analysing accelerometer data install a computer-vision stack. It matches the arrow MGT already has to ambiscape. Two duplicate implementations were collapsed onto one code path in micromotion: dfa (float wrapper over the dict-returning version; they agreed to 1.2 per cent on Brownian motion) and sample_entropy (agreed to 0.2 per cent). One item is deliberately left alone: axial_rayleigh. Ours returns R = 0.9985 where micromotion's circular.rayleigh_axial returns 0.9222 for the same bimodal input, and only the latter matches the textbook resultant length of the doubled angles. Ours is kept as-is here because it is the one under test; the discrepancy needs resolving on its own rather than inside this move.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_qom,_mocap,_postureand_physiomove to micromotion and become re-export shims. Public API and behaviour are unchanged.Why
These functions are credited in their own docstrings to the Still Standing study, which was independently extracting the same measure into
micromotion. Left alone, the project's central measure would have existed in two disagreeing copies inside one lab — MGT'sband_limited_qomreads 4.0% abovemicromotion.qomat its own default band and 2.6% above it on a matched band.The dependency points this way because
micromotionneeds only numpy, scipy and pandas. Depending on it costs nothing; the reverse would make anyone analysing accelerometer data install a computer-vision stack. It matches the arrow MGT already has toambiscape.Behaviour is unchanged
All 53 tests in
test_qom,test_mocap,test_postureandtest_physiopass againstmicromotionunmodified — they are vendored there astests/mgt/so the guarantee keeps holding.band_limited_qomstill returns 5.675 mm/s on the reference 200 Hz optical recording, still defaults to 0.3–15 Hz, still uses a two-point difference and still does not band-limit again afterwards.Deduplicated
Two genuine duplicates collapsed onto one code path in
micromotion:dfa— MGT returned a float,micromotion.dynamics.dfaa dict. Now one implementation with a float-returning wrapper. They agreed to 1.2% on Brownian motion; the survivor sits closer to the analytic 1.5.sample_entropy— agreed to 0.2%, now wrapsdynamics.sampen.Left alone on purpose
axial_rayleigh. Ours returns R = 0.9985 wheremicromotion.circular.rayleigh_axialreturns 0.9222 for the same bimodal input, and only the latter matches the textbook resultant length of the doubled angles. Ours is kept as-is because it is the one under test; the discrepancy deserves its own fix rather than being buried in a move.Before merging
micromotionis not yet on PyPI, somicromotion>=0.3will not resolve for end users until it is published. Merge order matters.