Skip to main content

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.

Installation

pip install splinecloud-scipy

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.grid()
plt.show()

Spline curve

Load data fitted by spline and evaluate fit accuracy

columns, table = spline.load_data()
x_data, y_data = table.T

plt.plot(X,Y)
plt.plot(x_data, y_data, 'o', color="grey")
plt.grid()
plt.xlabel(columns[0])
plt.ylabel(columns[1])
plt.show()

Spline curve

RMSE = spline.fit_accuracy(table, method="RMSE")
print(RMSE)

0.011307453345329156

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

Metadata

Release files for splinecloud-scipy 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splinecloud-scipy 1.4.0
File Size Uploaded
splinecloud_scipy-1.4.0.tar.gz 39.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for splinecloud-scipy 1.4.0
File Interpreter ABI Platform
splinecloud_scipy-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.0 kB

Release files / splinecloud_scipy-1.4.0.tar.gz

Download URL splinecloud_scipy-1.4.0.tar.gz
Size 39.5 kB
Tags Source
SHA-256 checksum
How to use checksums
290fd91d9ac53d766368238c2eec1e6d2236e6866f0e9028e8a1dbfc6dac745d
BLAKE2b-256 checksum
How to use checksums
1ef6b6b4658f225f46d6cd4231651db2aa0149be1dd36a37741f4134dbd2404d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / splinecloud_scipy-1.4.0-py3-none-any.whl

Download URL splinecloud_scipy-1.4.0-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64879461fd0f2809e425aac15ee38a31269569dd89e49724663431680b806c7f
BLAKE2b-256 checksum
How to use checksums
361ec92854c393f6005fc0bd8246f459b0e4b39ac16b2610f19037e2beaf2c15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page