Skip to main content

A SplineCloud client based on SciPy.

Project description

splinecloud-scipy

A Python client for SplineCloud API

The client library is based on SciPy and allows to load data and curves from SplineCloud into your code. Once loaded spline curves can be easily evaluated.

Example of loading spline curve

SplineCloud curve
from splinecloud_scipy import load_spline
curve_id = 'spl_K5t56P5bormJ' # take curve ID from the 'API link' dropdown at SplineCloud
spline = load_spline(curve_id)

Evaluating spline curve for a range of x values

import numpy as np
import matplotlib.pyplot as plt

X = np.linspace(0, 20, 100)
Y = [spline.eval(x) for x in X]

plt.plot(X,Y)
plt.show()

Spline curve

Example of loading data in your code

from splinecloud_scipy import load_subset
subset_id = 'sbt_nDO4XmmYqeGI' # subset id can be taken from the SplineCloud
columns, table = load_subset(subset_id)
>>> columns

['Throttle (%)',
 'Load Currency (A)',
 'Pull (g)',
 'Power (W)',
 'Efficiency (g/W)']
>>> table

array([[5.0000e-01, 6.7600e+00, 3.8500e+02, 1.0871e+02, 3.5420e+00],
       [6.0000e-01, 1.0200e+01, 4.9500e+02, 1.6249e+02, 3.0460e+00],
       [7.0000e-01, 1.3580e+01, 6.0600e+02, 2.1768e+02, 2.7840e+00],
       [8.0000e-01, 1.7390e+01, 6.8700e+02, 2.7140e+02, 2.5510e+00],
       [9.0000e-01, 2.1030e+01, 7.4700e+02, 3.2813e+02, 2.2770e+00],
       [1.0000e+00, 2.5060e+01, 8.0700e+02, 3.8555e+02, 2.0930e+00]])

These examples are available as notebooks in the project's 'examples' folder.

Important

This library supports BSpline geometry but does not support weighted BSplines (NURBS). If you adjust the weights of the curve control points use another client, that supports NURBS (a link will be provided here soon).

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

splinecloud-scipy-1.2.6.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

splinecloud_scipy-1.2.6-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file splinecloud-scipy-1.2.6.tar.gz.

File metadata

  • Download URL: splinecloud-scipy-1.2.6.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for splinecloud-scipy-1.2.6.tar.gz
Algorithm Hash digest
SHA256 72a6cae7b5a41bb04a0b59581817bfc72905973f45e94bc865e532e246a3a93e
MD5 a7cae87ad1dbfebce2efdc6e42463311
BLAKE2b-256 5bebb52b123e585e8ab87caaf98e35791815d5e0cb49cc7ac3a1a5c25309564f

See more details on using hashes here.

File details

Details for the file splinecloud_scipy-1.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for splinecloud_scipy-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4855891c387a49ea61ba6a51b71684311d36bdbbb4ae96267324c20ad07616c7
MD5 491045f562518d53c05580e0452ca852
BLAKE2b-256 0fea38d81dfc2c1dff229404d58d1063b75c51be55f94bfe9782592b7d840236

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