GithubHelp home page GithubHelp logo

nennigb / eastereig Goto Github PK

View Code? Open in Web Editor NEW
10.0 5.0 1.0 134 KB

A library to locate exceptional points and to reconstruct eigenvalues loci

License: GNU General Public License v3.0

MATLAB 1.80% Python 95.75% Shell 0.33% Fortran 2.12%
exceptional-point non-hermitian eigenvalueproblems defective-matrix puiseux-series acoustics veering structural-dynamics random eigenvalues

eastereig's People

Contributors

martinghienne avatar nennigb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

chaogecanfly

eastereig's Issues

Fail to install with python 3.12.

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',
)

The order of operator may not be consistent between eigSolver and flda.

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))

Add semantic versioning

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.

Enable contributing

Although the documentation is quite extensive about how to use EasterEig, there's nothing such as contribution guidelines.

Here's some suggestions:

  • create a CONTRIBUTING.md;
  • use a source-code analyzer (linter, eg. Pylama) to make code homogeneous among contributors;
  • ensure test code coverage provide enough trust so new features don't introduce regressions.

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

image

To run:

  • pip3 install coverage
  • coverage run --source=. -m eastereig
  • coverage report -m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.