nennigb / eastereig Goto Github PK
View Code? Open in Web Editor NEWA library to locate exceptional points and to reconstruct eigenvalues loci
License: GNU General Public License v3.0
A library to locate exceptional points and to reconstruct eigenvalues loci
License: GNU General Public License v3.0
petsc install takes a few lines and may be stored in an external script
The build of fortran files is based on numpy.distutils
and
numpy.distutils
has been deprecated in NumPy 1.23.0. It will be removed for Python 3.12; for Python <= 3.11 it will not be removed until 2 years after the Python 3.12 release (Oct 2025).
Until a clean solution will be implemented, to use eastereig
with python 3.12 (everything is fine for other version), you will need to edit the setup.py
, to remove numpy.distutils
calls
# -*- coding: utf-8 -*-
import setuptools
import os
with open("README.md", "r") as fh:
long_description = fh.read()
def _getversion():
""" Get version from VERSION."""
v = None
with open(os.path.join('./eastereig', 'VERSION')) as f:
for line in f:
if line.startswith('version'):
v = line.replace("'", '').split()[-1].strip()
break
return v
this_version = _getversion()
print('version:', this_version)
setuptools.setup(
name="eastereig",
version=this_version,
author="B. Nennig, M. Ghienne",
author_email="[email protected], [email protected]",
description="A library to locate exceptional points and to reconstruct eigenvalues loci",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/nennigb/EasterEig",
include_package_data=True,
# we can use find_packages() to automatically discover all subpackages
packages=setuptools.find_packages(),
install_requires=['numpy',
'scipy',
'matplotlib'],
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.5',
)
In eigSolver.py
, the matrices are passed to eigenvalue solvers depending on their position in the K
list. This assume that operators are well ordered in K
, dK
and in flda
. A more robust approach could be to use flda
to sort and to pass the matrices to solvers.
The modification will concern all solve
methods of EigSolver
concrete class. For instance
# FIXME need to modify matrix order based on flda
if self.pb_type=='std':
self.Lda,Vec = sp.linalg.eig(self.K[0],b=None)
elif self.pb_type=='gen':
self.Lda,Vec = sp.linalg.eig(self.K[0],b=-self.K[1])
elif self.pb_type=='PEP':
self.Lda,Vec = self._pep(self.K)
else:
raise NotImplementedError('The pb_type {} is not yet implemented'.format(self.pb_type))
Claimed version (in setup.py) is 1.0.0, whereas the last commit was a bugfix ("Fix problem to load eig object without eigenvector"). This may confuse everyone which use the code. I suggest to use semantic versioning standard, implemented by semver python module and bumping version on 1.0.1 on next PR.
Although the documentation is quite extensive about how to use EasterEig, there's nothing such as contribution guidelines.
Here's some suggestions:
Test coverage
Test coverage is inteded to check if tests are effectively testing code (execute it, and check assertion). This can only be done using mutation testing, eg.MutPy). Here, testing is done using doctest, and there's no reliable mutation-testing libray using doctest. This library is intended as a toy for learning. I've not been able to run xmutant). There's a way, thought, by making unittest run doctest.
Simple coverage (has code been executed during test ?) is a fallback mechanism: only low coverage indicate something bad. 100% coverage, without any assertion, doesn't prevent anything bad from happening, even crashes.
Coverage can handle doctest, and gave a 60% coverage
To run:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.