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.1.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.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pilotr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9b1fa5b34433c9f6d5b34913fc79f89870f146d7a19827c6b70e32943bfecf5c
MD5 04d5c902b75accf34633cf8a63c6c377
BLAKE2b-256 cbf7cb221fa315919201e96da5ba86967bc05d35ef9f715e438f0b0d018a98bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pilotr-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pilotr-0.2.1-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.14

File hashes

Hashes for pilotr-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d38b965263ce003a648c4376c9d47bae7b6dd4314a674a0b81c5fac6e7b21c2b
MD5 253c0d4a9c36bc1a2d28f653db2b5e04
BLAKE2b-256 273b5e5ca66c41c36850de6f428879515da9467302dc59f6f2cf95cc6226af4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pilotr-0.2.1-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