RKkit 0.1.7__tar.gz → 0.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. {rkkit-0.1.7 → rkkit-0.1.8}/.gitignore +1 -0
  2. {rkkit-0.1.7 → rkkit-0.1.8}/PKG-INFO +8 -2
  3. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/AllProperties.py +6 -1
  4. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/Example.py +6 -19
  5. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/Gaussian.py +12 -3
  6. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/GoodAndBad.py +7 -2
  7. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/RadauByCollocation.py +5 -1
  8. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/Tchebychev.py +11 -2
  9. {rkkit-0.1.7 → rkkit-0.1.8}/PythonExamples/Test.py +5 -1
  10. {rkkit-0.1.7 → rkkit-0.1.8}/README.md +7 -1
  11. {rkkit-0.1.7 → rkkit-0.1.8}/pyproject.toml +1 -1
  12. {rkkit-0.1.7 → rkkit-0.1.8}/tests/test.py +5 -1
  13. {rkkit-0.1.7 → rkkit-0.1.8}/AUTHORS +0 -0
  14. {rkkit-0.1.7 → rkkit-0.1.8}/LICENSE +0 -0
  15. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/AllProperties.ipynb +0 -0
  16. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/Example.ipynb +0 -0
  17. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/Gaussian.ipynb +0 -0
  18. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/GoodAndBad.ipynb +0 -0
  19. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/RadauByCollocation.ipynb +0 -0
  20. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/Tchebychev.ipynb +0 -0
  21. {rkkit-0.1.7 → rkkit-0.1.8}/Notebooks/Test.ipynb +0 -0
  22. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/README.md +0 -0
  23. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKExceptions.py +0 -0
  24. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKPolutilities.py +0 -0
  25. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKRungeKutta.py +0 -0
  26. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKTrees.py +0 -0
  27. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKcolloc.py +0 -0
  28. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKformula.py +0 -0
  29. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/RKplot.py +0 -0
  30. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/__init__.py +0 -0
  31. {rkkit-0.1.7 → rkkit-0.1.8}/RKkit/formulas.py +0 -0
  32. {rkkit-0.1.7 → rkkit-0.1.8}/TODO.md +0 -0
  33. {rkkit-0.1.7 → rkkit-0.1.8}/_doctest_environment.py +0 -0
  34. {rkkit-0.1.7 → rkkit-0.1.8}/tox.ini +0 -0
@@ -19,3 +19,4 @@ RKkit.egg-info
19
19
  dist
20
20
  .pytest_cache
21
21
  .tox
22
+ *.png
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: RKkit
3
- Version: 0.1.7
3
+ Version: 0.1.8
4
4
  Summary: Playing with Runge-Kutta methods
5
5
  Project-URL: Homepage, https://github.com/Thierry-Dumont/RKkit
6
6
  Project-URL: Issues, https://github.com/Thierry-Dumont/RKkit/issues
@@ -154,7 +154,7 @@ and then, launch the notebook _Exemple1.ipynb_from Notebooks.
154
154
 
155
155
  ## Gaussian formulas (and other methods obtained by collocation) ##
156
156
 
157
- Gausian formulae with n steps are obtained by collocation at the roots of the Legendre P polynomials of degree n, shifted from [-1,1] to [0,1].
157
+ Gaussian formulae with n steps are obtained by collocation at the roots of the Legendre P polynomials of degree n, shifted from [-1,1] to [0,1].
158
158
 
159
159
  RKcolloc.colloc computes the Butcher arrays, given collocation points
160
160
  in [0,1] and returns a Runge-Kutta method class (note that
@@ -202,3 +202,9 @@ if you use passagemath, you can install jupyter in the virtualenv:
202
202
  A precedent version was using Sage's
203
203
  [@lazy_attribute](http://doc.sagemath.org/html/en/reference/misc/sage/misc/lazy_attribute.html)
204
204
  decorator, which could be disturbing.
205
+
206
+ #### Note about graphics: ####
207
+
208
+ When using the code with passagemath/ipython, graphics -if any- cannot
209
+ be displayed. But in any case (using sage ou passagemath/sage) they
210
+ can be saved in png files (see for example PythonExamples/Gaussian.py).
@@ -8,7 +8,12 @@
8
8
  # Let us, for axample compute "all" the properties of a Gauss formula.
9
9
 
10
10
  #
11
- import passagemath_flint
11
+ try:
12
+ import passagemath_flint
13
+ print("Using passagemath")
14
+ except:
15
+ print("Not using passagemath")
16
+ #
12
17
  from sage.functions.orthogonal_polys import legendre_P
13
18
  from sage.rings.qqbar import *
14
19
  #
@@ -2,7 +2,12 @@
2
2
  # coding: utf-8
3
3
 
4
4
  # # Playing with Runge-Kutta methods ##
5
- import passagemath_flint
5
+ try:
6
+ import passagemath_flint
7
+ print("Using passagemath")
8
+ except:
9
+ print("Not using passagemath")
10
+ #
6
11
  #
7
12
  from RKkit import *
8
13
  # Let us import somme predefined Runge-Kutta method descriptions:
@@ -70,25 +75,7 @@ print(F.order())
70
75
  print(F.is_Symplectic())
71
76
 
72
77
 
73
- # Now, let us plot the stability domain:
74
-
75
- # In[17]:
76
-
77
-
78
- #@interact
79
- def P(WindowSize=(0.1,10,0.5),Translate=(-50,50,5)):
80
- RKplot(F,fill=True,ncurves=2,Enlarge=WindowSize,TranslateX=Translate).show()
81
-
82
-
83
- # We can also plot the orde star (slow):
84
-
85
-
86
- #@interact
87
- def PStar(WindowSize=(0.01,10,0.5),Translate=(-50,50,5)):
88
- RKplot(F,fill=True,ncurves=1,type="star",Enlarge=WindowSize,TranslateX=Translate).show()
89
-
90
78
 
91
- # In[ ]:
92
79
 
93
80
 
94
81
 
@@ -3,7 +3,12 @@
3
3
 
4
4
  # ### Gaussian formulae ###
5
5
  #
6
- import passagemath_flint
6
+ try:
7
+ import passagemath_flint
8
+ print("Using passagemath")
9
+ except:
10
+ print("Not using passagemath")
11
+ #
7
12
  from sage.rings.qqbar import *
8
13
  from sage.functions.orthogonal_polys import legendre_P
9
14
  from RKkit import *
@@ -40,7 +45,11 @@ for n in range(2,4):
40
45
  print("conserve quadratic invariants?",F.conserve_quadratic_invariants())
41
46
  print("symplectic ?",F.is_Symplectic())
42
47
  p=RKplot(F,fill=True,ncurves=2,Enlarge=1)
43
- p.show()
44
48
  q=RKplot(F,fill=True,ncurves=2,type="star",Enlarge=1)
49
+ p.show()
45
50
  q.show()
46
-
51
+ pfile=f"{G.Title}.stability.png"
52
+ p.save(pfile)
53
+ qfile=f"{G.Title}.starfuntion.png"
54
+ q.save(qfile)
55
+ print(f"Graphics are saved in {pfile} and {qfile}")
@@ -1,11 +1,16 @@
1
1
  #!/usr/bin/env python
2
2
  # coding: utf-8
3
3
 
4
- # ## This small notebook illustrates how to create a Runge-Kutta method.
4
+ # ## Illustrates how to create a Runge-Kutta method.
5
5
  #
6
6
  # Remember that we must use exact sets of number, namely (real) algebraic nubers (AA or QQbar) or rationals (QQ) when defining Runge-Kutta methods.
7
7
 
8
- import passagemath_flint
8
+ try:
9
+ import passagemath_flint
10
+ print("Using passagemath")
11
+ except:
12
+ print("Not using passagemath")
13
+
9
14
  from sage.rings.qqbar import *
10
15
  #
11
16
  from RKkit import *
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env python
2
2
  #
3
- import passagemath_flint
3
+ try:
4
+ import passagemath_flint
5
+ print("Using passagemath")
6
+ except:
7
+ print("Not using passagemath")
4
8
  #
5
9
  from RKkit import *
6
10
  from RKkit.formulas import *
@@ -7,7 +7,12 @@
7
7
  # Here we use Tchemychev polynomials.
8
8
  # The formulas does not present any interesting application !
9
9
 
10
- import passagemath_flint
10
+ try:
11
+ import passagemath_flint
12
+ print("Using passagemath")
13
+ except:
14
+ print("Not using passagemath")
15
+
11
16
  from sage.functions.orthogonal_polys import chebyshev_T
12
17
  #
13
18
 
@@ -40,9 +45,13 @@ for n in range(3,5):
40
45
  print("algebraically stable?",F.is_algebraically_stable())
41
46
  print("conserve quadratic invariants?",F.conserve_quadratic_invariants())
42
47
  p=RKplot(F,fill=True,ncurves=2,Enlarge=1)
48
+ pfile=f"{G.Title}.stability.png"
43
49
  p.show()
50
+ p.save(pfile)
44
51
  q=RKplot(F,fill=True,ncurves=2,type="star",Enlarge=1)
45
52
  q.show()
46
-
53
+ qfile=f"{G.Title}.starfuntion.png"
54
+ q.save(qfile)
55
+ print(f"Graphics are saved in {pfile} and {qfile}")
47
56
 
48
57
 
@@ -2,7 +2,11 @@
2
2
  # coding: utf-8
3
3
 
4
4
  # ## Test: can we compute all properties for all coded formulas? ##
5
- import passagemath_flint
5
+ try:
6
+ import passagemath_flint
7
+ print("Using passagemath")
8
+ except:
9
+ print("Not using passagemath")
6
10
  from sage.rings.qqbar import *
7
11
  import sage.rings.qqbar
8
12
  #
@@ -132,7 +132,7 @@ and then, launch the notebook _Exemple1.ipynb_from Notebooks.
132
132
 
133
133
  ## Gaussian formulas (and other methods obtained by collocation) ##
134
134
 
135
- Gausian formulae with n steps are obtained by collocation at the roots of the Legendre P polynomials of degree n, shifted from [-1,1] to [0,1].
135
+ Gaussian formulae with n steps are obtained by collocation at the roots of the Legendre P polynomials of degree n, shifted from [-1,1] to [0,1].
136
136
 
137
137
  RKcolloc.colloc computes the Butcher arrays, given collocation points
138
138
  in [0,1] and returns a Runge-Kutta method class (note that
@@ -180,3 +180,9 @@ if you use passagemath, you can install jupyter in the virtualenv:
180
180
  A precedent version was using Sage's
181
181
  [@lazy_attribute](http://doc.sagemath.org/html/en/reference/misc/sage/misc/lazy_attribute.html)
182
182
  decorator, which could be disturbing.
183
+
184
+ #### Note about graphics: ####
185
+
186
+ When using the code with passagemath/ipython, graphics -if any- cannot
187
+ be displayed. But in any case (using sage ou passagemath/sage) they
188
+ can be saved in png files (see for example PythonExamples/Gaussian.py).
@@ -3,7 +3,7 @@ requires = ["hatchling >= 1.26"]
3
3
  build-backend = "hatchling.build"
4
4
  [project]
5
5
  name='RKkit'
6
- version='0.1.7'
6
+ version='0.1.8'
7
7
  authors = [
8
8
  { name="Thierry Dumont", email="tdumont@math.cnrs.fr" },
9
9
  ]
@@ -1,6 +1,10 @@
1
1
  #
2
2
  import pytest
3
- import passagemath_flint
3
+ try:
4
+ import passagemath_flint
5
+ except:
6
+ pass
7
+
4
8
  from sage.rings.qqbar import *
5
9
  import sage.rings.qqbar
6
10
  #
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes