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

Integrate multivariate case based on PCP #21

Draft
wants to merge 103 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
ebd0905
Add 'multinomial_multiindex_coefficients' and tests.
nennigb Nov 18, 2020
403f1fc
First running example with mv.
nennigb Nov 18, 2020
2a4bc75
Add mv simple examples.
nennigb Nov 18, 2020
ddd4318
Add sympy validation with (mu, nu) derivation.
nennigb Nov 19, 2020
667ab03
Add sympy dependency to `setup.py`.
nennigb Nov 20, 2020
716d1e2
Add `diffprod` and `diffprodTree` to derive funct.
nennigb Nov 20, 2020
de0c50e
Add derivative of product of multivariate function.
nennigb Nov 20, 2020
33a80f9
Update `diffprodTree` to handle multivariate case.
nennigb Nov 20, 2020
0c87708
Work in progress on charpol.
nennigb Nov 23, 2020
bd1ea4a
Add EP_system and Jacobian for numerical EP location.
nennigb Dec 1, 2020
1b0b905
Fix possible colinear vector v in `getDerivativeMV`.
nennigb Dec 2, 2020
b877c67
Update base example for mv.
nennigb Dec 2, 2020
dc59801
Add waveguide example with 2 admittances to find EP3.
nennigb Dec 2, 2020
a17ab0d
UPdate CharPol with fortran `polyvalnd`.
nennigb Dec 3, 2020
537bbb3
Fix relative/absolute nu in sympy checks.
nennigb Dec 4, 2020
80ec00f
Speed up jacobian evaluation.
nennigb Dec 4, 2020
20b7d1a
Split `jacobian` method for speed.
nennigb Dec 4, 2020
aca891f
Add discriminant computations.
nennigb Dec 8, 2020
016ead2
Add `disc_EP_system` strategy for EP location.
nennigb Dec 10, 2020
f9f245d
work in progress on convergence
nennigb Dec 18, 2020
a112943
Few clean up in `CharPol` API.
nennigb Feb 22, 2021
a15c1e2
Update `getDerivativesMV` with iterative test for `v`.
nennigb Feb 22, 2021
593915b
Update example and bridge it with pypolys.
nennigb Feb 22, 2021
7ec688e
Add Faa Di Bruno method for composite derivatives.
nennigb Feb 22, 2021
5ef25e1
Add new composite function of lda using faa Di Bruno.
nennigb Feb 23, 2021
b2e66d9
Extend `NumpyEigSolver._pep` for arbitrary degree.
nennigb Feb 23, 2021
f7ed083
Extend `ScipySpEigSolver._pep` for arbitrary degree.
nennigb Feb 23, 2021
e940aed
Work in progress...
nennigb Feb 24, 2021
1a40f59
Change `__repr__` to have the true #derivatives.
nennigb Feb 25, 2021
0a7147f
Add `ExpLda` to manage exp dependencies in nep.
nennigb Jun 3, 2021
17891b7
Many update to use pypolsys.
nennigb Feb 4, 2022
792feb5
Ensure that dLambda is a np.array.
nennigb Feb 4, 2022
447c624
Fix `np.complex` warning.
nennigb Feb 4, 2022
fc22160
Small clean up.
nennigb Feb 4, 2022
241542e
Add `getDerivativesMV` for petsc eig.
nennigb Feb 8, 2022
77ba51e
Rename method `_eval_an_at` into `eval_an_at`.
nennigb Feb 8, 2022
90162cc
Add export/load method to CharPol.
nennigb Feb 15, 2022
6570bfc
Add homotopy solver method through pypolsys.
nennigb Feb 18, 2022
8078303
Fix numpy deprecated warning.
nennigb Feb 18, 2022
f3f79a0
Update README.
nennigb Feb 18, 2022
69f72db
Update with CFA plots.
nennigb Mar 7, 2022
d89f126
Add `two_composition` generator for polynomial multiplication.
nennigb Mar 8, 2022
237c3b0
Add support for CharPol multiplication.
nennigb Mar 8, 2022
e47f985
Add unittest for CharPol class.
nennigb Mar 8, 2022
82cf3b7
Fix wrong docstring.
nennigb Mar 8, 2022
4bc1489
Add recursive factory method for speed up.
nennigb Mar 9, 2022
ad98edb
Add test for `_from_recursive_mult`.
nennigb Mar 9, 2022
6db8ade
Few fixes in solvers.
nennigb Mar 9, 2022
a5edda0
Add a function `complex_map` to span the complex plane.
nennigb Mar 18, 2022
394b510
Update docstring mentioning `OMP_NUM_THREAD`.
nennigb Apr 4, 2022
9e0846d
Add alternative constructor for `Taylor` class without factorials.
nennigb Apr 4, 2022
f9e4256
Add Taylor Error.
nennigb Apr 4, 2022
3e00dd5
Change indexation method in `Lda`.
nennigb Apr 7, 2023
982ec75
Add `associate_lda_to_nu` method to recover the lda for a given EP.
nennigb Mar 4, 2024
b3538c1
Add CharPol Class to ee import.
nennigb Mar 13, 2024
92927b9
Fix new fpoly import.
nennigb Mar 13, 2024
62a200f
Remove Groebner solver.
nennigb Mar 13, 2024
bdf9e09
Change to support `unittest` and `doctest`.
nennigb Mar 13, 2024
3264d97
Few fixes in doctrings.
nennigb Mar 14, 2024
e028314
Lint Charpol.
nennigb Mar 14, 2024
a63ea0a
Lint utils.py and enhance doctrings.
nennigb Mar 14, 2024
65b3f28
Lint tests.
nennigb Mar 14, 2024
8e8386a
Add `only_bezout` flag to compute only the number of sols.
nennigb Mar 19, 2024
f8d2ef6
Add `trunc` arg to control trunction order.
nennigb Apr 29, 2024
a741d6e
Add a method to compute the eigenvalue at nu.
nennigb Apr 29, 2024
9e14eb5
Add conj method to CharPol class.
nennigb Apr 30, 2024
255b1a8
Add filering facility for spurious roots.
nennigb Jun 3, 2024
478010b
Add an estimator of CharPol coefficients radius of convergence.
nennigb Jun 3, 2024
d968f15
Move Taylor class from charpol.py to utils.py.
nennigb Jun 13, 2024
895d1ff
Add lru_cache to combinatoric functions.
nennigb Jun 13, 2024
570ba6d
Enhance docstring and tests for radii_estimate().
nennigb Jun 13, 2024
8810379
Update `eig` to manage multivariate Taylor expansion.
nennigb Jun 13, 2024
7a36da5
Add `plot` argument everywhere in radii_estimate.
nennigb Jul 17, 2024
747a4af
Sort filtered solution by default.
nennigb Jul 17, 2024
718e163
Add `set_param` to create a new charpol with a set param.
nennigb Jul 17, 2024
f116226
Add Levenberg-Marquard EP solver.
nennigb Jul 19, 2024
45d9ab7
Clean-up iter_solve.
nennigb Jul 24, 2024
c5b175d
Add `explore` method make easier parametric exploration.
nennigb Jul 24, 2024
6ad77e9
Add tqdm dependancy.
nennigb Jul 24, 2024
8106969
Add getDerivativesMV method to scipysp class.
nennigb Sep 5, 2024
74e0c8c
Enhance loci plots.
nennigb Sep 18, 2024
e6ed505
Add a `timeit` argument for derivative of petsc eigs.
nennigb Sep 25, 2024
1998059
Change sp.bmat to its alias np.bmat.
nennigb Sep 25, 2024
ccefb4b
Add gradient computation in plotDiscriminant.
nennigb Oct 23, 2024
6a943ba
Fix bug in dLambda for set_param.
nennigb Oct 24, 2024
eb83b73
Raise an Error if bounds is not well formed.
nennigb Oct 24, 2024
f19442f
Replace np.arange by range for speed.
nennigb Oct 24, 2024
7ef12a1
Add parallelism in Charpol `multiply` method.
nennigb Oct 24, 2024
e92bced
Update options with 'max_workers_mult' used in charpol multiply.
nennigb Oct 24, 2024
4ea8a4a
Update tests for multiply parallelism.
nennigb Oct 24, 2024
c9a4073
Rename '_from_recursive_mult' into 'from_recursive_mult'.
nennigb Oct 24, 2024
e946e80
add Garbage collector call.
nennigb Sep 27, 2024
41b6963
Add explicit del statement.
nennigb Sep 27, 2024
9f0b59d
Add progress bar in `iterative_solve`.
nennigb Nov 1, 2024
763aa8f
Change `pypolsys` to weak dependency.
nennigb Nov 13, 2024
7bb6b79
Clean-up 2 admittance waveguide example.
nennigb Nov 13, 2024
b02485a
Clean-up 3 dof example.
nennigb Nov 13, 2024
e872030
Limit verbosity and uniformize getDerivativesMV prototype.
nennigb Nov 13, 2024
44111bd
Add new examples in the testsuite.
nennigb Nov 13, 2024
6b6209e
Fix few typos and unused variables.
nennigb Nov 13, 2024
ddf3b82
Add new tests
nennigb Nov 13, 2024
09ce955
Reorganize README and clarify multivariate case.
nennigb Nov 13, 2024
b065527
Change deprecited `np.object` into `object`.
nennigb Nov 13, 2024
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
235 changes: 110 additions & 125 deletions README.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion eastereig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def _getversion():
# Import class
from .options import gopts
from .eig import Eig
from .op import OP
from .op import OP, OPmv
from .ep import EP
from .loci import Loci
from .charpol import CharPol
from . import lda_func
50 changes: 27 additions & 23 deletions eastereig/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,34 @@
# along with Eastereig. If not, see <https://www.gnu.org/licenses/>.

"""
Run the doctest.
# Test suite runner

Run `eastereig` run the test suite using `doctest` and `unittest` framework.

Example
-------
```
```console
python3 -m eastereig
```
"""
import unittest
import doctest
import sys
import numpy as np
from eastereig import _petscHere
# immport the file containing the doctest
# Import the file containing the doctest
from eastereig.examples import WGimpedance_numpy
from eastereig.examples import WGimpedance_scipysp
from eastereig.examples import ThreeDoF
from eastereig.examples import toy_3dof_2params
from eastereig.examples import WGadmitance_numpy_mv
from eastereig import utils
from eastereig import loci
from eastereig import ep
from eastereig import lda_func
from eastereig import eigSolvers
from eastereig import fpoly
from eastereig import charpol

# Numpy 2.0 change default printing options making doctest failing.
# https://numpy.org/neps/nep-0051-scalar-representation.html
Expand All @@ -49,34 +55,32 @@
if _petscHere:
from eastereig.examples import WGimpedance_petsc

# invoke the testmod function to run tests contained in docstring
mod_list = [lda_func, utils, loci, ep, eigSolvers, WGimpedance_numpy,
WGimpedance_scipysp, ThreeDoF, fpoly]
# Explicitely list modules with doctest
mod_list = [lda_func, utils, loci, ep, eigSolvers, fpoly, charpol,
WGimpedance_numpy, WGimpedance_scipysp, ThreeDoF,
toy_3dof_2params, WGadmitance_numpy_mv]
if _petscHere:
petsc_list = [WGimpedance_petsc]
mod_list.extend(petsc_list)

if __name__ == '__main__':
import os
tests_dir = os.path.join(os.path.dirname(__file__), 'tests')
print('> Running tests...')
Stats = []
# Create test suite for unittest and doctest
suite = unittest.TestLoader().discover(start_dir=tests_dir, pattern='test*.py')
# Add doctest from all modules of mod_list
for mod in mod_list:
print("--------------------------------------------------------- \n",
"> Testing : {} \n".format(mod.__name__),
"--------------------------------------------------------- \n ")
# possible to use the directive "# doctest: +ELLIPSIS" or optionflags=doctest.ELLIPSIS in testmod
# it enable the ellipsis '...' for truncate expresion. usefull for float (but be careful)
stat = doctest.testmod(m=mod, optionflags=doctest.ELLIPSIS, verbose=False) # name=mod.__name__, verbose=True
print(stat)
Stats.append(stat)

# Summary, with petsc out put sometime hard to read
suite.addTest(doctest.DocTestSuite(mod,
optionflags=(doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE)))
runner = unittest.TextTestRunner(verbosity=2)
result = runner.run(suite)
# Summary, with petsc output is sometime hard to read
print("\n", "================ Testing summary ===================")
for i, mod in enumerate(mod_list):
print(" > Testing : {}".format(mod.__name__))
print(" ", Stats[i])
if sum([i.failed for i in Stats]) == 0:
print(" Pass :-)")
if result.wasSuccessful():
print(" Pass :-)")
sys.exit(0)
else:
print(" Failed :-(")
print(" Failed :-(")
sys.exit(1)
print("====================================================")
Loading
Loading