PyPyNum 1.15.0__tar.gz → 1.15.1__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 (52) hide show
  1. {pypynum-1.15.0 → pypynum-1.15.1}/PKG-INFO +45 -54
  2. {pypynum-1.15.0 → pypynum-1.15.1}/PyPyNum.egg-info/PKG-INFO +45 -54
  3. {pypynum-1.15.0 → pypynum-1.15.1}/PyPyNum.egg-info/SOURCES.txt +1 -1
  4. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/README.md +44 -53
  5. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/__init__.py +5 -2
  6. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/dataproc.py +4 -4
  7. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/multiprec.py +34 -25
  8. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/quats.py +1 -1
  9. pypynum-1.15.0/pypynum/bessel.py → pypynum-1.15.1/pypynum/special.py +104 -1
  10. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/trees.py +0 -3
  11. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/zh_cn.py +6 -2
  12. {pypynum-1.15.0 → pypynum-1.15.1}/setup.py +5 -2
  13. {pypynum-1.15.0 → pypynum-1.15.1}/PyPyNum.egg-info/dependency_links.txt +0 -0
  14. {pypynum-1.15.0 → pypynum-1.15.1}/PyPyNum.egg-info/top_level.txt +0 -0
  15. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/PyPyNum.png +0 -0
  16. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/arrays.py +0 -0
  17. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/chars.py +0 -0
  18. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/ciphers.py +0 -0
  19. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/consts.py +0 -0
  20. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/crandom.py +0 -0
  21. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/dists.py +0 -0
  22. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/equations.py +0 -0
  23. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/fft.py +0 -0
  24. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/files.py +0 -0
  25. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/geoms.py +0 -0
  26. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/graphs.py +0 -0
  27. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/groups.py +0 -0
  28. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/images.py +0 -0
  29. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/interp.py +0 -0
  30. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/kernels.py +0 -0
  31. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/logics.py +0 -0
  32. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/maths.py +0 -0
  33. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/matrices.py +0 -0
  34. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/networks.py +0 -0
  35. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/numbers.py +0 -0
  36. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/plotting.py +0 -0
  37. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/polys.py +0 -0
  38. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/pprinters.py +0 -0
  39. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/random.py +0 -0
  40. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/regs.py +0 -0
  41. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/seqs.py +0 -0
  42. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/stattest.py +0 -0
  43. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/symbols.py +0 -0
  44. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/tensors.py +0 -0
  45. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/test.py +0 -0
  46. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/this.py +0 -0
  47. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/tools.py +0 -0
  48. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/types.py +0 -0
  49. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/ufuncs.py +0 -0
  50. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/utils.py +0 -0
  51. {pypynum-1.15.0 → pypynum-1.15.1}/pypynum/vectors.py +0 -0
  52. {pypynum-1.15.0 → pypynum-1.15.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPyNum
3
- Version: 1.15.0
3
+ Version: 1.15.1
4
4
  Summary: PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, with data structures like matrices, vectors, tensors. It offers numerical tools, programs, and supports computational ops, functions, processing, simulation, & visualization in data science & ML, crucial for research, engineering, & data processing.
5
5
  Home-page: https://github.com/PythonSJL/PyPyNum
6
6
  Author: Shen Jiayi
@@ -234,7 +234,7 @@ processing.</font><font color = red>[Python>=3.4]</font>
234
234
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
235
235
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
236
236
 
237
- ## Version -> 1.15.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
237
+ ## Version -> 1.15.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
238
238
 
239
239
  ![LOGO](PyPyNum.png)
240
240
 
@@ -252,7 +252,6 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
252
252
  | Submodule Name | Function Introduction |
253
253
  |:-------------------:|:------------------------------------------------------------------:|
254
254
  | `pypynum.arrays` | Provides operations and calculations for multi-dimensional arrays. |
255
- | `pypynum.bessel` | Implements calculations for Bessel functions. |
256
255
  | `pypynum.chars` | Contains a variety of special mathematical characters. |
257
256
  | `pypynum.ciphers` | Implements various encryption and decryption algorithms. |
258
257
  | `pypynum.consts` | Contains mathematical and physical constants. |
@@ -281,6 +280,7 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
281
280
  | `pypynum.random` | Generates arrays of random numbers. |
282
281
  | `pypynum.regs` | Regression analysis and model fitting. |
283
282
  | `pypynum.seqs` | Computes various mathematical sequences. |
283
+ | `pypynum.special` | Provides advanced special functions for mathematical computations. |
284
284
  | `pypynum.stattest` | Statistical tests and data analysis. |
285
285
  | `pypynum.symbols` | Symbolic computation and expression manipulation. |
286
286
  | `pypynum.tensors` | Tensor operations and calculations. |
@@ -327,55 +327,41 @@ Python interpreter and run it!
327
327
  ```
328
328
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
329
329
 
330
- Renamed most of the submodules,
331
- please refer to the
332
- "Name and Function Introduction of Submodules"
330
+ Fixed most of the known issues,
333
331
 
332
+ especially modified the stopping
334
333
 
335
- MultiTreeNode renamed as MTNode
334
+ conditions for multi precision
336
335
 
336
+ computation iterations.
337
337
 
338
- Fixed all known issues in trees and graphs,
339
- and added some new features.
338
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
339
+
340
+ The printout in
341
+
342
+ "trees.BinaryTree.count_nodes()"
343
+
344
+ was deleted, which is the trace
345
+
346
+ left by previous debugging.
340
347
 
341
348
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
342
349
 
343
- <<< Newly added functions and classes >>>
350
+ Rename the "Bessel" submodule to
344
351
 
345
- PyPyNum
346
- ├── kernels
347
- │ └── FUNCTION
348
- │ ├── det2x2kernel(a: typing.Union[list, tuple]) -> float
349
- │ ├── det3x3kernel(a: typing.Union[list, tuple]) -> float
350
- │ ├── det4x4kernel(a: typing.Union[list, tuple]) -> float
351
- │ ├── eigen2x2kernel(a: typing.Union[list, tuple]) -> tuple
352
- │ ├── inv2x2kernel(a: typing.Union[list, tuple]) -> list
353
- │ ├── inv3x3kernel(a: typing.Union[list, tuple]) -> list
354
- │ ├── inv4x4kernel(a: typing.Union[list, tuple]) -> list
355
- │ ├── lu2x2kernel(a: typing.Union[list, tuple]) -> tuple
356
- │ ├── lu3x3kernel(a: typing.Union[list, tuple]) -> tuple
357
- │ ├── lu4x4kernel(a: typing.Union[list, tuple]) -> tuple
358
- │ ├── matexp2x2kernel(a: typing.Union[list, tuple]) -> list
359
- │ ├── matmul2x2kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
360
- │ ├── matmul3x3kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
361
- │ ├── matmul4x4kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
362
- │ └── matpow2x2kernel(a: typing.Union[list, tuple], n: typing.Union[int, float, complex]) -> list
363
- ├── seqs
364
- │ └── FUNCTION
365
- │ ├── lucas(n: int, single: bool) -> typing.Union[int, list]
366
- │ ├── pell(n: int, single: bool) -> typing.Union[int, list]
367
- │ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
368
- │ └── tribonacci(n: int, single: bool) -> typing.Union[int, list]
369
- ├── tools
370
- │ └── FUNCTION
371
- │ ├── fast_pow(a: typing.Any, n: int, init: typing.Any, mul: typing.Callable) -> typing.Any
372
- ├── trees
373
- │ ├── CLASS
374
- │ │ ├── BTNode(object)/__init__(self: Any, data: Any) -> Any
375
- │ │ ├── BinaryTree(object)/__init__(self: Any, root: Any) -> Any
376
- │ │ ├── RBTNode(object)/__init__(self: Any, data: Any, color: Any) -> Any
377
- │ │ └── RedBlackTree(object)/__init__(self: Any) -> Any
352
+ "Special" and add some
353
+
354
+ hypergeometric functions in the
355
+
356
+ form of "hyp * f *".
357
+
358
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
359
+
360
+ 在“zh_cn”子模块中,把“多精度欧拉数”
361
+
362
+ 改名为“多精度自然常数”,并且增加了
378
363
 
364
+ “多精度欧拉伽马”。
379
365
 
380
366
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
381
367
  ```
@@ -422,15 +408,6 @@ PyPyNum
422
408
  │ ├── ones_like(a: Any, rtype: Any) -> Any
423
409
  │ ├── zeros(shape: Any, rtype: Any) -> Any
424
410
  │ └── zeros_like(a: Any, rtype: Any) -> Any
425
- ├── bessel
426
- │ ├── CLASS
427
- │ └── FUNCTION
428
- │ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
429
- │ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
430
- │ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
431
- │ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
432
- │ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
433
- │ └── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
434
411
  ├── chars
435
412
  │ ├── CLASS
436
413
  │ └── FUNCTION
@@ -774,7 +751,7 @@ PyPyNum
774
751
  │ │ ├── Euler(object)/__init__(self: Any, y: typing.Union[int, float], p: typing.Union[int, float], r: typing.Union[int, float]) -> Any
775
752
  │ │ └── Quaternion(object)/__init__(self: Any, w: typing.Union[int, float], x: typing.Union[int, float], y: typing.Union[int, float], z: typing.Union[int, float]) -> Any
776
753
  │ └── FUNCTION
777
- │ ├── change(data: typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler], to: str) -> typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler]
754
+ │ ├── convert(data: typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler], to: str) -> typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler]
778
755
  │ ├── euler(yaw: typing.Union[int, float], pitch: typing.Union[int, float], roll: typing.Union[int, float]) -> pypynum.quats.Euler
779
756
  │ └── quat(w: typing.Union[int, float], x: typing.Union[int, float], y: typing.Union[int, float], z: typing.Union[int, float]) -> pypynum.quats.Quaternion
780
757
  ├── random
@@ -811,6 +788,19 @@ PyPyNum
811
788
  │ ├── stirling2(n: int) -> list
812
789
  │ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
813
790
  │ └── tribonacci(n: int, single: bool) -> typing.Union[int, list]
791
+ ├── special
792
+ │ ├── CLASS
793
+ │ └── FUNCTION
794
+ │ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
795
+ │ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
796
+ │ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
797
+ │ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
798
+ │ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
799
+ │ ├── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
800
+ │ ├── hyp0f1(b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
801
+ │ ├── hyp1f1(a0: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
802
+ │ ├── hyp2f1(a0: typing.Union[int, float, complex], a1: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
803
+ │ └── hyppfq(a: typing.Union[list, tuple], b: typing.Union[list, tuple], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
814
804
  ├── stattest
815
805
  │ ├── CLASS
816
806
  │ └── FUNCTION
@@ -970,9 +960,10 @@ PyPyNum
970
960
  ├── 多精度复数(实部: typing.Union[int, float, str, decimal.Decimal], 虚部: typing.Union[int, float, str, decimal.Decimal], 有效位数: int) -> pypynum.multiprec.MPComplex
971
961
  ├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
972
962
  ├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
973
- ├── 多精度欧拉数(有效位数: int, 方法: str) -> decimal.Decimal
963
+ ├── 多精度欧拉伽马(有效位数: int) -> decimal.Decimal
974
964
  ├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
975
965
  ├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
966
+ ├── 多精度自然常数(有效位数: int, 方法: str) -> decimal.Decimal
976
967
  ├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
977
968
  ├── 多精度菲涅耳余弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
978
969
  ├── 多精度菲涅耳正弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyPyNum
3
- Version: 1.15.0
3
+ Version: 1.15.1
4
4
  Summary: PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, with data structures like matrices, vectors, tensors. It offers numerical tools, programs, and supports computational ops, functions, processing, simulation, & visualization in data science & ML, crucial for research, engineering, & data processing.
5
5
  Home-page: https://github.com/PythonSJL/PyPyNum
6
6
  Author: Shen Jiayi
@@ -234,7 +234,7 @@ processing.</font><font color = red>[Python>=3.4]</font>
234
234
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
235
235
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
236
236
 
237
- ## Version -> 1.15.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
237
+ ## Version -> 1.15.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
238
238
 
239
239
  ![LOGO](PyPyNum.png)
240
240
 
@@ -252,7 +252,6 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
252
252
  | Submodule Name | Function Introduction |
253
253
  |:-------------------:|:------------------------------------------------------------------:|
254
254
  | `pypynum.arrays` | Provides operations and calculations for multi-dimensional arrays. |
255
- | `pypynum.bessel` | Implements calculations for Bessel functions. |
256
255
  | `pypynum.chars` | Contains a variety of special mathematical characters. |
257
256
  | `pypynum.ciphers` | Implements various encryption and decryption algorithms. |
258
257
  | `pypynum.consts` | Contains mathematical and physical constants. |
@@ -281,6 +280,7 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
281
280
  | `pypynum.random` | Generates arrays of random numbers. |
282
281
  | `pypynum.regs` | Regression analysis and model fitting. |
283
282
  | `pypynum.seqs` | Computes various mathematical sequences. |
283
+ | `pypynum.special` | Provides advanced special functions for mathematical computations. |
284
284
  | `pypynum.stattest` | Statistical tests and data analysis. |
285
285
  | `pypynum.symbols` | Symbolic computation and expression manipulation. |
286
286
  | `pypynum.tensors` | Tensor operations and calculations. |
@@ -327,55 +327,41 @@ Python interpreter and run it!
327
327
  ```
328
328
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
329
329
 
330
- Renamed most of the submodules,
331
- please refer to the
332
- "Name and Function Introduction of Submodules"
330
+ Fixed most of the known issues,
333
331
 
332
+ especially modified the stopping
334
333
 
335
- MultiTreeNode renamed as MTNode
334
+ conditions for multi precision
336
335
 
336
+ computation iterations.
337
337
 
338
- Fixed all known issues in trees and graphs,
339
- and added some new features.
338
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
339
+
340
+ The printout in
341
+
342
+ "trees.BinaryTree.count_nodes()"
343
+
344
+ was deleted, which is the trace
345
+
346
+ left by previous debugging.
340
347
 
341
348
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
342
349
 
343
- <<< Newly added functions and classes >>>
350
+ Rename the "Bessel" submodule to
344
351
 
345
- PyPyNum
346
- ├── kernels
347
- │ └── FUNCTION
348
- │ ├── det2x2kernel(a: typing.Union[list, tuple]) -> float
349
- │ ├── det3x3kernel(a: typing.Union[list, tuple]) -> float
350
- │ ├── det4x4kernel(a: typing.Union[list, tuple]) -> float
351
- │ ├── eigen2x2kernel(a: typing.Union[list, tuple]) -> tuple
352
- │ ├── inv2x2kernel(a: typing.Union[list, tuple]) -> list
353
- │ ├── inv3x3kernel(a: typing.Union[list, tuple]) -> list
354
- │ ├── inv4x4kernel(a: typing.Union[list, tuple]) -> list
355
- │ ├── lu2x2kernel(a: typing.Union[list, tuple]) -> tuple
356
- │ ├── lu3x3kernel(a: typing.Union[list, tuple]) -> tuple
357
- │ ├── lu4x4kernel(a: typing.Union[list, tuple]) -> tuple
358
- │ ├── matexp2x2kernel(a: typing.Union[list, tuple]) -> list
359
- │ ├── matmul2x2kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
360
- │ ├── matmul3x3kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
361
- │ ├── matmul4x4kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
362
- │ └── matpow2x2kernel(a: typing.Union[list, tuple], n: typing.Union[int, float, complex]) -> list
363
- ├── seqs
364
- │ └── FUNCTION
365
- │ ├── lucas(n: int, single: bool) -> typing.Union[int, list]
366
- │ ├── pell(n: int, single: bool) -> typing.Union[int, list]
367
- │ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
368
- │ └── tribonacci(n: int, single: bool) -> typing.Union[int, list]
369
- ├── tools
370
- │ └── FUNCTION
371
- │ ├── fast_pow(a: typing.Any, n: int, init: typing.Any, mul: typing.Callable) -> typing.Any
372
- ├── trees
373
- │ ├── CLASS
374
- │ │ ├── BTNode(object)/__init__(self: Any, data: Any) -> Any
375
- │ │ ├── BinaryTree(object)/__init__(self: Any, root: Any) -> Any
376
- │ │ ├── RBTNode(object)/__init__(self: Any, data: Any, color: Any) -> Any
377
- │ │ └── RedBlackTree(object)/__init__(self: Any) -> Any
352
+ "Special" and add some
353
+
354
+ hypergeometric functions in the
355
+
356
+ form of "hyp * f *".
357
+
358
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
359
+
360
+ 在“zh_cn”子模块中,把“多精度欧拉数”
361
+
362
+ 改名为“多精度自然常数”,并且增加了
378
363
 
364
+ “多精度欧拉伽马”。
379
365
 
380
366
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
381
367
  ```
@@ -422,15 +408,6 @@ PyPyNum
422
408
  │ ├── ones_like(a: Any, rtype: Any) -> Any
423
409
  │ ├── zeros(shape: Any, rtype: Any) -> Any
424
410
  │ └── zeros_like(a: Any, rtype: Any) -> Any
425
- ├── bessel
426
- │ ├── CLASS
427
- │ └── FUNCTION
428
- │ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
429
- │ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
430
- │ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
431
- │ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
432
- │ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
433
- │ └── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
434
411
  ├── chars
435
412
  │ ├── CLASS
436
413
  │ └── FUNCTION
@@ -774,7 +751,7 @@ PyPyNum
774
751
  │ │ ├── Euler(object)/__init__(self: Any, y: typing.Union[int, float], p: typing.Union[int, float], r: typing.Union[int, float]) -> Any
775
752
  │ │ └── Quaternion(object)/__init__(self: Any, w: typing.Union[int, float], x: typing.Union[int, float], y: typing.Union[int, float], z: typing.Union[int, float]) -> Any
776
753
  │ └── FUNCTION
777
- │ ├── change(data: typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler], to: str) -> typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler]
754
+ │ ├── convert(data: typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler], to: str) -> typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler]
778
755
  │ ├── euler(yaw: typing.Union[int, float], pitch: typing.Union[int, float], roll: typing.Union[int, float]) -> pypynum.quats.Euler
779
756
  │ └── quat(w: typing.Union[int, float], x: typing.Union[int, float], y: typing.Union[int, float], z: typing.Union[int, float]) -> pypynum.quats.Quaternion
780
757
  ├── random
@@ -811,6 +788,19 @@ PyPyNum
811
788
  │ ├── stirling2(n: int) -> list
812
789
  │ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
813
790
  │ └── tribonacci(n: int, single: bool) -> typing.Union[int, list]
791
+ ├── special
792
+ │ ├── CLASS
793
+ │ └── FUNCTION
794
+ │ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
795
+ │ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
796
+ │ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
797
+ │ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
798
+ │ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
799
+ │ ├── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
800
+ │ ├── hyp0f1(b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
801
+ │ ├── hyp1f1(a0: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
802
+ │ ├── hyp2f1(a0: typing.Union[int, float, complex], a1: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
803
+ │ └── hyppfq(a: typing.Union[list, tuple], b: typing.Union[list, tuple], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
814
804
  ├── stattest
815
805
  │ ├── CLASS
816
806
  │ └── FUNCTION
@@ -970,9 +960,10 @@ PyPyNum
970
960
  ├── 多精度复数(实部: typing.Union[int, float, str, decimal.Decimal], 虚部: typing.Union[int, float, str, decimal.Decimal], 有效位数: int) -> pypynum.multiprec.MPComplex
971
961
  ├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
972
962
  ├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
973
- ├── 多精度欧拉数(有效位数: int, 方法: str) -> decimal.Decimal
963
+ ├── 多精度欧拉伽马(有效位数: int) -> decimal.Decimal
974
964
  ├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
975
965
  ├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
966
+ ├── 多精度自然常数(有效位数: int, 方法: str) -> decimal.Decimal
976
967
  ├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
977
968
  ├── 多精度菲涅耳余弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
978
969
  ├── 多精度菲涅耳正弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
@@ -7,7 +7,6 @@ pypynum/PyPyNum.png
7
7
  pypynum/README.md
8
8
  pypynum/__init__.py
9
9
  pypynum/arrays.py
10
- pypynum/bessel.py
11
10
  pypynum/chars.py
12
11
  pypynum/ciphers.py
13
12
  pypynum/consts.py
@@ -36,6 +35,7 @@ pypynum/quats.py
36
35
  pypynum/random.py
37
36
  pypynum/regs.py
38
37
  pypynum/seqs.py
38
+ pypynum/special.py
39
39
  pypynum/stattest.py
40
40
  pypynum/symbols.py
41
41
  pypynum/tensors.py
@@ -20,7 +20,7 @@ processing.</font><font color = red>[Python>=3.4]</font>
20
20
  [![Downloads](https://static.pepy.tech/badge/pypynum/month)](https://pepy.tech/project/pypynum)
21
21
  [![Downloads](https://static.pepy.tech/badge/pypynum/week)](https://pepy.tech/project/pypynum)
22
22
 
23
- ## Version -> 1.15.0 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
23
+ ## Version -> 1.15.1 | PyPI -> https://pypi.org/project/PyPyNum/ | Gitee -> https://www.gitee.com/PythonSJL/PyPyNum | GitHub -> https://github.com/PythonSJL/PyPyNum
24
24
 
25
25
  ![LOGO](PyPyNum.png)
26
26
 
@@ -38,7 +38,6 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
38
38
  | Submodule Name | Function Introduction |
39
39
  |:-------------------:|:------------------------------------------------------------------:|
40
40
  | `pypynum.arrays` | Provides operations and calculations for multi-dimensional arrays. |
41
- | `pypynum.bessel` | Implements calculations for Bessel functions. |
42
41
  | `pypynum.chars` | Contains a variety of special mathematical characters. |
43
42
  | `pypynum.ciphers` | Implements various encryption and decryption algorithms. |
44
43
  | `pypynum.consts` | Contains mathematical and physical constants. |
@@ -67,6 +66,7 @@ The logo cannot be displayed on PyPI, it can be viewed in Gitee or GitHub.
67
66
  | `pypynum.random` | Generates arrays of random numbers. |
68
67
  | `pypynum.regs` | Regression analysis and model fitting. |
69
68
  | `pypynum.seqs` | Computes various mathematical sequences. |
69
+ | `pypynum.special` | Provides advanced special functions for mathematical computations. |
70
70
  | `pypynum.stattest` | Statistical tests and data analysis. |
71
71
  | `pypynum.symbols` | Symbolic computation and expression manipulation. |
72
72
  | `pypynum.tensors` | Tensor operations and calculations. |
@@ -113,55 +113,41 @@ Python interpreter and run it!
113
113
  ```
114
114
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
115
115
 
116
- Renamed most of the submodules,
117
- please refer to the
118
- "Name and Function Introduction of Submodules"
116
+ Fixed most of the known issues,
119
117
 
118
+ especially modified the stopping
120
119
 
121
- MultiTreeNode renamed as MTNode
120
+ conditions for multi precision
122
121
 
122
+ computation iterations.
123
123
 
124
- Fixed all known issues in trees and graphs,
125
- and added some new features.
124
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
125
+
126
+ The printout in
127
+
128
+ "trees.BinaryTree.count_nodes()"
129
+
130
+ was deleted, which is the trace
131
+
132
+ left by previous debugging.
126
133
 
127
134
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
128
135
 
129
- <<< Newly added functions and classes >>>
136
+ Rename the "Bessel" submodule to
130
137
 
131
- PyPyNum
132
- ├── kernels
133
- │ └── FUNCTION
134
- │ ├── det2x2kernel(a: typing.Union[list, tuple]) -> float
135
- │ ├── det3x3kernel(a: typing.Union[list, tuple]) -> float
136
- │ ├── det4x4kernel(a: typing.Union[list, tuple]) -> float
137
- │ ├── eigen2x2kernel(a: typing.Union[list, tuple]) -> tuple
138
- │ ├── inv2x2kernel(a: typing.Union[list, tuple]) -> list
139
- │ ├── inv3x3kernel(a: typing.Union[list, tuple]) -> list
140
- │ ├── inv4x4kernel(a: typing.Union[list, tuple]) -> list
141
- │ ├── lu2x2kernel(a: typing.Union[list, tuple]) -> tuple
142
- │ ├── lu3x3kernel(a: typing.Union[list, tuple]) -> tuple
143
- │ ├── lu4x4kernel(a: typing.Union[list, tuple]) -> tuple
144
- │ ├── matexp2x2kernel(a: typing.Union[list, tuple]) -> list
145
- │ ├── matmul2x2kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
146
- │ ├── matmul3x3kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
147
- │ ├── matmul4x4kernel(a: typing.Union[list, tuple], b: typing.Union[list, tuple]) -> list
148
- │ └── matpow2x2kernel(a: typing.Union[list, tuple], n: typing.Union[int, float, complex]) -> list
149
- ├── seqs
150
- │ └── FUNCTION
151
- │ ├── lucas(n: int, single: bool) -> typing.Union[int, list]
152
- │ ├── pell(n: int, single: bool) -> typing.Union[int, list]
153
- │ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
154
- │ └── tribonacci(n: int, single: bool) -> typing.Union[int, list]
155
- ├── tools
156
- │ └── FUNCTION
157
- │ ├── fast_pow(a: typing.Any, n: int, init: typing.Any, mul: typing.Callable) -> typing.Any
158
- ├── trees
159
- │ ├── CLASS
160
- │ │ ├── BTNode(object)/__init__(self: Any, data: Any) -> Any
161
- │ │ ├── BinaryTree(object)/__init__(self: Any, root: Any) -> Any
162
- │ │ ├── RBTNode(object)/__init__(self: Any, data: Any, color: Any) -> Any
163
- │ │ └── RedBlackTree(object)/__init__(self: Any) -> Any
138
+ "Special" and add some
139
+
140
+ hypergeometric functions in the
141
+
142
+ form of "hyp * f *".
143
+
144
+ !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
145
+
146
+ 在“zh_cn”子模块中,把“多精度欧拉数”
147
+
148
+ 改名为“多精度自然常数”,并且增加了
164
149
 
150
+ “多精度欧拉伽马”。
165
151
 
166
152
  !=!=!=!=!=!=!=!=!=!=!=!=!=!=!=!=
167
153
  ```
@@ -208,15 +194,6 @@ PyPyNum
208
194
  │ ├── ones_like(a: Any, rtype: Any) -> Any
209
195
  │ ├── zeros(shape: Any, rtype: Any) -> Any
210
196
  │ └── zeros_like(a: Any, rtype: Any) -> Any
211
- ├── bessel
212
- │ ├── CLASS
213
- │ └── FUNCTION
214
- │ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
215
- │ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
216
- │ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
217
- │ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
218
- │ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
219
- │ └── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
220
197
  ├── chars
221
198
  │ ├── CLASS
222
199
  │ └── FUNCTION
@@ -560,7 +537,7 @@ PyPyNum
560
537
  │ │ ├── Euler(object)/__init__(self: Any, y: typing.Union[int, float], p: typing.Union[int, float], r: typing.Union[int, float]) -> Any
561
538
  │ │ └── Quaternion(object)/__init__(self: Any, w: typing.Union[int, float], x: typing.Union[int, float], y: typing.Union[int, float], z: typing.Union[int, float]) -> Any
562
539
  │ └── FUNCTION
563
- │ ├── change(data: typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler], to: str) -> typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler]
540
+ │ ├── convert(data: typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler], to: str) -> typing.Union[pypynum.quats.Quaternion, pypynum.matrices.Matrix, pypynum.quats.Euler]
564
541
  │ ├── euler(yaw: typing.Union[int, float], pitch: typing.Union[int, float], roll: typing.Union[int, float]) -> pypynum.quats.Euler
565
542
  │ └── quat(w: typing.Union[int, float], x: typing.Union[int, float], y: typing.Union[int, float], z: typing.Union[int, float]) -> pypynum.quats.Quaternion
566
543
  ├── random
@@ -597,6 +574,19 @@ PyPyNum
597
574
  │ ├── stirling2(n: int) -> list
598
575
  │ ├── tetranacci(n: int, single: bool) -> typing.Union[int, list]
599
576
  │ └── tribonacci(n: int, single: bool) -> typing.Union[int, list]
577
+ ├── special
578
+ │ ├── CLASS
579
+ │ └── FUNCTION
580
+ │ ├── bessel_i0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
581
+ │ ├── bessel_i1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
582
+ │ ├── bessel_iv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
583
+ │ ├── bessel_j0(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
584
+ │ ├── bessel_j1(x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
585
+ │ ├── bessel_jv(v: typing.Union[int, float], x: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
586
+ │ ├── hyp0f1(b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
587
+ │ ├── hyp1f1(a0: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
588
+ │ ├── hyp2f1(a0: typing.Union[int, float, complex], a1: typing.Union[int, float, complex], b0: typing.Union[int, float, complex], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
589
+ │ └── hyppfq(a: typing.Union[list, tuple], b: typing.Union[list, tuple], z: typing.Union[int, float, complex]) -> typing.Union[int, float, complex]
600
590
  ├── stattest
601
591
  │ ├── CLASS
602
592
  │ └── FUNCTION
@@ -756,9 +746,10 @@ PyPyNum
756
746
  ├── 多精度复数(实部: typing.Union[int, float, str, decimal.Decimal], 虚部: typing.Union[int, float, str, decimal.Decimal], 有效位数: int) -> pypynum.multiprec.MPComplex
757
747
  ├── 多精度对数(真数: typing.Union[int, float], 底数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
758
748
  ├── 多精度方位角(y: typing.Union[int, float], x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
759
- ├── 多精度欧拉数(有效位数: int, 方法: str) -> decimal.Decimal
749
+ ├── 多精度欧拉伽马(有效位数: int) -> decimal.Decimal
760
750
  ├── 多精度正弦(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
761
751
  ├── 多精度自然对数(真数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
752
+ ├── 多精度自然常数(有效位数: int, 方法: str) -> decimal.Decimal
762
753
  ├── 多精度自然指数(指数: typing.Union[int, float], 有效位数: int, 使用内置方法: bool) -> decimal.Decimal
763
754
  ├── 多精度菲涅耳余弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
764
755
  ├── 多精度菲涅耳正弦积分(x: typing.Union[int, float], 有效位数: int) -> decimal.Decimal
@@ -30,7 +30,6 @@ __copyright__ = "Copyright (c) 2023, Shen Jiayi. All rights reserved."
30
30
  from . import consts
31
31
  from . import zh_cn
32
32
  from .arrays import *
33
- from .bessel import *
34
33
  from .chars import int2superscript, superscript2int, int2subscript, subscript2int
35
34
  from .ciphers import *
36
35
  from .crandom import *
@@ -58,6 +57,7 @@ from .quats import *
58
57
  from .random import *
59
58
  from .regs import *
60
59
  from .seqs import *
60
+ from .special import *
61
61
  from .stattest import *
62
62
  from .symbols import *
63
63
  from .tensors import *
@@ -68,6 +68,9 @@ from .ufuncs import *
68
68
  from .utils import *
69
69
  from .vectors import *
70
70
 
71
- __version__ = "1.15.0"
71
+ __version__ = "1.15.1"
72
72
  print("PyPyNum", "Version -> " + __version__, "PyPI -> https://pypi.org/project/PyPyNum/",
73
73
  "Gitee -> https://www.gitee.com/PythonSJL/PyPyNum", "GitHub -> https://github.com/PythonSJL/PyPyNum", sep=" | ")
74
+ for _ in list(globals().keys()):
75
+ if _.endswith("Error"):
76
+ del globals()[_]
@@ -7,8 +7,8 @@ class Series:
7
7
  self.data = []
8
8
  self.index = []
9
9
  else:
10
- self.data = list(data)
11
- self.index = list(index)
10
+ self.data = data
11
+ self.index = index
12
12
 
13
13
  def __repr__(self) -> str:
14
14
  def string(obj):
@@ -197,9 +197,9 @@ class Series:
197
197
 
198
198
  @staticmethod
199
199
  def __notna(value: Any) -> bool:
200
- return value is not None and isinstance(value, float) and value == value
200
+ return not Series.__isna(value)
201
201
 
202
- def cov(self, other: "Series", min_periods: int = None, dof=1) -> real:
202
+ def cov(self, other: "Series", min_periods: int = None, dof: int = 1) -> real:
203
203
  from .maths import cov
204
204
  data1 = self.__dropna(None)
205
205
  data2 = other.__dropna(None)
@@ -24,13 +24,14 @@ def mp_e(sigfigs: int = 28, method: str = "series") -> Decimal:
24
24
  one = Decimal(1)
25
25
  factorial = one
26
26
  n = 0
27
- current = one
28
- eps = Decimal(10) ** -sigfigs
29
- while current >= eps:
30
- e += current
27
+ term = one
28
+ temp = None
29
+ while e != temp:
30
+ temp = e
31
+ e += term
31
32
  n += 1
32
33
  factorial *= n
33
- current = one / factorial
34
+ term = one / factorial
34
35
  __context.prec -= 5
35
36
  return +e
36
37
 
@@ -146,8 +147,9 @@ def mp_sin(x: prec, sigfigs: int = 28) -> Decimal:
146
147
  x_squared = x * x
147
148
  term = x
148
149
  n = 0
149
- eps = Decimal(10) ** -sigfigs
150
- while abs(term) >= eps:
150
+ temp = None
151
+ while sin_x != temp:
152
+ temp = sin_x
151
153
  sin_x += term
152
154
  n += 1
153
155
  term = -term * x_squared / ((2 * n) * (2 * n + 1))
@@ -165,8 +167,9 @@ def mp_cos(x: prec, sigfigs: int = 28) -> Decimal:
165
167
  x_squared = x * x
166
168
  term = Decimal(1)
167
169
  n = 0
168
- eps = Decimal(10) ** -sigfigs
169
- while abs(term) >= eps:
170
+ temp = None
171
+ while cos_x != temp:
172
+ temp = cos_x
170
173
  cos_x += term
171
174
  n += 1
172
175
  term = -term * x_squared / ((2 * n - 1) * (2 * n))
@@ -191,8 +194,9 @@ def mp_ln(x: prec, sigfigs: int = 28, builtin: bool = True) -> Decimal:
191
194
  term = Decimal(1)
192
195
  dx = 1 - x
193
196
  k = 1
194
- eps = Decimal(10) ** -sigfigs
195
- while abs(term) >= eps:
197
+ temp = None
198
+ while ln_x != temp:
199
+ temp = ln_x
196
200
  term *= dx
197
201
  ln_x += term / k
198
202
  k += 1
@@ -242,8 +246,9 @@ def mp_atan(x: prec, sigfigs: int = 28) -> Decimal:
242
246
  term = power = x
243
247
  n = 1
244
248
  constant = -x * x
245
- eps = Decimal(10) ** -sigfigs
246
- while abs(term) >= eps:
249
+ temp = None
250
+ while atan_x != temp:
251
+ temp = atan_x
247
252
  atan_x += term
248
253
  power *= constant
249
254
  n += 2
@@ -283,8 +288,9 @@ def mp_exp(x: prec, sigfigs: int = 28, builtin: bool = True) -> Decimal:
283
288
  sigfigs += 5
284
289
  __context.prec = sigfigs
285
290
  n = term = exp_x = Decimal(1)
286
- eps = Decimal(10) ** -sigfigs
287
- while abs(term) >= eps:
291
+ temp = None
292
+ while exp_x != temp:
293
+ temp = exp_x
288
294
  term *= x / n
289
295
  exp_x += term
290
296
  n += 1
@@ -320,9 +326,10 @@ def mp_asin(x: prec, sigfigs: int = 28) -> Decimal:
320
326
  asin_x = Decimal(0)
321
327
  x_squared = x * x
322
328
  numerator = x
323
- denominator = term = 1
324
- eps = Decimal(10) ** -sigfigs
325
- while abs(term) >= eps:
329
+ denominator = 1
330
+ temp = None
331
+ while asin_x != temp:
332
+ temp = asin_x
326
333
  term = numerator / denominator
327
334
  asin_x += term
328
335
  denominator += 2
@@ -357,8 +364,9 @@ def mp_fresnel_s(x: prec, sigfigs: int = 28) -> Decimal:
357
364
  fact = 1
358
365
  term = num / coeff
359
366
  n = 0
360
- eps = Decimal(10) ** -sigfigs
361
- while abs(term) >= eps:
367
+ temp = None
368
+ while s_x != temp:
369
+ temp = s_x
362
370
  s_x += term
363
371
  n += 1
364
372
  num *= f
@@ -382,8 +390,9 @@ def mp_fresnel_c(x: prec, sigfigs: int = 28) -> Decimal:
382
390
  k = 0
383
391
  term = num / fact_2k
384
392
  n = 0
385
- eps = Decimal(10) ** -sigfigs
386
- while abs(term) >= eps:
393
+ temp = None
394
+ while c_x != temp:
395
+ temp = c_x
387
396
  c_x += term
388
397
  n += 1
389
398
  num *= f
@@ -405,9 +414,9 @@ def mp_euler_gamma(sigfigs: int = 28) -> Decimal:
405
414
  n_power_k = n
406
415
  fact_k = Decimal(1)
407
416
  harmonic_sum = Decimal(0)
408
- term = Decimal(1)
409
- eps = Decimal(10) ** -sigfigs
410
- while abs(term) >= eps:
417
+ temp = None
418
+ while i_n != temp:
419
+ temp = i_n
411
420
  term = (n_power_k / fact_k) ** 2
412
421
  i_n += term * harmonic_sum
413
422
  j_n += term
@@ -131,7 +131,7 @@ def euler(yaw: real = 0, pitch: real = 0, roll: real = 0) -> Euler:
131
131
  return Euler(yaw, pitch, roll)
132
132
 
133
133
 
134
- def change(data: Union[Quaternion, Matrix, Euler], to: str) -> Union[Quaternion, Matrix, Euler]:
134
+ def convert(data: Union[Quaternion, Matrix, Euler], to: str) -> Union[Quaternion, Matrix, Euler]:
135
135
  if to not in ["Q", "M", "E"]:
136
136
  raise ValueError("The parameter 'to' can only be 'Q', 'M', or 'E'")
137
137
  elif isinstance(data, Euler):
@@ -1,5 +1,5 @@
1
1
  import math
2
- from .types import num, real
2
+ from .types import arr, num, real
3
3
 
4
4
 
5
5
  def bessel_j0(x: num) -> num:
@@ -171,3 +171,106 @@ def bessel_iv(v: real, x: num) -> num:
171
171
  pass
172
172
  k += 1
173
173
  return result
174
+
175
+
176
+ def hyppfq(a: arr, b: arr, z: num) -> num:
177
+ """
178
+ Introduction
179
+ ==========
180
+ Calculate the generalized hypergeometric function pFq(a; b; z),
181
+ which is a generalization of many named special functions.
182
+
183
+ Example
184
+ ==========
185
+ >>> hyppfq([1, 2], [3], 0.5)
186
+ 1.545177444479562
187
+ >>>
188
+ :param a: List of numerator parameters of the hypergeometric function.
189
+ :param b: List of denominator parameters of the hypergeometric function.
190
+ :param z: The argument of the hypergeometric function.
191
+ :return: The value of the hypergeometric function pFq(a; b; z).
192
+ """
193
+ p = len(a)
194
+ q = len(b)
195
+ result = 0
196
+ numerator = [1] * p
197
+ denominator = [1] * q
198
+ z_power = 1
199
+ factorial = 1
200
+ n = 0
201
+ while True:
202
+ term = 1
203
+ for i in range(p):
204
+ term *= numerator[i]
205
+ for j in range(q):
206
+ term /= denominator[j]
207
+ term *= z_power / factorial
208
+ previous = result
209
+ result += term
210
+ if previous == result:
211
+ break
212
+ for i in range(p):
213
+ numerator[i] *= (a[i] + n)
214
+ for j in range(q):
215
+ denominator[j] *= (b[j] + n)
216
+ z_power *= z
217
+ n += 1
218
+ factorial *= n
219
+ return result
220
+
221
+
222
+ def hyp0f1(b0: num, z: num) -> num:
223
+ """
224
+ Introduction
225
+ ==========
226
+ Calculate the hypergeometric function 0F1, which is a special case of the generalized hypergeometric function.
227
+
228
+ Example
229
+ ==========
230
+ >>> hyp0f1(1, 0.5)
231
+ 1.5660829297563503
232
+ >>>
233
+ :param b0: The single parameter of the hypergeometric function.
234
+ :param z: The argument of the hypergeometric function.
235
+ :return: The value of the hypergeometric function 0F1(b0; z).
236
+ """
237
+ return hyppfq([], [b0], z)
238
+
239
+
240
+ def hyp1f1(a0: num, b0: num, z: num) -> num:
241
+ """
242
+ Introduction
243
+ ==========
244
+ Calculate the hypergeometric function 1F1, also known as the confluent hypergeometric function of the first kind.
245
+
246
+ Example
247
+ ==========
248
+ >>> hyp1f1(1, 1, 1)
249
+ 2.7182818284590455
250
+ >>>
251
+ :param a0: The single numerator parameter of the hypergeometric function.
252
+ :param b0: The single denominator parameter of the hypergeometric function.
253
+ :param z: The argument of the hypergeometric function.
254
+ :return: The value of the hypergeometric function 1F1(a0; b0; z).
255
+ """
256
+ return hyppfq([a0], [b0], z)
257
+
258
+
259
+ def hyp2f1(a0: num, a1: num, b0: num, z: num) -> num:
260
+ """
261
+ Introduction
262
+ ==========
263
+ Calculate the hypergeometric function 2F1, which is a common form of the generalized hypergeometric function.
264
+
265
+ Example
266
+ ==========
267
+ >>> hyp2f1(1, 1, 1, 0.5)
268
+ 2.0
269
+ >>>
270
+ :param a0: The first numerator parameter of the hypergeometric function.
271
+ :param a1: The second numerator parameter of the hypergeometric function.
272
+ :param b0: The single denominator parameter of the hypergeometric function.
273
+ :param z: The argument of the hypergeometric function.
274
+ :return: The value of the hypergeometric function 2F1(a0, a1; b0; z).
275
+ """
276
+ return hyppfq([a0, a1], [b0], z)
@@ -906,11 +906,8 @@ class BinaryTree:
906
906
  def count_helper(node):
907
907
  if node is None:
908
908
  return 0
909
- print(f"Counting nodes for node {node.data}")
910
909
  left_count = count_helper(node.left)
911
- print(f"Node {node.data} has {left_count} nodes in left subtree")
912
910
  right_count = count_helper(node.right)
913
- print(f"Node {node.data} has {right_count} nodes in right subtree")
914
911
  return 1 + left_count + right_count
915
912
 
916
913
  return count_helper(self.root)
@@ -1,5 +1,4 @@
1
1
  from pypynum.arrays import *
2
- from pypynum.bessel import *
3
2
  from pypynum.chars import int2superscript, superscript2int, int2subscript, subscript2int
4
3
  from pypynum.ciphers import *
5
4
  from pypynum.equations import *
@@ -8,6 +7,7 @@ from pypynum.fft import *
8
7
  from pypynum.maths import *
9
8
  from pypynum.multiprec import *
10
9
  from pypynum.numbers import *
10
+ from pypynum.special import *
11
11
  from pypynum.types import Any, Callable, Dict, Iterator, List, Tuple
12
12
 
13
13
 
@@ -139,7 +139,7 @@ def Fraction转为Decimal(分数对象: Fraction, 有效位数: int) -> Decimal:
139
139
  return frac2dec(分数对象, 有效位数)
140
140
 
141
141
 
142
- def 多精度欧拉数(有效位数: int, 方法: str = "series") -> Decimal:
142
+ def 多精度自然常数(有效位数: int, 方法: str = "series") -> Decimal:
143
143
  return mp_e(有效位数, 方法)
144
144
 
145
145
 
@@ -203,6 +203,10 @@ def 多精度菲涅耳余弦积分(x: real, 有效位数: int) -> Decimal:
203
203
  return mp_fresnel_c(x, 有效位数)
204
204
 
205
205
 
206
+ def 多精度欧拉伽马(有效位数: int) -> Decimal:
207
+ return mp_euler_gamma(有效位数)
208
+
209
+
206
210
  def 多精度复数(实部: prec, 虚部: prec, 有效位数: int = 28) -> MPComplex:
207
211
  return MPComplex(实部, 虚部, 有效位数)
208
212
 
@@ -220,13 +220,16 @@ LICENSE = """
220
220
 
221
221
  setup(
222
222
  name="PyPyNum",
223
- version="1.15.0",
223
+ version="1.15.1",
224
224
  packages=find_packages(),
225
225
  url="https://github.com/PythonSJL/PyPyNum",
226
226
  license=LICENSE,
227
227
  author="Shen Jiayi",
228
228
  author_email="2261748025@qq.com",
229
- description="PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, with data structures like matrices, vectors, tensors. It offers numerical tools, programs, and supports computational ops, functions, processing, simulation, & visualization in data science & ML, crucial for research, engineering, & data processing.",
229
+ description="PyPyNum is a Python library for math & science computations, covering algebra, calculus, stats, "
230
+ "with data structures like matrices, vectors, tensors. It offers numerical tools, programs, "
231
+ "and supports computational ops, functions, processing, simulation, & visualization in data science & "
232
+ "ML, crucial for research, engineering, & data processing.",
230
233
  python_requires=">=3.4",
231
234
  package_data={"pypynum": ["*"]},
232
235
  long_description=md,
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
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