Skip to content

Handle identity-wrapped constants in Maxima serializer#120

Open
Amin-El-Sayed wants to merge 5 commits into
JuliaSymbolics:mainfrom
Amin-El-Sayed:fix-maxima-pi-identity
Open

Handle identity-wrapped constants in Maxima serializer#120
Amin-El-Sayed wants to merge 5 commits into
JuliaSymbolics:mainfrom
Amin-El-Sayed:fix-maxima-pi-identity

Conversation

@Amin-El-Sayed

Copy link
Copy Markdown

Fixes a Maxima serialization failure for expressions where Symbolics wraps constants such as pi/π in identity(...).

Example fixed:

using Symbolics, SymbolicIntegration, SymbolicIntegrationMaxima
@variables x L
m = MaximaMethod(timeout=10)
integrate(sin* x / L)^2, x, 0, L, m; assumptions=(L > 0,))
# (1//2)*L

Changes:

  • serialize identity(arg) as arg for Maxima input
  • add regression coverage for π * x
  • add regression coverage for ∫_0^L sin(πx/L)^2 dx = L/2 under L > 0

Validation:

TEST_GROUP=basic julia --startup-file=no --project=lib/SymbolicIntegrationMaxima -e 'import Pkg; Pkg.test()'
SymbolicIntegrationMaxima.jl | 39/39 passed

@codecov-commenter

codecov-commenter commented Jun 13, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.51%. Comparing base (8647f0d) to head (1eb7ed7).
⚠️ Report is 3 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
+ Coverage   50.98%   54.51%   +3.52%     
==========================================
  Files          23       23              
  Lines        4309     4309              
==========================================
+ Hits         2197     2349     +152     
+ Misses       2112     1960     -152     

☔ View full report in Codecov by Harness.
📢 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.

@Amin-El-Sayed

Copy link
Copy Markdown
Author

I also bumped the SymbolicIntegrationMaxima subpackage version to 0.1.2 in this PR.

Reason: after this is merged, the correct registry path is to register a new SymbolicIntegrationMaxima version from lib/SymbolicIntegrationMaxima in this repository. The previous General registry PR attempted to update the tree hash of already-registered v0.1.1, which is not allowed, so I closed it. Existing v0.1.1 should remain unchanged; v0.1.2 can be the first version registered from the monorepo subdir.

@Amin-El-Sayed

Copy link
Copy Markdown
Author

Follow-up pushed: the remaining basic CI failures were order-sensitive serialization tests. Symbolics/SymbolicUtils may reorder commutative sums/products across Julia/dependency versions, e.g. %pi*x vs x*%pi or asinh(x)+atanh(x) vs the reverse. The new tests check that the required Maxima tokens/functions are present instead of requiring one textual order.\n\nLocal check after the change:\n\n\nTEST_GROUP=basic julia --startup-file=no --project=lib/SymbolicIntegrationMaxima -e 'using Pkg; Pkg.test()'\n# SymbolicIntegrationMaxima.jl | 41 passed\n

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.

3 participants