Skip to main content

Simulate experimental and behavioural data from a portable design specification (cross-language with the R package of the same name).

Project description

pilotr (Python)

Python implementation of pilotr. It simulates experimental and behavioural data from a portable JSON design specification, producing output that is bit-identical to the R package of the same name. See the project README for the full toolkit (the no-code app, the R package and the specification format).

Install

pip install pilotr             # core engine (pure Python, dependency-free)
pip install "pilotr[power]"    # + scipy, for the simulation-based power demo

Requires Python 3.9 or later; the generative core has no dependencies.

For development, install from a checkout of the repository instead: clone https://github.com/pablobernabeu/pilotr and run pip install . (or pip install ".[dev]") from the python directory.

Quick start

from pilotr import simulate

spec = {
    "name": "two_group", "seed": 2024,
    "units": {"subject": {"n": 64}},
    "factors": [{"name": "group", "levels": ["control", "treatment"],
                 "contrasts": {"effect": [-0.5, 0.5]}, "between": "subject"}],
    "fixed": {"intercept": 100, "coefficients": {"effect": 5}},
    "response": {"family": "gaussian", "name": "score", "sigma": 10},
}

data = simulate(spec)               # 64 rows

Given the same specification and seed, this reproduces the data generated by the R package to full floating-point precision.

Try it without installing

A serverless build runs entirely in your browser, with no installation required and no data uploaded. It is available as a no-code app.

Learn more

The Python documentation site walks through the quick start, the response families, power and design analysis, the specification format and the API reference. The full repository, including the R package and the no-code app, is at https://github.com/pablobernabeu/pilotr.

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

pilotr-0.2.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

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

pilotr-0.2.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file pilotr-0.2.0.tar.gz.

File metadata

  • Download URL: pilotr-0.2.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pilotr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3ae9e8d8fb203f1d24d293479374f8ac387dab4c6e8ee8c966870d20eaafe759
MD5 f5ea7af3a65ab6b25de5d79593a97030
BLAKE2b-256 df3e4a7951a2938586f04e3a5f6ba1927d74dc7263c4ad3bd55de9e82ac99177

See more details on using hashes here.

Provenance

The following attestation bundles were made for pilotr-0.2.0.tar.gz:

Publisher: publish.yml on pablobernabeu/pilotr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pilotr-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pilotr-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pilotr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 117cb695e068cb2368b472a5233a1116b858419cfb3571b69b05bc97b2e2275c
MD5 5c7aed5f6e010bd8ec797d3764434759
BLAKE2b-256 0d120ba115e331fca01e2e65abee7a9a4d32bd02c757dcae65924576e601356f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pilotr-0.2.0-py3-none-any.whl:

Publisher: publish.yml on pablobernabeu/pilotr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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