Skip to main content

A Python Library for Applied Mathematics in Physical Sciences.

Project description

SigmaEpsilon.Math - A Python Library for Applied Mathematics in Physical Sciences

CircleCI Documentation Status License PyPI codecov Python Code style: black

SigmaEpsilon.Math is a Python library that provides tools to formulate and solve problems related to all kinds of scientific disciplines. It is a part of the SigmaEpsilon ecosystem, which is designed mainly to solve problems related to computational solid mechanics, but if something is general enough, it ends up here. A good example is the included vector and tensor algebra modules, or the various optimizers, which are applicable in a much broader context than they were originally designed for.

The most important features:

  • Linear Algebra

    • A mechanism that guarantees to maintain the property of objectivity of tensorial quantities.
    • A ReferenceFrame class for all kinds of frames, and dedicated RectangularFrame and CartesianFrame classes as special cases, all NumPy compliant.
    • NumPy compliant classes like Tensor and Vector to handle various kinds of tensorial quantities efficiently.
    • A JaggedArray and a Numba-jittable csr_matrix to handle sparse data.
  • Operations Research

    • Classes to define and solve linear and nonlinear optimization problems.
      • A LinearProgrammingProblem class to define and solve any kind of linear optimization problem.
      • A BinaryGeneticAlgorithm class to tackle more complicated optimization problems.
  • Graph Theory

    • Algorithms to calculate rooted level structures and pseudo peripheral nodes of a networkx graph, which are useful if you want to minimize the bandwidth of sparse symmetrix matrices.

Note Be aware, that the library uses JIT-compilation through Numba, and as a result, first calls to these functions may take longer, but it pays off big time in the long run.

Documentation

The documentation is hosted on ReadTheDocs. You can find examples there.

Installation

sigmaepsilon.math can be installed from PyPI using wither pip or Poetry on Python >=3.10:

Install using pip

>>> pip install sigmaepsilon.math

or chechkout with the following command using GitHub CLI

gh repo clone sigma-epsilon/sigmaepsilon.math

and install from source by typing

>>> pip install .

If you want to run the tests, you can install the package along with the necessary optional dependencies like this

>>> pip install ".[test]"

If you are a developer and want to install the library in development mode, the suggested way is by using this command:

>>> pip install "-e .[test, dev]"

Install using Poetry

>>> poetry install sigmaepsilon.math

If you want to run the tests, you can install the package along with the necessary optional dependencies like this

>>> poetry install sigmaepsilon.math --with test

If you are a developer and want to install the library in development mode, the suggested way is by using this command:

>>> poetry install sigmaepsilon.math --with test,dev

Testing and coverage

The following command runs all tests and creates a html report in a folder named htmlcov (the settings are governed by the .coveragerc file):

python -m pytest --cov-report html --cov-config=.coveragerc --cov sigmaepsilon.math

ALternatively, you can use Poetry to test the package:

poetry run pytest --cov-report=html --cov-config=.coveragerc --cov=sigmaepsilon.math

Changes and versioning

See the changelog, for the most notable changes between releases.

The project adheres to semantic versioning.

How to contribute?

Contributions are currently expected in any the following ways:

  • finding bugs If you run into trouble when using the library and you think it is a bug, feel free to raise an issue.
  • feedback All kinds of ideas are welcome. For instance if you feel like something is still shady (after reading the user guide), we want to know. Be gentle though, the development of the library is financially not supported yet.
  • feature requests Tell us what you think is missing (with realistic expectations).
  • examples If you've done something with the library and you think that it would make for a good example, get in touch with the developers and we will happily inlude it in the documention.
  • sharing is caring If you like the library, share it with your friends or colleagues so they can like it too.

In all cases, read the contributing guidelines before you do anything.

Acknowledgements

Although sigmaepsilon.math heavily builds on NumPy, Scipy, Numba and Awkward and it also has functionality related to networkx and other third party libraries. Whithout these libraries the concept of writing performant, yet elegant Python code would be much more difficult.

A lot of the packages mentioned on this document here and the introduction have a citable research paper. If you use them in your work through sigmaepsilon.mesh, take a moment to check out their documentations and cite their papers.

Also, funding of these libraries is partly based on the size of the community they are able to support. If what you are doing strongly relies on these libraries, don't forget to press the :star: button to show your support.

License

This package is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sigmaepsilon_math-1.2.1.tar.gz (82.6 kB view hashes)

Uploaded Source

Built Distribution

sigmaepsilon_math-1.2.1-py3-none-any.whl (102.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page