Skip to content

v0.0.2 - #6

Merged
kopecn merged 2 commits into
prodfrom
dev
Aug 26, 2026
Merged

kopecn merged 2 commits into
prodfrom
dev

Conversation

@kopecn

@kopecn kopecn commented Aug 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

kopecn and others added 2 commits August 14, 2026 10:28
* updating help for makefile

* updating template module

* cleanups

* cont...

* cool...

* cool...

* scoping out updates and upgrades.

* 01 Template rename and refresh

Rename pyMathTools/pyMathToolsPlotHelpers packages to snake_case
(math_tools/math_plot_helpers) and re-parent QuaternionABC onto the new
foundation_abc layout per the template conformance spec.

* 02 Errors and layering

Add the math_tools exception hierarchy (MathToolsError and three domain
subtypes) and an AST-based package layering test enforcing math_tools
never imports math_plot_helpers/matplotlib, and math_tools.otg (once it
exists) never imports numpy.

* 03 Governance and readme

Add .claude/CLAUDE.md and a real README, correct pyproject dependency
names (numpy/scipy were missing), and fix dead MathTypes import paths in
the two spherical plotting examples so they import-run cleanly.

* updating the github actions

* fixes for ci-cd

* 04 Precision time interval

Add PrecisionTimeInterval: an immutable, hashable, attosecond-exact
subclass of PrecisionTimeIntervalABC backed by a single signed total-
attosecond int, with full arithmetic/ordering/wire-dict surface per
precisionTimeMath.md.

* 05 Precision timestamp

Add PrecisionTimestamp: an immutable, hashable, epoch-referenced
timestamp composing a PrecisionTimeInterval offset plus optional
timescale/reference_frame/uncertainty metadata, with Swift-parity
can_compare/compare_validated semantics per precisionTimeMath.md.

* 06 Position

Add Position: a numpy-backed 3D point type subclassing PositionABC with
cylindrical/spherical/spherical-iso constructors and inverse accessors,
full vector arithmetic, and the shared API idioms (normalize/normalized,
isclose, __array__, unhashable).

* 07 Quaternion additions

Add dot, rotation_matrix_elements (delegating to to_rotation_matrix),
rotate_position, __array__, and snake_case aliases for the two existing
camelCase methods to Quaternion. Purely additive: legacy
tests/test_quaternion.py is untouched.

* 08 Spatial pose

Add SpatialPose: an SE(3) pose composing Position + Quaternion, subclassing
SpatialTransformABC. Constructors (components, homogeneous matrix,
Denavit-Hartenberg, identity), composition/transform via *, translated,
inverse, relative_pose, interpolate (lerp + slerp), position/angular
distance (double-cover safe), and normalize/normalized per spatialMath.md.

* 09 Univariate polynomial

Add UnivariatePolynomial: an immutable, numpy-backed general polynomial
with ascending-degree float64 coefficient storage, derivative/integrate,
companion-matrix real_roots (raises PolynomialSolveError on the zero
polynomial), and value evaluation via numpy's polyval.

* 10 Roots kernel

Faithful port of the Swift OTG analytic root kernel (Roots.swift/Utils.swift):
solve_cubic, solve_resolvent, solve_quartic_monic, evaluate_polynomial,
polynomial_derivative(_monic), shrink_interval, integrate_jerk. Corrects a
latent 1/a^4 vs 1/a^3 scaling bug in solve_cubic's halfq term (inert in the
Swift source's monic-only call sites, not inert for general coefficients per
Compliance 2b), documented in polynomials.md. Re-homes
POLYNOMIAL_ZERO_THRESHOLD from polynomial.py into roots.py.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 11 Waveform1D core container

Adds the scalar waveform container: attosecond-exact PrecisionTime axis,
22 signal generators, None-on-empty statistics (population variance
pinned), attosecond-exact slicing, and the list-vocabulary mutation API.
No DSP mixins yet (composed in a later chunk); no arithmetic operators
(chunk 12).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 12 Waveform1D operators & comparison

Adds the elementwise operator surface: arithmetic (+ - * / // %, forward/
reflected/in-place), bitwise (integer-dtype only), unary, and comparison
producers (elements_equal/less_than/greater_than, isclose_elementwise,
isclose). Waveform-Waveform ops require equal dt+length
(WaveformCompatibilityError otherwise); results carry dt/t0 from the left
operand.

Fixes a bug where Waveform1D's __array__ let numpy's ufunc machinery
bypass Python's operator protocol for numpy-scalar/array operands (e.g.
np.float64(2.0) + w silently returned a bare ndarray, discarding dt/t0)
by setting __array_ufunc__ = None, with a regression test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 13 Waveform1D signal generators

The 22 generators themselves landed early in chunk 11 (umbrella spec
groups them under Constructors). This chunk adds the dedicated
compliance-4 test file, and fixes a real gap: sine's frequency parameter
had no default, so the spec's own pinned example (Waveform1D.sine(n=1000))
raised TypeError. frequency now defaults to 1.0 Hz on sine only, matching
the literal acceptance criterion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 14 DSP support types + mixin protocol

Adds the shared substrate for the upcoming DSP mixin chunks: all 12
support enums + 15 frozen descriptor dataclasses (eq=False on the 5
ndarray-bearing ones), the WaveformProtocol structural contract mixins
will depend on, and Waveform1D._with_values (the replace-values factory).
WaveformTriggerType (undefined in the Python spec text) is flattened from
Swift's associated-value enum into a 4-member discriminator, with the
payload moved onto WaveformTrigger's optional fields.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 15 WaveformPosition

Adds the position time-series aggregate container: (n,3) float64 storage,
on-demand Position materialization, from_components with length/dt
validation, vectorized normalize/component_waveforms (never loops over
materialized elements), and the full mutation/extend/concatenate verb set.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 16 WaveformQuaternion

Adds the quaternion time-series aggregate container, mirroring
WaveformPosition's structure: (n,4) float64 storage in w-first order
(pinned repo-wide, not Swift's x-first), on-demand Quaternion
materialization, w-first component_waveforms/from_components, vectorized
are_all_unit/normalize, and the full mutation/extend/concatenate verb set.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 17 WaveformSpatialPose

Adds the 6-DOF pose time-series container: parallel (n,3) position +
(n,4) w-first quaternion arrays, from_poses/from_waveforms constructors,
nested component_waveforms reusing chunks 15/16's per-axis NamedTuples,
and the is_valid/sample_count=min(...) semantics for the (deliberately
constructible) unequal-array-length edge case. Completes Track C
(chunks 11-17).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 18 DspCalcMixin

Add CalcMixin (integrate/derivative). Fixed a runtime bug in the planned
mixin pattern: nominally subclassing WaveformProtocol shadows Waveform1D's
real properties under C3 linearization, so mixins now self-type instead
(mypy's documented "mixin classes" idiom). Spec and protocol docs updated
accordingly for chunks 19-29.

* 19 DspCorrelationMixin

Add CorrelationMixin (auto_correlation, cross_correlation,
find_max_correlation), backed by scipy.signal.correlate. Lag sign kept as
scipy's native convention (spec-permitted divergence from Swift), documented
in the module docstring.

* 20 DspEnvelopeMixin

Add EnvelopeMixin: amplitude_envelope (Hilbert), upper_lower_envelopes
(peak/valley interpolation), instantaneous_amplitude (HILBERT/RMS/PEAK).

* 21 DspSpectralMixin

Add SpectralMixin: fft, power_spectral_density (Welch), spectrogram,
mel_spectrogram, spectral_features (centroid/spread/rolloff/flatness).

* 22 DspFilteringMixin

Add FilteringMixin: low/high/band-pass, dispatcher (incl. band-stop),
moving-average, exponential, Savitzky-Golay, Whittaker-Henderson filters,
and frequency_response.

* 23 DspPeakMixin

Add PeakMixin: detect_peaks, detect_valleys, find_most_prominent_peaks,
backed by scipy.signal.find_peaks/peak_prominences.

* 24 DspPhaseMixin

Add PhaseMixin: instantaneous_phase, unwrap_phase, instantaneous_frequency,
phase_difference, phase_coherence, phase_synchronization_index, group_delay.

* 25 DspResamplingMixin

Add ResamplingMixin: decimated, interpolated, resampled, resampled_to_match,
polyphase_resampled. Adds WaveformProtocol._with_axis (dt-changing factory
sibling to _with_values) since resampling is the first DSP family that
changes sample spacing.

* 26 DspTimeAlignmentMixin

Add TimeAlignmentMixin: aligned, time_lag, synchronize, time_windows,
time_segments. Adds WaveformProtocol._with_t0 (t0-changing factory,
completing the _with_values/_with_axis/_with_t0 result-factory triangle),
since this is the first DSP family whose results carry a different t0 than
their source.

* 27 DspTriggerMixin

Add TriggerMixin: detect_edge_triggers, detect_level_triggers,
detect_window_triggers, detect_pattern_triggers, generic detect_triggers
dispatcher, with_event_markers. WaveformTrigger gains optional edge/
window_kind fields for the dispatcher; WaveformWithEvents.waveform is now
typed WaveformProtocol instead of concrete Waveform1D, which also removes
support.py's only import of waveform1d.py (preempts the import cycle
flagged in chunk 19).

* 28 DspWindowingMixin

Add WindowingMixin: generate_window, windowed, window_coherent_gain,
window_processing_gain.

* 29 DspZeroCrossingMixin

Add ZeroCrossingMixin: zero_crossings, zero_crossing_count,
zero_crossing_rate, segments_between_zero_crossings.

* 30 DspCompose

Compose all twelve DSP mixins onto Waveform1D in the spec-pinned base order.
Fixes a circular import surfaced by dsp/__init__.py now eagerly re-exporting
every mixin (support.py's WaveformProtocol import moved under
TYPE_CHECKING). Mixin test files drop their local `class _W(Mixin,
Waveform1D)` subclasses in favor of plain Waveform1D. Adds test_compose.py:
MRO/concreteness pins plus a live smoke call per mixin family on a real
Waveform1D instance.

* 31 OtgEnumsAndErrors

* 32 OtgInputParameter

* 33 OtgProfile

* 34 OtgBlockBrakeBound

* 35 OtgTrajectoryAndOutput

* 36 OtgVelocitySteps

* 37 OtgPositionFirstSecondSteps

* 38 OtgPositionThirdStep1

* 39 OtgPositionThirdStep2

* 40 OtgCalculatorTarget

* 41 OtgDriver

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 42 OtgOracleSuites

Corrects otg.md's numeric-truth-table atol from 1e-8 to 1e-6 (semver
0.0.4 -> 0.0.5): the Swift source literals are recorded to only 6
decimal places, so 1e-8 was unsatisfiable by any correct port. Also
corrects "32-case" to "31-case" (the Swift array has 31 entries).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 43 PublicSurface

Final chunk of the math-tools-port plan: curates the flat
`import math_tools as mt` root surface (19 re-exports, no logic),
pinned by test_public_surface.py.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Mark math-tools-port plan complete (all 43 chunks done)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* 44 OtgStep2UdudDiscriminant

Fix j·tf⁴→j·tf³ transcription defect in UDUD-T0246 discriminant
(tf_p3→tf_p2) at position_third_order_step2.py:1731,1752,1763; add
regression test. Scaffold Track F corrective plan overview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 45 OtgTrivialProfileLength

Trivial branch builds fixed-length 8-element a/v/p arrays and sets
pf to current position, per otg.md fidelity requirement 1; add
regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 46 OtgStep1SqrtGuard

Replace 8 bare math.sqrt sites in position_third_order_step1 with the
IEEE-754 _ieee754_sqrt (NaN on negative radicand) so out-of-domain
candidates are rejected by guards instead of raising; add regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 47 PositionToleranceAndTimestampAccessors

Position.is_unit uses rtol=0.0 so only spec atol=1e-12 applies;
days_since_epoch/seconds_of_day derive from signed total_attoseconds
(floor div/mod) for correct pre-epoch behavior. Add regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 48 RootsDegenerateCases

solve_cubic uses a scale-relative leading-coefficient degeneracy
threshold; shrink_interval guards f==0 before the Newton step to
avoid a ZeroDivisionError trap. Update polynomials.md (semver 0.0.4)
and add regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 49 WaveformSpatialPoseIndexing

Route __getitem__/get/pop through a shared _resolve_index helper that
bounds against sample_count (not either raw array's length), per
waveformCore.md compliance 9; add regression tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 50 AggregateContainerApiIdioms

Add __array__ and isclose to the three aggregate waveform containers,
restore WaveformSpatialPose.from_components, and fix Waveform1D.__array__
copy=False contract (C-7). Update waveformCore.md (semver 0.0.3) and add
tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 51 WaveformGeneratorPhaseConventions

chirp/heaviside/sigmoid derive total duration from an endpoint-inclusive
(n-1)*dt span via _span_seconds (0.0 at n<=1), fixing off-by-one phase
conventions. Update waveformCore.md (semver 0.0.4) and add tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 52 SubpackagePublicSurface

Give math_tools.spherical and math_plot_helpers curated __all__
re-exports; update README/examples to import at subpackage level; pin
the surface with tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 53 WindowConventionReconciliation

Reconcile window symmetric/periodic conventions: add periodic param to
windowing helpers (default symmetric), share DEFAULT_KAISER_BETA across
windowing/spectral. Document per-family rule in waveformDsp.md (semver
0.0.8) and add tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 54 TestClosureTracksBC

Close 11 Track B/C test-coverage gaps (hashability, double-cover
isclose, operator surface, generator analytics, bulk smoke, indexing);
set Quaternion.__hash__ = None explicitly (the one permitted src edit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 55 TestClosureDsp

Close 23 DSP test-coverage gaps with value-level known-answer/analytic
assertions across all DSP mixin families; tests only, no src changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 56 TestClosureOtgOracles

Close 8 OTG oracle-coverage gaps: add a reproducible 450-case multi-DOF
corpus that exercises Step2 (0->900 invocations), plus continuity,
retarget, invariant, and the missing testBugFix_NegativeTimeInterval_Case3
cases. Correct chunk 42's stale 'all 4 testBugFix' claim. Tests/data only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* 57 DocsAndConventionSweep

Reconcile docs against post-fix repo: fix dead CI/workflow refs, stale
OTG tolerance (1e-6) and case-count claims, install/keyword drift; wire
examples/ into the gate (lint+typecheck clean); delete hints.py dead
__main__; add governance tests. Bump templateConformance (0.0.3) and
overview (0.1.1).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Mark math-tools-port plan complete (Track F, all 57 chunks done)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* clean room installs requirements.txt before the package

pyproject declares dependency NAMES ONLY per the BKM; requirements.txt carries
the pins and git pointers. testInEnvInstallFromSetup ran `pip install ".[dev]"`
alone, so pip resolved the bare name pyFoundationTools against PyPI and failed
with "No matching distribution found".

Every other install path here already installs -r requirements.txt first.
make testInEnv now green: 1550 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* rename clean-room sub-steps so they stop implying tests

Back-port of the py-cookiecut rename. testInEnv green end-to-end after the
rename (1550 passed in the clean room).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* cont....

* bump ver

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
@kopecn
kopecn merged commit 07a65b9 into prod Aug 26, 2026
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.

1 participant