aind_disrnn_utils
⚠️ Retired — no longer maintained (2026-09-01)
This package is retired. It has no active maintainer and will receive no further releases, fixes, or dependency bumps.
Nothing you have installed will break. This repository is preserved read-only: existing
git+https://...@<sha>pins keep resolving, and every published release stays installable from PyPI. It is kept in place partly because frozen reproducibility artifacts reference it by SHA (for examplestudies/01-gru-scaling-law/environment.lockinaind-disrnn-dispatcher). Do not delete it.Where the code went
The two functions that had real consumers —
create_disrnn_datasetandadd_model_results— were vendored into the wrapper that used them:
aind-disrnn-wrapper→code/data_loaders/disrnn_dataset.pyThey were copied byte-identically from commit
74de874d, then improved in place. See aind-disrnn-wrapper#66 for the audit and rationale.
data_models.py(disRNNInputSettings,disRNNOutputSettings) was not carried over. Nothing imported it; Hydra configs replaced it as the configuration surface. This closes #21 by obsolescence.Known issues, now permanent
Two defects are present in the final release and will not be fixed here:
- int64 truncation of continuous features.
create_disrnn_datasetallocatesxswithnp.full(..., -1), an int64 array, so float feature columns are truncated toward zero before the later.astype(float). Harmless for the stock integer features (animal_response,rewarded), but it destroys any continuous input — in testing, 24,149 distinct log-reaction-time values collapsed to 7 integers. The wrapper carries a float-safe builder alongside the vendored one.- Slow session loading. The per-session
df.query()loop re-parses the expression and re-scans the frame for every session, which dominates dataset construction for large cohorts. Fixed in the vendored copy (see the closed PR #29).If you still depend on this
Pin a SHA or a released version and you are fine indefinitely. If you want the fixes above, copy
disrnn_dataset.pyfrom the wrapper rather than reviving this package.
Usage
Creating a dataset
- Obtain a list of NWB files you wish to fit the model to
import aind_dynamic_foraging_multisession_analysis.multisession_load as ms_load
import aind_disrnn_utils as dl
nwbs, df_trials = ms_load.make_multisession_trials_df(nwb_files)
dataset = dl.create_disrnn_dataset(df_trials)
- You don't need to use
make_multisession_trials_df, but the trials data frame does need to have a column "ses_idx" that splits trials into sessions.
Predefined datasets
This Code Ocean Capsule can be used for loading a list of sessions and saving the result as a dataframe: Code Ocean Capsule
The resulting data assets can be used like:
import pandas as pd
import aind_disrnn_utils.data_loader as dl
df = pd.read_csv('/data/disrnn_dataset_774212/disrnn_dataset.csv')
dataset = dl.create_disrrn_dataset(df)
| Dataset name | mouse id | # trials | # sessions | data asset ID | Task |
|---|---|---|---|---|---|
| disrnn_dataset_774212 | 774212 | 16184 | 31 | ad5ec889-f4e0-45a2-802c-f843266d3cce | Uncoupled Without Baiting |
| disrnn_dataset_779531 | 779531 | 7272 | 12 | 64fa1cb4-8af8-4d96-a965-3454d59439f6 | Uncoupled Without Baiting |
| disrnn_dataset_781173 | 781173 | 8132 | 15 | 9788eb8d-ea88-4c60-bacc-1a23efd2f5e1 | Uncoupled Without Baiting |
| disrnn_dataset_781162 | 781162 | 6417 | 12 | 8eaa487e-e78c-4635-b24b-eabe680a55ae | Uncoupled Without Baiting |
| disrnn_dataset_778077 | 778077 | 8336 | 15 | 76fc65d3-eec4-4578-a20d-499193fc920e | Uncoupled Without Baiting |
The datasets can be combined to fit easily:
import pandas as pd
import aind_disrnn_utils.data_loader as dl
mice = [77412, 779531, 781173, 781162, 778077]
dfs = []
for mouse in mice:
dfs.append(pd.read_csv('/data/disrnn_dataset_{}/disrnn_dataset.csv'.format(mouse)))
df = pd.concat(dfs)
dataset = dl.create_disrrn_dataset(df)
Saving results
After fitting the network, you can add the latent states and predictions back into the dataframe of trials:
df_trials = dl.add_model_results(df_trials, network_states.__array__(), yhat, ignore_policy=ignore_policy)
Installation
To install the software from PyPi
pip install aind-disrnn-utils
To use the software, in the root directory, run
pip install -e .
To develop the code, run
pip install -e . --group dev
Note: --group flag is available only in pip versions >=25.1
Alternatively, if using uv, run
uv sync
Level of Support
- Unsupported (retired 2026-09-01). This repository is archived and read-only. Issues and pull requests are closed; existing installs and SHA pins continue to work. See the notice at the top of this README for where the code moved.
Metadata
Release files for aind-disrnn-utils 0.0.17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aind_disrnn_utils-0.0.17.tar.gz | 11.0 kB | Without provenance | Details for aind_disrnn_utils-0.0.17.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aind_disrnn_utils-0.0.17-py3-none-any.whl | Python 3 | none | any | Details for aind_disrnn_utils-0.0.17-py3-none-any.whl |
Total release size: 19.5 kB
Release files / aind_disrnn_utils-0.0.17.tar.gz
| Download URL | aind_disrnn_utils-0.0.17.tar.gz |
|---|---|
| Size | 11.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c9e1ef354c92713dff9796cb24f340c03e57bbd7be4a21e47b2a679a551f300c
|
|
BLAKE2b-256 checksum How to use checksums |
0492fcaa122efe91dc8d0c722cab197ae048806e744869e664f7819b86c700be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / aind_disrnn_utils-0.0.17-py3-none-any.whl
| Download URL | aind_disrnn_utils-0.0.17-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9fe1824dbc2020a5b4a4c44c32c77edc849a47dc633ad1a471886f60cca7c44
|
|
BLAKE2b-256 checksum How to use checksums |
3dc06efcc9dc9eaef4482754d64cf510f86f01b466f1a278a7f1b92888e721dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for aind-disrnn-utils 0.0.17
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.