FERS_calculations
FERS_calculations is a high-performance library for Rust-backed calculations in mechanical engineering. It can process JSON input files to deliver fast and accurate results. While it can be run as a standalone tool, integration with FERS_core simplifies input creation and workflow management.
Features
- Standalone Functionality: Run directly by providing a valid JSON input file.
- Rust-Powered Performance: Designed for speed and reliability in computational tasks.
- Python Integration: Seamless integration with
FERS_corefor easy preprocessing and result handling. - Engineer-Friendly Design: Minimal coding effort required for complex structural engineering calculations.
Installation
pip install fers_calculations
This installs the pre-built Rust bindings -- no Rust toolchain required.
Usage
Standalone (Python)
You can call fers_calculations directly from Python without FERS_core:
import fers_calculations
# Load your JSON input
with open("001_cantilever_with_end_load.json") as f:
json_data = f.read()
# Run the analysis
results_json = fers_calculations.calculate_from_json(json_data)
# Save the results
with open("results.json", "w") as f:
f.write(results_json)
Premium licensing and timeouts
Passing api_key unlocks Premium model limits. That is the only thing that makes
the library contact the network — omit it and no request is ever sent.
Because a licence check is a network call, it is bounded. If ferscloud.com does
not answer within license_timeout seconds (default 30) the call raises
fers_calculations.FersTimeoutError before the solve starts, so retrying is
always safe:
import fers_calculations
try:
fers_calculations.calculate_to_file(
json_data, "results.json", api_key=KEY, license_timeout=60
)
except fers_calculations.FersTimeoutError:
... # transient — retry or skip this model
FersTimeoutError subclasses the built-in TimeoutError, so except TimeoutError
catches it too. A definitive failure — an invalid key, a non-premium account, an
unreachable host — raises RuntimeError instead, since retrying those is pointless.
license_timeout bounds the licence handshake only, not the solve. To put a
hard ceiling on a whole solve, run it in a killable subprocess.
Two environment variables are read (real process environment only — .env files
are loaded by the CLI binary, never by this extension module):
| Variable | Purpose | Default |
|---|---|---|
FERS_LICENSE_TIMEOUT |
Default license_timeout, in seconds |
30 |
FERS_CLOUD_URL |
Base URL of the licence API | https://ferscloud.com |
With FERS_core (recommended)
For a more ergonomic workflow, install FERS_core which handles model creation, calling the Rust engine, and post-processing / visualisation:
pip install fers-core
from fers_core import FERS
model = FERS.from_json("001_cantilever_with_end_load.json")
model.calculate()
model.plot_results_3d()
See FERS_core on PyPI for full documentation.
Metadata
Release files for fers-calculations 0.2.66
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fers_calculations-0.2.66-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| fers_calculations-0.2.66-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| fers_calculations-0.2.66-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 10.12+ x86-64 | Details |
Total release size: 19.5 MB
Release files / fers_calculations-0.2.66-cp39-abi3-win_amd64.whl
| Download URL | fers_calculations-0.2.66-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3f3e8ea42a18c28d7503dc4ac9555a57ac2a44bb28b6f02b7063392e8ad288ae
|
|
BLAKE2b-256 checksum How to use checksums |
1414e1f84475244c48a3e816d6d2fc8e2f8bf81e53fac4bc4022e7363f187b19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / fers_calculations-0.2.66-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | fers_calculations-0.2.66-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 10.8 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5508aad65c5a89db5e4748e518241c582ae274f312e32b25e1bc1a50d879b98d
|
|
BLAKE2b-256 checksum How to use checksums |
0e5ee303db36906256aabe14e7a53ac482b28a75d9f800c942e8b651868bd45b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / fers_calculations-0.2.66-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | fers_calculations-0.2.66-cp39-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0377a01a2e633cb4b7d3a2c2caea914bdebaf10cb5aab268ab76ce5fdab3b748
|
|
BLAKE2b-256 checksum How to use checksums |
272a457fd5944dfce114114572a87ef4637a6a6202c727fb93ffab33644ebe3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|