Module for calculating an arithmetic mean curve from a family of curves.
Project description
arithmeticmeancurve
Calculates arithmetic mean curves for a sample of curves. Speciality of this module is the extrapolation of the sample curves by the algorithm described in "David Scheliga: Experimentelle Untersuchung des Rissausbreitungsverhaltens von nanopartikelverstärktem Polyamid 6. 2013"
Installation
$ pip install arithmeticmeancurve
If available the latest development state can be installed from gitlab.
$ pip install git+https://gitlab.com/david.scheliga/arithmeticmeancurve.git@dev
Alpha Development Status
The current development state of this project is alpha. Towards the beta
- naming of modules, classes and methods will change, since the final wording is not done.
- Code inspections are not finished.
- The documentation is broad or incomplete.
- Testing is not complete, as it is added during the first test phase. At this state mostly doctests are applied at class or function level.
Basic Usage
Read-the-docs for a more detailed documentation.
A curve within armithmeticmeancurves
is defined by a pandas.DataFrame. Curves
for arithmetic mean curve calculation needs to provide equal column names.
# Creation of 3 random curves
# ===========================
import numpy as np
from pandas import DataFrame, Index
from scipy.interpolate import CubicSpline
cubic_spline = CubicSpline(x=[0.0, 0.2, 0.8, 1.0], y=[0.0, 0.3, 0.9, 1.0])
x_values = np.linspace(0.0, 1, num=11)
curvature = cubic_spline(x_values)
base_curve = np.stack((x_values, curvature), axis=1)
three_seeds = np.random.standard_normal(6).reshape(3, 2)
three_random_points = np.array([1.0, 10.0]) + np.array([0.09, 1]) * three_seeds
curves = []
for random_point in three_random_points:
raw_curve = base_curve * random_point
sample_curve = DataFrame(
raw_curve[:, 1], columns=["sample"], index=Index(raw_curve[:, 0], name="x")
)
curves.append(sample_curve)
# The mean curve calculation
# ==========================
from arithmeticmeancurve import ArithmeticMeanCurve
a_mean_curve = ArithmeticMeanCurve(curves=curves)
# Plotting
# ========
import matplotlib.pyplot as plt
plt.plot(a_mean_curve.mean_curve, "-ko", label="arithmetic mean curve")
for label, curve in a_mean_curve.family_of_curves.iteritems():
plt.plot(curve, "-", label="label")
plt.plot(a_mean_curve.scatter_curve, "--k", label="scatter curve")
plt.plot(a_mean_curve.std_circle, "--r", label="std circle")
plt.legend()
plt.show()
Contribution
Any contribution by reporting a bug or desired changes are welcomed. The preferred way is to create an issue on the gitlab's project page, to keep track of everything regarding this project.
Contribution of Source Code
Code style
This project follows the recommendations of PEP8. The project is using black as the code formatter.
Workflow
- Fork the project on Gitlab.
- Commit changes to your own branch.
- Submit a pull request from your fork's branch to our branch 'dev'.
Authors
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details
Acknowledge
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file arithmeticmeancurve-0.1a0.tar.gz
.
File metadata
- Download URL: arithmeticmeancurve-0.1a0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72559d62ef21db135df7897c5bbd8ef638237537b0297392e18c47d8d5394ee8 |
|
MD5 | fe6e99e9694b78e7dbde30f727ee8173 |
|
BLAKE2b-256 | 8369dbb1fbda54f142a5acb1f6ad0a1b4c903e8103178b69dd916cd08f3e0f6f |
File details
Details for the file arithmeticmeancurve-0.1a0-py3-none-any.whl
.
File metadata
- Download URL: arithmeticmeancurve-0.1a0-py3-none-any.whl
- Upload date:
- Size: 31.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.25.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17f782922e22f74f8819958ae8aa8c3f6e42f8cdc232990f1de498a0f2a08a97 |
|
MD5 | 8a7b6d1c464d1e86604f0b7ce7333c71 |
|
BLAKE2b-256 | c8a26db5547e65c204f944994d41effae7486d87eb50a4a70de2722f332d6870 |