Skip to content

♻️ refactor: adapt tests#525

Merged
nstarman merged 14 commits into
GalacticDynamics:mainfrom
nstarman:style-cleanup
May 18, 2026
Merged

♻️ refactor: adapt tests#525
nstarman merged 14 commits into
GalacticDynamics:mainfrom
nstarman:style-cleanup

Conversation

@nstarman
Copy link
Copy Markdown
Contributor

No description provided.

nstarman added 13 commits May 17, 2026 22:52
…anifold API

Update strategy tests and chart/vector/distance tests to reflect the current API conventions introduced by the metric refactor.
Replace float literals (1.0, 2.0, etc.) with integer literals where values are whole numbers, and normalize rtol=0.0 to rtol=0 in assert_allclose calls.
…ity_matrix tests

Replace float literals like 1.0, 2.0 with int equivalents where the values are whole numbers. Preserve floats where needed for JAX grad/jvp tests, dtype-sensitive operations, and mixed-unit conversion tests that produce float results.
…egies and ptmap

Replace float literals like 8.0, -8.0, -3.0, 3.0, -5.0, 5.0, 10.0, -10.0 with int equivalents where the values are whole numbers and dtype safety permits.

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Replace float literals like 1.0, 2.0 with int equivalents where the values are whole numbers and dtype safety permits. Keep float inputs to grad_f and fixture matrices that drive JIT dtype traces.
Replace float literals like 1.0, 2.0 with int equivalents where the values are whole numbers and dtype safety permits.
Replace float literals like 1.0, 2.0 with int equivalents where the values are whole numbers and dtype safety permits.
Replace float literals like 1.0, 2.0 with int equivalents where the values are whole numbers and dtype safety permits.
Replace float literals like 1.0, 2.0 with int equivalents where the values are whole numbers and dtype safety permits.
Remove magic trailing commas from expressions that fit within the 88-char line limit, allowing ruff-format to collapse them to a single line. Also fix DenseMetric fixture to use float array to avoid JIT MLIR dtype mismatch.

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Remove magic trailing commas from expressions that fit within the 88-char line limit, allowing ruff-format to collapse them to a single line.
Remove magic trailing commas from conftest.py, noxfile.py, and scripts/validate_tag.py.
@nstarman nstarman added this to the v0.24.0 milestone May 18, 2026
@github-actions github-actions Bot added 🔧 Add / update configuration Add or update configuration files. ✅ Add / update / pass tests Add, update, or pass tests. ♻️ Refactor code Refactor code. 🎨 Improve code structure / format Improve structure / format of the code. labels May 18, 2026
@nstarman nstarman changed the title Style cleanup ♻️ refactor(coordinax.hypothesis): adapt tests May 18, 2026
@nstarman nstarman changed the title ♻️ refactor(coordinax.hypothesis): adapt tests ♻️ refactor: adapt tests May 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.91%. Comparing base (e3b9782) to head (d1fac28).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #525   +/-   ##
=======================================
  Coverage   92.91%   92.91%           
=======================================
  Files         249      249           
  Lines        7877     7881    +4     
=======================================
+ Hits         7319     7323    +4     
  Misses        558      558           

☔ 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.

@nstarman nstarman marked this pull request as ready for review May 18, 2026 03:12
Copilot AI review requested due to automatic review settings May 18, 2026 03:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR primarily adapts and reformats tests across the coordinax workspace, with a small internal dtype-inference change for the custom QMatrix determinant primitive.

Changes:

  • Normalizes many test literals and formatting in core, astro, curveframes, and hypothesis test suites.
  • Updates selected representation strategy tests to use canonical singleton representation kinds.
  • Adjusts custom determinant abstract evaluation to promote integer input dtypes to inexact output dtypes.

Reviewed changes

Copilot reviewed 64 out of 64 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/coordinax/_src/internal/quantity_matrix/_det.py Updates determinant abstract dtype inference.
src/coordinax/_src/internal/quantity_matrix.py Formatting-only QMatrix primitive code change.
src/coordinax/_src/internal/quantity_matrix/_register_primitives.py Formatting-only matrix contraction change.
src/coordinax/_src/minkowski/register_metric.py Formatting-only Minkowski metric construction change.
src/coordinax/_src/embedded/chart.py Formatting-only embedded manifold construction change.
src/coordinax/transforms/_src/groups.py Formatting-only group declaration change.
src/coordinax/vectors/__init__.py Formatting-only import consolidation.
src/coordinax/vectors/_src/bundle.py Formatting-only coordinate helper/cconvert changes.
src/coordinax/vectors/_src/register_quax.py Formatting-only Quax vector primitive changes.
packages/coordinax.astro/src/coordinax/astro/_src/galactocentric.py Formatting-only field definitions.
packages/coordinax.curveframes/src/coordinax/curveframes/_src/bishop.py Formatting-only Bishop frame construction call.
packages/coordinax.curveframes/src/coordinax/curveframes/_src/frenetserret.py Formatting-only constructor signature change.
packages/coordinax.hypothesis/src/coordinax/hypothesis/distances/_src/dist.py Formatting-only distance strategy construction.
packages/coordinax.hypothesis/src/coordinax/hypothesis/manifolds/_src/atlas.py Formatting-only atlas strategy changes.
packages/coordinax.hypothesis/src/coordinax/hypothesis/manifolds/_src/charts.py Formatting-only embedded chart strategy change.
packages/coordinax.hypothesis/src/coordinax/hypothesis/manifolds/_src/manifold.py Formatting-only manifold strategy dispatch.
packages/coordinax.hypothesis/src/coordinax/hypothesis/representations/_src/reps.py Formatting-only representation validation change.
tests/unit/internal/test_quantity_matrix.py Formatting-only QMatrix test updates.
tests/unit/angles/test_angle.py Formatting-only angle strategy/test updates.
tests/unit/charts/test_checks.py Formatting-only chart check test update.
tests/unit/distances/test_distance.py Formatting-only distance tests.
tests/unit/manifolds/test_angle_between_dispatch.py Normalizes numeric literals in angle-between tests.
tests/unit/manifolds/test_custom.py Normalizes formatting/literals in custom manifold tests.
tests/unit/manifolds/test_metric_field.py Normalizes literals in metric field tests.
tests/unit/manifolds/test_metric_matrix_dispatch.py Normalizes literals in metric matrix dispatch tests.
tests/unit/manifolds/test_metric_matrix_types.py Normalizes literals in metric matrix type tests.
tests/unit/manifolds/test_metric_pullback_consistency.py Normalizes literals in pullback metric tests.
tests/unit/manifolds/test_metrics.py Normalizes literals/formatting in metric tests.
tests/unit/manifolds/test_scale_factors_dispatch.py Normalizes literals in scale factor tests.
tests/unit/representations/test_cconvert_tangent.py Normalizes literals in tangent conversion tests.
tests/unit/representations/test_change_basis.py Normalizes literals/formatting in basis-change tests.
tests/unit/representations/test_guess_basis_kind.py Normalizes quantity literals in basis inference tests.
tests/unit/representations/test_guess_semantic_kind.py Normalizes quantity literals in semantic/geometry inference tests.
tests/unit/representations/test_tangent_map.py Normalizes literals in tangent-map tests.
tests/unit/representations/test_tangent_map_properties.py Normalizes literals/formatting in tangent-map property tests.
tests/unit/transforms/conftest.py Formatting-only transform fixture update.
tests/unit/transforms/test_act.py Formatting/literal normalization in transform action tests.
tests/unit/transforms/test_active_semantics.py Normalizes literals/formatting in active semantics tests.
tests/unit/transforms/test_groups.py Normalizes literals/formatting in transform group tests.
tests/unit/transforms/test_reflect.py Normalizes literals in reflection tests.
tests/unit/transforms/test_spatial_linear_transforms.py Normalizes literals in scale/shear tests.
tests/unit/transforms/test_translate.py Normalizes literals in translation tests.
tests/unit/vectors/test_arithmetic.py Normalizes literals in vector arithmetic tests.
tests/unit/vectors/test_coordinate.py Normalizes literals/formatting in coordinate tests.
tests/unit/vectors/test_tangent.py Normalizes literals and updates one tangent construction to composite rep usage.
tests/usage/charts/test_jacobian.py Normalizes literals/formatting in Jacobian usage tests.
tests/usage/frames/test_act_usage.py Formatting-only frame action usage tests.
tests/integration/charts/test_jax.py Formatting-only JAX chart integration test.
packages/coordinax.astro/tests/unit/test_frame_transforms.py Formatting/literal normalization in astro frame transform tests.
packages/coordinax.curveframes/tests/test_bishop.py Formatting-only Bishop roundtrip tests.
packages/coordinax.curveframes/tests/test_bishop_frame.py Renames local test helper and updates formatting.
packages/coordinax.hypothesis/tests/benchmark/test_benchmark_strategies.py Formatting-only benchmark test updates.
packages/coordinax.hypothesis/tests/unit/charts/test_cdicts.py Formatting-only CDict strategy test update.
packages/coordinax.hypothesis/tests/unit/charts/test_chart_classes.py Formatting-only chart class strategy tests.
packages/coordinax.hypothesis/tests/unit/charts/test_product_charts.py Updates fixed product chart factor names and formatting.
packages/coordinax.hypothesis/tests/unit/manifolds/test_manifolds.py Formatting-only manifold strategy tests.
packages/coordinax.hypothesis/tests/unit/representations/test_representations.py Updates representation strategy tests to use singleton kinds.
packages/coordinax.hypothesis/tests/unit/utils/test_subclasses.py Formatting-only subclass utility test.
packages/coordinax.hypothesis/tests/unit/utils/annotations/test_annotations.py Formatting-only annotation strategy tests.
packages/coordinax.hypothesis/tests/unit/utils/annotations/test_parse_jaxtyping_shape.py Import-order adjustment.
packages/coordinax.hypothesis/tests/unit/utils/annotations/test_strategy_for_annotation.py Import-order adjustment.
scripts/validate_tag.py Formatting-only logging setup change.
noxfile.py Formatting-only docs session argument changes.
conftest.py Formatting-only Sybil parser setup change.

Comment thread src/coordinax/_src/internal/quantity_matrix/_det.py Outdated
…I equivalent

Use jnp.issubdtype + jnp.result_type to replicate to_inexact_dtype, removing the dependency on the private jax._src.dtypes module.
@nstarman nstarman merged commit cec14c8 into GalacticDynamics:main May 18, 2026
15 checks passed
@nstarman nstarman deleted the style-cleanup branch May 18, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔧 Add / update configuration Add or update configuration files. ✅ Add / update / pass tests Add, update, or pass tests. 🎨 Improve code structure / format Improve structure / format of the code. ♻️ Refactor code Refactor code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants