Skip to content

Consolidate typing for coords using Coords and StrongCoords aliases#8094

Open
aman-coder03 wants to merge 2 commits intopymc-devs:mainfrom
aman-coder03:fix/coords-typing
Open

Consolidate typing for coords using Coords and StrongCoords aliases#8094
aman-coder03 wants to merge 2 commits intopymc-devs:mainfrom
aman-coder03:fix/coords-typing

Conversation

@aman-coder03
Copy link

Fixes #7972
Earlier opened a PR #7987

This PR consolidates the typing of coords across the codebase by introducing explicit type aliases:

  • CoordValue
  • Coords
  • StrongCoordValue
  • StrongCoords

These follow the existing pattern used for Shape, Dims, and StrongDims in shape_utils.py.

Previously, coords were inconsistently typed across modules (e.g. Sequence, Sequence | np.ndarray, dict[str, Any]), which made downstream typing unclear and less consistent. This PR standardizes both the user-facing and normalized/internal representations.

Additionally:

  • Adjusted related typing in model.core, shape_utils, and the ArviZ backend
  • Resolved a circular import encountered during initial refactor
  • Updated relevant tests accordingly

@welcome
Copy link

welcome bot commented Feb 6, 2026

Thank You Banner]
💖 Thanks for opening this pull request! 💖 The PyMC community really appreciates your time and effort to contribute to the project. Please make sure you have read our Contributing Guidelines and filled in our pull request template to the best of your ability.

@aman-coder03
Copy link
Author

@michaelosthege i have re-opened this PR which was earlier #7987

@aman-coder03 aman-coder03 reopened this Feb 6, 2026
@aman-coder03
Copy link
Author

@ricardoV94 can you please assign a label to this PR

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.30%. Comparing base (11d0f1b) to head (6fcb9fa).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8094      +/-   ##
==========================================
- Coverage   90.89%   89.30%   -1.60%     
==========================================
  Files         123      123              
  Lines       19501    19549      +48     
==========================================
- Hits        17726    17458     -268     
- Misses       1775     2091     +316     
Files with missing lines Coverage Δ
pymc/backends/arviz.py 96.19% <100.00%> (+0.15%) ⬆️
pymc/distributions/distribution.py 94.50% <100.00%> (ø)
pymc/distributions/shape_utils.py 91.35% <100.00%> (-0.53%) ⬇️
pymc/model/core.py 94.23% <100.00%> (+0.92%) ⬆️
pymc/printing.py 87.66% <100.00%> (+0.16%) ⬆️
pymc/step_methods/state.py 95.52% <100.00%> (ø)
pymc/util.py 82.23% <100.00%> (+1.12%) ⬆️

... and 9 files with indirect coverage changes

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

@aman-coder03
Copy link
Author

@ricardoV94 please have a look at this PR!

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.

Consolidate typing for coords

1 participant