Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch core functionality #972

Merged
merged 11 commits into from
Mar 6, 2025
Merged
2 changes: 1 addition & 1 deletion symplyphysics/core/experimental/vectors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def filter_scales(mapping: dict[VectorExpr, Expr]) -> dict[VectorExpr, Expr]:

mapping = filter_scales(collect_scales(flatten_additions(self.args)))

scaled_addends = [vector * scale for vector, scale in mapping.items()]
scaled_addends: list[VectorExpr] = [vector * scale for vector, scale in mapping.items()]

match len(scaled_addends):
case 0:
Expand Down
3 changes: 2 additions & 1 deletion test/core/experimental/vectors/test_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def test_init() -> None:
VectorSymbol(name, dim, norm=symbols.force, display_latex=latex)

one_newton_force = VectorSymbol(name, dim, norm=1 * units.newton, display_latex=latex)
assert_equal(one_newton_force.norm, 1 * units.newton)
if one_newton_force.norm: # mypy complains otherwise
assert_equal(one_newton_force.norm, 1 * units.newton)
assert not one_newton_force.is_zero

assert VectorSymbol("a", norm=0) is ZERO
Expand Down