Skip to main content

functional curve algebra (created by auxilium)

Project description

logo.png

Python Project curves

GitHubWorkflow Read the Docs GitHub GitHub release PyPI Version PyPI - Python Version PyPI Downloads

Introduction

To import the project simply type

>>> import curves

after installation.

The Curve class turns a function into an algebraic object which can handle operations like +, -, /, * as well es @.

>>> from curves import Curve

>>> eye = Curve()  # identity function
>>> eye(123.456)
123.456

>>> zero = Curve(0.0)
>>> zero(123.456)
0.0

>>> one = Curve(1.0)
>>> one(123.456)
1.0

>>> X = Curve('X')
>>> X
X

>>> p = 2 * X **2 + 3 * X + 1
>>> p
2 * X **2 + 3 * X + 1

>>> p(123.456)
30854.135872

>>> q = p(X - 1)
>>> q
(2 * X ** 2 + 3 * X + 1)(X - 1)

>>> q1 = p @ (X - 1)
>>> q1
(2 * X ** 2 + 3 * X + 1)(X - 1)

>>> q2 = 2 * (X - 1) ** 2 + 3 * (X - 1) + 1
>>> q2
2 * (X - 1) ** 2 + 3 * (X - 1) + 1

>>> q(123.456)
30359.311872

>>> q1(123.456)
30359.311872

>>> q2(123.456)
30359.311872

Documentation

More documentation available at https://curves.readthedocs.io

Install

The latest stable version can always be installed or updated via pip:

$ pip install curves

License

Code and documentation are available according to the license (see LICENSE file in repository).

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

curves-0.1.6.tar.gz (20.7 kB view details)

Uploaded Source

File details

Details for the file curves-0.1.6.tar.gz.

File metadata

  • Download URL: curves-0.1.6.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.11

File hashes

Hashes for curves-0.1.6.tar.gz
Algorithm Hash digest
SHA256 704064f488cabf33791de76bc43dd62c65fb3ea5447395e56e9434bbac00a3b5
MD5 6e504589a77ac263fdd04b756de262ab
BLAKE2b-256 27115d200dc60e379d592644ee1191949f4f011499f79b7f5fd039418509f75f

See more details on using hashes here.

Supported by

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