Skip to main content

cymr

PyPI version Documentation Status codecov DOI

Package for fitting and simulating free recall data. Includes a fast implementation of the context maintenance and retrieval (CMR) model using Cython.

See the website for full documentation.

See here for release notes for version 0.12.1 and earlier.

Installation

For the latest stable version:

pip install cymr

To get the development version:

pip install git+https://github.com/cmr-sims/cymr

To install for development, clone the repository and run:

python install -e .

This will set links to the package modules so that you can edit the source code and have changes be reflected in your installation.

Quickstart

Fit the context maintenance and retrieval model (CMR) to sample data:

from cymr import fit, cmr
# load sample data
data = fit.sample_data('Morton2013_mixed').query('subject <= 3')

# define model weights
n_items = 768
param_def, patterns = cmr.config_loc_cmr(n_items)
param_def.set_fixed(
    T=0.1, Lfc=0.15, Lcf=0.15, Afc=0, Acf=0, Dfc=0.85, Dcf=0.85, 
    P1=0.2, P2=2, B_start=0.3, B_rec=0.9, X1=0.001, X2=0.25
)
param_def.set_free(B_enc=(0, 1))

# fit the model to sample data
model = cmr.CMR()
results = model.fit_indiv(data, param_def, patterns=patterns, tol=0.1)

See the documentation for details.

Unit tests

First, install extra packages needed for testing:

pip install .[test]

To run all tests (from the main repository directory)

pytest

Benchmark

To run a speed benchmark test, first install snakeviz (pip install snakeviz). To run likelihood calculation with a sample dataset and then display an html report:

./benchmark

Metadata

Release files for cymr 0.14.3

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

Source distribution (sdist)

Source distribution for cymr 0.14.3
File Size Uploaded
cymr-0.14.3.tar.gz 722.2 kB Details

Release files / cymr-0.14.3.tar.gz

Download URL cymr-0.14.3.tar.gz
Size 722.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d68c102f9926038e9688b7810a7effdda0725a72aedc9230bef1ac5a0e5a779c
BLAKE2b-256 checksum
How to use checksums
07ab15e262fa8265884c20d0a43a8dd413336d433f87f514d0b5c421fb99be47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 20, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.14.3 This release

1 release file

0.14.2

1 release file

0.14.1

1 release file

0.14.0

1 release file

0.13.0

1 release file

0.12.2

1 release file

0.12.1

1 release file

0.12.0

1 release file

0.11.2

1 release file

0.11.0

1 release file

0.10.8

1 release file

0.10.7

1 release file

0.10.6

1 release file

0.10.5

1 release file

0.10.1

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

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