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

sage.calculus: Modularization fixes, doctest cosmetics, # needs #35717

Merged
merged 29 commits into from
Aug 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8dc47e8
sage.calculus: Add # optional - numpy, sympy
mkoeppe Mar 6, 2023
b88272f
sage.calculus: Doctest cosmetics
mkoeppe Jun 4, 2023
cc152c1
sage.calculus: Add # optional
mkoeppe Jun 4, 2023
654f27c
sage.calculus: Add # optional
mkoeppe Jun 4, 2023
ddbad8d
sage.calculus: Doctest cosmetics
mkoeppe May 19, 2023
c68e14f
sage.calculus: Add # optional
mkoeppe May 20, 2023
933a6eb
sage.calculus: Modularization fixes
mkoeppe Jun 1, 2023
be243bf
src/sage/calculus/transforms/dft.py: Fix up
mkoeppe Jun 4, 2023
a25a7e0
src/sage/calculus/transforms/dft.py: Do not lazy_import RR, keep sage…
mkoeppe Jun 4, 2023
2dd2026
Merge branch 'develop' into sage_calculus_modularization_fixes
mkoeppe Jun 11, 2023
d2b9265
sage.calculus: More # optional
mkoeppe Jun 19, 2023
be0ac79
src/sage/calculus/transforms/dft.py: Add missing import
mkoeppe Jun 19, 2023
6ae45a7
src/sage/calculus/transforms/fft.pyx: Fix doc markup
mkoeppe Jun 19, 2023
901e719
Merge tag '10.1.beta4' into sage_calculus_modularization_fixes
mkoeppe Jun 22, 2023
92bd779
sage.calculus: Avoid use of symbolics in some doctests
mkoeppe Jun 22, 2023
ec0f34b
src/sage/calculus/transforms/dft.py (dct, dst): Try to avoid using sa…
mkoeppe Jun 29, 2023
a49e884
src/sage/calculus/ode.pyx: Fix markup
mkoeppe Jun 29, 2023
551d714
Merge tag '10.1.beta5' into sage_calculus_modularization_fixes
mkoeppe Jul 1, 2023
917c892
src/sage/calculus/interpolation.pyx: Make a doctest less sensitive to…
mkoeppe Jul 1, 2023
9413783
Merge tag '10.1.beta6' into sage_calculus_modularization_fixes
mkoeppe Jul 9, 2023
69ac234
sage -fixdoctests --only-tags src/sage/calculus/**/*.{py,pyx}
mkoeppe Jul 9, 2023
60b459c
./sage -fixdoctests --distribution sagemath-modules --only-tags --pro…
mkoeppe Jul 14, 2023
22f8294
sage.calculus: Update # needs from #35095
mkoeppe Jul 14, 2023
12b3cc1
src/sage/calculus/ode.pyx: Do not rely on block-level doctest tag for…
mkoeppe Jul 14, 2023
0895830
Merge branch 'develop' into sage_calculus_modularization_fixes
mkoeppe Jul 21, 2023
830a233
Merge tag '10.1.beta8' into sage_calculus_modularization_fixes
mkoeppe Jul 30, 2023
214d910
# optional -> # needs
mkoeppe Aug 1, 2023
bfd511f
typo
mkoeppe Aug 1, 2023
e1decf3
src/sage/calculus/transforms/dft.py: Replace .all import
mkoeppe Aug 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sage/calculus/functional.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - sage.symbolic
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs sage.symbolic would work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed (in all files)

Functional notation support for common calculus methods

1 change: 1 addition & 0 deletions src/sage/calculus/functions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - sage.symbolic
r"""
Calculus functions
"""
1 change: 1 addition & 0 deletions src/sage/calculus/integration.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - sage.symbolic
"""
Numerical Integration

24 changes: 12 additions & 12 deletions src/sage/calculus/interpolation.pyx
Original file line number Diff line number Diff line change
@@ -55,39 +55,39 @@ cdef class Spline:

This example is in the GSL documentation::

sage: v = [(i + sin(i)/2, i+cos(i^2)) for i in range(10)]
sage: s = spline(v)
sage: show(point(v) + plot(s,0,9, hue=.8))
sage: v = [(i + sin(i)/2, i+cos(i^2)) for i in range(10)] # optional - sage.symbolic
sage: s = spline(v) # optional - sage.symbolic
sage: show(point(v) + plot(s,0,9, hue=.8)) # optional - sage.symbolic

We compute the area underneath the spline::

sage: s.definite_integral(0, 9)
sage: s.definite_integral(0, 9) # optional - sage.symbolic
41.196516041067...

The definite integral is additive::

sage: s.definite_integral(0, 4) + s.definite_integral(4, 9)
sage: s.definite_integral(0, 4) + s.definite_integral(4, 9) # optional - sage.symbolic
41.196516041067...

Switching the order of the bounds changes the sign of the integral::

sage: s.definite_integral(9, 0)
sage: s.definite_integral(9, 0) # optional - sage.symbolic
-41.196516041067...

We compute the first and second-order derivatives at a few points::

sage: s.derivative(5)
sage: s.derivative(5) # optional - sage.symbolic
-0.16230085261803...
sage: s.derivative(6)
sage: s.derivative(6) # optional - sage.symbolic
0.20997986285714...
sage: s.derivative(5, order=2)
sage: s.derivative(5, order=2) # optional - sage.symbolic
-3.08747074561380...
sage: s.derivative(6, order=2)
sage: s.derivative(6, order=2) # optional - sage.symbolic
2.61876848274853...

Only the first two derivatives are supported::

sage: s.derivative(4, order=3)
sage: s.derivative(4, order=3) # optional - sage.symbolic
Traceback (most recent call last):
...
ValueError: Order of derivative must be 1 or 2.
@@ -118,7 +118,7 @@ cdef class Spline:

Replace `0`-th point, which changes the spline::

sage: S[0]=(0,1); S
sage: S[0] = (0,1); S
[(0, 1), (2, 3), (4, 5)]
sage: S(1.5)
2.5
1 change: 1 addition & 0 deletions src/sage/calculus/riemann.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - sage.symbolic
"""
Riemann Mapping

2 changes: 1 addition & 1 deletion src/sage/calculus/test_sympy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# sage.doctest: optional - sage.symbolic
r"""
A Sample Session using SymPy

1 change: 1 addition & 0 deletions src/sage/calculus/wester.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - sage.symbolic
r"""
Further examples from Wester's paper