Skip to main content

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"

arithmeticmeancurve-icon

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

basic_usage_example

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

  1. Fork the project on Gitlab.
  2. Commit changes to your own branch.
  3. 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

Code style: black

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

arithmeticmeancurve-0.2a4.dev1.tar.gz (192.5 kB view details)

Uploaded Source

Built Distribution

arithmeticmeancurve-0.2a4.dev1-py3-none-any.whl (42.4 kB view details)

Uploaded Python 3

File details

Details for the file arithmeticmeancurve-0.2a4.dev1.tar.gz.

File metadata

  • Download URL: arithmeticmeancurve-0.2a4.dev1.tar.gz
  • Upload date:
  • Size: 192.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.9

File hashes

Hashes for arithmeticmeancurve-0.2a4.dev1.tar.gz
Algorithm Hash digest
SHA256 d6c984eb9427629a88ccfb1d5d5c3b602ad3c841d01fa127728f3e3464dff4f2
MD5 91bce57acf6a94cf70d9846ae2008c5c
BLAKE2b-256 ba0a13d67fa39fb1d9263ad36c49cc3ef6b9dd093ae46c4819b7bc8ea5bc78b1

See more details on using hashes here.

File details

Details for the file arithmeticmeancurve-0.2a4.dev1-py3-none-any.whl.

File metadata

  • Download URL: arithmeticmeancurve-0.2a4.dev1-py3-none-any.whl
  • Upload date:
  • Size: 42.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.7.9

File hashes

Hashes for arithmeticmeancurve-0.2a4.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 d66f1a37bb2d3d1bef14118ca57dde9ffd48009423fde2ef1bf1c9f688409589
MD5 3d1dcaf425d2cd91b513157e14461a99
BLAKE2b-256 a6fdcd813d5128a060c8ede2250d49b78bdb6adafe1513689112912b072a2557

See more details on using hashes here.

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