Skip to content

python-math #13: refactor(math): move impl-flag resolver to polismath/utils/env_flags.py - #2641

Draft
jucor wants to merge 1 commit into
spr/edge/18c7048ffrom
spr/edge/bc0518d7
Draft

python-math #13: refactor(math): move impl-flag resolver to polismath/utils/env_flags.py#2641
jucor wants to merge 1 commit into
spr/edge/18c7048ffrom
spr/edge/bc0518d7

Conversation

@jucor

@jucor jucor commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Moves the generic legacy-vs-improved env-switch resolver out of pca.py into polismath/utils/env_flags.py (public name resolve_impl_flag). pca.py and utils/engine_mode.py both import it from there, so reading POLISMATH_ENGINE_MODE no longer drags in the numpy/pandas pca import chain, and resolution warnings log under polismath.utils.env_flags instead of the pca logger. Resolution rules are unchanged: strip + lowercase, unknown value -> default with a warning, read at call time.

tests/test_env_flags.py pins the rules, the shared-resolver identity, and the light engine_mode import (RED observed via ModuleNotFoundError before the move; the light-import test fails on the old code by construction).

commit-id:bc0518d7


Stack:


⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

This was referenced Jul 22, 2026
@jucor
jucor marked this pull request as draft July 22, 2026 00:51
@jucor
jucor changed the base branch from spr/edge/18c7048f to edge July 22, 2026 02:01
@jucor
jucor changed the base branch from edge to spr/edge/18c7048f July 22, 2026 02:02
@jucor
jucor changed the base branch from spr/edge/18c7048f to edge July 22, 2026 02:10
@jucor
jucor changed the base branch from edge to spr/edge/18c7048f July 22, 2026 02:10
@jucor
jucor changed the base branch from spr/edge/18c7048f to edge July 22, 2026 03:54
@jucor
jucor changed the base branch from edge to spr/edge/18c7048f July 22, 2026 03:54
This was referenced Jul 25, 2026
@jucor
jucor force-pushed the spr/edge/18c7048f branch from f8ab673 to c4ef767 Compare July 28, 2026 00:11
@jucor
jucor force-pushed the spr/edge/bc0518d7 branch from 1d21d27 to 0088d79 Compare July 28, 2026 00:12
@jucor jucor changed the title refactor(math): move impl-flag resolver to polismath/utils/env_flags.py python-math #13: refactor(math): move impl-flag resolver to polismath/utils/env_flags.py Jul 28, 2026
…/utils/env_flags.py

Moves the generic legacy-vs-improved env-switch resolver out of `pca.py` into `polismath/utils/env_flags.py` (public name `resolve_impl_flag`). `pca.py` and `utils/engine_mode.py` both import it from there, so reading `POLISMATH_ENGINE_MODE` no longer drags in the numpy/pandas `pca` import chain, and resolution warnings log under `polismath.utils.env_flags` instead of the pca logger. Resolution rules are unchanged: strip + lowercase, unknown value -> default with a warning, read at call time.

`tests/test_env_flags.py` pins the rules, the shared-resolver identity, and the light `engine_mode` import (RED observed via ModuleNotFoundError before the move; the light-import test fails on the old code by construction).

commit-id:bc0518d7
@jucor
jucor force-pushed the spr/edge/bc0518d7 branch from 0088d79 to 0242169 Compare July 28, 2026 01:10
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.

2 participants