Skip to main content

Basic Numerical Methods for Python 3

Project description

BasicLineAlg

Introduction

Installation

In order to install the package, you can use the following command:

pip install bnummet # This is not yet available

Usage

Examples

Tests

We recommend to use a virtual environment to install the package. To do so, you can use the following commands:

Linux

python3 -m venv venv # Create a virtual environment
source venv/bin/activate # Activate the virtual environment

Windows

python -m venv venv # Create a virtual environment
venv\Scripts\activate # Activate the virtual environment

Python Side

Then, you can test the package using the following command:

pip install -r requirements_dev.txt # Install development dependencies (test libraries)
pip install -e . # Installs the package in editable mode (so you can modify the code and test it)
pytest # Run tests

Or, alternatively, you can use the __init__.py file to run the tests.

pip install requirements_dev.txt # Install development dependencies (test libraries)
pip install -e . # Installs the package in editable mode
python tests/__init__.py # Run tests

# It will generate a coverage report in the Tests/coverage folder in different formats (html, xml, lcov). 
# It will also format the code using the Black Library (I Might've forgottent to do so :) )

BNumMet - Structure

.
├── Demos # Contains the Jupyter Notebooks with the demos   ├── Interpolation.ipynb
│   ├── LinearSystems.ipynb
│   ├── NonLinear.ipynb
│   ├── Packages Show.ipynb
│   ├── Randomness.ipynb
│   └── Timings # Contains the Jupyter Notebooks with the timings results       ├── Interpolation Timings.py
│       ├── Interpolation_Timings_Analysis.ipynb
│       ├── LU_Timings_Analysis.ipynb
│       ├── Linear Systems Timings.py
│       ├── NonLinear Timings.py
│       ├── NonLinear_Iterations.ipynb
│       └── Results
├── LICENSE
├── MANIFEST.in
├── Readme.md
├── Utilities # Contains the utilities to run the tests and the SonarQube analysis   ├── ReportGenerator.jar
│   ├── SonarScanner.bat
│   ├── SonarScanner.sh
│   ├── ngrok.exe
│   └── sonarqubeRemote.bat
├── VERSION
├── pyproject.toml
├── requirements.txt
├── requirements_dev.txt
├── setup.cfg
├── setup.py
├── src
│   └── BNumMet # Contains the source code of the package       ├── Interpolation.py
│       ├── LinearSystems.py
│       ├── NonLinear.py
│       ├── Random.py
│       ├── Visualizers # Contains the visualizers of the package          ├── InterpolationVisualizer.py
│          ├── LUVisualizer.py
│          ├── LeastSquaresVisualizer.py
│          ├── NonLinearVisualizer.py
│          └── RandomVisualizer.py
│       ├── __init__.py
│       └── module.py
├── tests # Contains the tests of the package   ├── Reports # Contains the reports generated by the tests      └── testsReport.xml
│   ├── __init__.py
│   ├── test_General.py
│   ├── test_Interpolation.py
│   ├── test_LeastSquares.py
│   ├── test_LinealSystems.py
│   ├── test_NonLinear.py
│   ├── test_Random.py
│   └── test_module.py
└── tox.ini

SonarQube

In order to run the SonarQube analysis, you can use the following command:

Start the SonarQube server (Docker Version)

docker run -d --name sonarqube -p 9000:9000 sonarqube

Since its running locally, you can access the server at http://localhost:9000, and the default credentials are admin/admin. Additionally, for simplicity with login go to Administration -> Security -> Disable "Force User Authentication". (This is not recommended for production environments)

Run the analysis

Linux

docker run --rm -ti -v "%cd%":"/usr/src" --link sonarqube newtmitch/sonar-scanner sonar-scanner /
    -Dsonar.projectName="BNumMet" /
    -Dsonar.projectKey="BNumMet" /
    -Dsonar.sources="src/BNumMet/" /
    -Dsonar.python.version=3 /
    -Dsonar.python.xunit.reportPath="tests/Reports/testsReport.xml"  /
    -Dsonar.python.coverage.reportPaths="tests/Reports/Coverage/xml/coverage.xml" /
    -Dsonar.scm.disabled=true /
    -Dsonar.tests="tests" /
    -Dsonar.test.inclusions="tests/**" /
    -Dsonar.test.exclusions="tests/Reports/Coverage/**"

Windows - just replace "$(pwd)" with "%cd%"

docker run --rm -ti -v "%cd%":"/usr/src" --link sonarqube newtmitch/sonar-scanner 
sonar-scanner ^
-Dsonar.projectName="BNumMet" ^
-Dsonar.projectKey="BNumMet" ^
-Dsonar.sources="src/BNumMet/" ^
-Dsonar.python.version=3 ^
-Dsonar.python.xunit.reportPath="tests/Reports/testsReport.xml"  ^
-Dsonar.python.coverage.reportPaths="tests/Reports/Coverage/xml/coverage.xml" ^
-Dsonar.scm.disabled=true ^
-Dsonar.tests="tests" ^
-Dsonar.test.inclusions="tests/**" ^
-Dsonar.test.exclusions="tests/Reports/Coverage/**"

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

BNumMet-1.0.0.dev2.tar.gz (41.9 kB view hashes)

Uploaded Source

Built Distribution

BNumMet-1.0.0.dev2-py3-none-any.whl (34.6 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