Skip to main content

Python Numpy Scipy License: GPL v3 version downloads

rft1d

One-Dimensional Random Field Theory in Python.

rft1d is a Python package for exploring and validating Random Field Theory (RFT) expectations regarding upcrossings in univariate and multivariate 1D continua. These expectations can be used to make statistical inferences regarding signals observed in experimentally measured 1D continua including scalar and vector time series.

Please cite:

Pataky TC (2016) RFT1D: Smooth One-Dimensional Random Field Upcrossing Probabilities in Python. Journal of Statistical Software 71(7): 1-22. https://doi.org/10.18637/jss.v071.i07

Documentation is available at: www.spm1d.org/rft1d


Installation

pip install rft1d

rft1d requires Python 3.9 or later, along with numpy, scipy and matplotlib.

rft1d has been tested on Python 3.9 through 3.13.


Running examples:

The scripts in ./examples call import rft1d so they need the package importable. Either install rft1d, or add the ./src directory to your PYTHONPATH.

The scripts in ./examples/paper reproduce the figures and code examples from the Journal of Statistical Software paper. Run ./examples/paper/all_results.py to run generate everything in one pass.


Development

The package uses a src layout, and the test suite adds ./src to sys.path itself (see tests/conftest.py), so no installation step is needed to work on the source:

git clone https://github.com/0todd0000/rft1d.git
cd rft1d
pip install pytest numpy scipy matplotlib

Running tests:

pytest                      # the whole suite
pytest -m "not slow"        # skip the 100,000-case validation (about 20 s)
pytest tests/test_p_RF.py   # a single file

There are two test types:

  • test_p_RF.py and test_uc_RF.py check rft1d's probabilities and critical thresholds against reference values computed with SPM12b, which are stored in tests/data-spm12b. These establish that rft1d's probability calculations are correct.
  • test_characterization.py replays about 1,400 probes of the public API -- including an inventory of every public name and signature -- against values recorded in tests/data-characterization/golden.npz. These establish that behaviour has not changed.

If you deliberately change public behavior, re-record the golden values and review the resulting diff:

python tests/gen_characterization_golden.py

Issues

Please report software bugs or other problems by searching existing issues or creating a new issue here.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rft1d-0.2.7.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rft1d-0.2.7-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file rft1d-0.2.7.tar.gz.

File metadata

  • Download URL: rft1d-0.2.7.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rft1d-0.2.7.tar.gz
Algorithm Hash digest
SHA256 6ccb190bee15b31b0a55e8384a33ae7b6b8571b4d93497734eb27541a6009f9c
MD5 c2133eb7f277b0870a38c57b2ff125c7
BLAKE2b-256 16453d079302bf554532e8a56305a86a2ba1a6bb884dfad95c1a8ea9525ffac5

See more details on using hashes here.

File details

Details for the file rft1d-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: rft1d-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for rft1d-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 f1a6b61e1e5c8def026f93ea6e8ff261cf1b07d69ef3c68a49d74c0e6b9978a2
MD5 17fa28c2652dd8d13ff5b99a00b16ec1
BLAKE2b-256 09ec9a69e94654da38d20fcaf5ef8bd2492d7c94ed27691e2f9f51dc40eea5bc

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

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