You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 146c2c4
Browse filesBrowse the repository at this point in the historyBrowse files
Defer optional SymPy imports until symbolic operations need them (#264)
Part of #234, covering the SymPy half only. The SciPy work remains
separate in #244.
`import spatialmath` no longer loads SymPy just to check scalar types.
`issymbol()` checks the already-loaded module, and scalar/vector checks
use it dynamically so importing SymPy after SpatialMath works too.
The other eager SymPy imports in vector norms, object-matrix
determinants and 2D pose extraction are deferred. Explicit symbolic
helpers load the optional dependency when called; explicit access to
`Symbol` and `symtype` remains available.
Added nine isolated-process test cases covering numeric imports and
operations, both import orders, symbolic arithmetic and transforms,
explicit helpers and legacy aliases, and numeric use with SymPy blocked.
Validation: Python 3.10/Linux, `MPLBACKEND=Agg python -m pytest tests/
-p no:xvfb -q`: 389 passed, 3 skipped, 18 subtests passed. No timing
claim is made here. Other Python versions and platforms were not tested.
**Note on star-imports:** `from spatialmath.base.symbolic import *` no
longer brings `sympy`, `Symbol` and `symtype` into the importing
namespace, since star-imports don't go through the module-level
`__getattr__`. Explicit `from spatialmath.base.symbolic import Symbol,
symtype` still works, and no users of the old behavior turned up in RTB,
MVTB, bdsim or Swift.
0 commit comments