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.2a7.tar.gz (192.6 kB view details)

Uploaded Source

Built Distribution

arithmeticmeancurve-0.2a7-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file arithmeticmeancurve-0.2a7.tar.gz.

File metadata

  • Download URL: arithmeticmeancurve-0.2a7.tar.gz
  • Upload date:
  • Size: 192.6 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.2a7.tar.gz
Algorithm Hash digest
SHA256 6357707e613584d49a0891a7d8279454c8e2412639dbcdfd21617cb9a1fc8a0a
MD5 b523d5e4f82915fbc5c161cee3de69f0
BLAKE2b-256 673f6b2d4e08f2739a48d2c3b114628c486ded7e1392663ec349e20a93c3cfc1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: arithmeticmeancurve-0.2a7-py3-none-any.whl
  • Upload date:
  • Size: 41.6 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.2a7-py3-none-any.whl
Algorithm Hash digest
SHA256 3a95a00d5ce1c9a51fb7977ec4bd9c60f589b4fa268d90ad862b7ee6ad2c5676
MD5 0e725fa33c09d541d8fea0294fc06789
BLAKE2b-256 8a48f61e38d84d66a8871947f1bb8d0eded6d9900aeb2c15461044dc160f611e

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