Skip to main content

Generated from aind-library-template

Project description

ZOMBIE Squirrel

License Code Style semantic-release: angular Interrogate Coverage Python

Logo (image from ChatGPT)

zombie-squirrel is a set of one-line functions that handle the entire process of caching and retrieving data (and metadata) from AIND data assets.

In the background, the ZOMBIE squirrel repackages data/metadata into dataframes and stores them on S3 in a flat bucket, or in memory for testing.

Installation

pip install zombie-squirrel

Usage

Set backend

export FOREST_TYPE='S3'

Options are 'S3', 'MEMORY'.

Scurry (fetch) data

from zombie_squirrel import unique_project_names

project_names = unique_project_names()

Acorns

get_squirrel_info returns the following information about all available acorns:

Acorn Description Location Type Partitioned Columns
unique_project_names Unique project names across all assets s3://allen-data-views/data-asset-cache/zs_unique_project_names.pqt metadata False project_name
unique_subject_ids Unique subject_ids across all assets s3://allen-data-views/data-asset-cache/zs_unique_subject_ids.pqt metadata False subject_id
unique_genotypes Unique genotypes across all assets where subject.subject_details.genotype is present s3://allen-data-views/data-asset-cache/zs_unique_genotypes.pqt metadata False genotype
asset_basics Commonly used asset metadata, one row per data asset s3://allen-data-views/data-asset-cache/zs_asset_basics.pqt metadata False _id, _last_modified, modalities, project_name, data_level, subject_id, acquisition_start_time, acquisition_end_time, code_ocean, process_date, genotype, age, acquisition_type, location, name, experimenters, instrument_id, investigators
source_data Mapping from derived asset names to their source raw asset names s3://allen-data-views/data-asset-cache/zs_source_data.pqt metadata False name, source_data, pipeline_name, processing_time
quality_control Quality control table with one row per QC metric s3://allen-data-views/data-asset-cache/zs_qc/ asset True (by subject_id) name, stage, modality, value, status, asset_name
assets_smartspim SmartSPIM assets with processing status and neuroglancer links s3://allen-data-views/data-asset-cache/zs_assets_smartspim.pqt metadata False subject_id, genotype, institution, acquisition_start_time, processing_end_time, stitched_link, processed, name, channel_1, segmentation_link_1, quantification_link_1, channel_2, segmentation_link_2, quantification_link_2, channel_3, segmentation_link_3, quantification_link_3
platform_fib Fiber photometry assets in long form, one row per asset/fiber/channel combination s3://allen-data-views/data-asset-cache/zs_platform_fib.pqt metadata False asset_name, fiber, patch_cord, channel, intended_measurement, targeted_structure
metadata_core Presence of core aind-data-schema metadata files per asset (True if file is not null) s3://allen-data-views/data-asset-cache/zs_metadata_core.pqt metadata False _id, _last_modified, subject, data_description, procedures, instrument, acquisition, processing, quality_control
foraging_sessions Foraging behavior sessions with key performance metrics, one row per session s3://allen-data-views/data-asset-cache/zs_foraging_sessions.pqt metadata False subject_id, session_date, session, nwb_suffix, rig, trainer, task, curriculum_name, curriculum_version, current_stage_actual, foraging_eff, foraging_eff_random_seed, finished_trials, finished_rate, total_trials, bias_naive

The raw_to_derived function is not a table stored in S3, instead it is used by passing an asset_name (or list of asset names) and a modality. The function returns the latest derived asset matching the requested pattern.

Custom acorn

The custom function allows you to store and retrieve your own user-defined DataFrames in the cache by name. This requires write authentication to the active backend.

from zombie_squirrel import custom
import pandas as pd

df = pd.DataFrame({"col": [1, 2, 3]})
custom("my_data", df)

retrieved_df = custom("my_data")

Hide all the acorns

We run a nightly capsule on Code Ocean with this code to hide all acorns (not the custom ones).

from zombie_squirrel.sync import hide_acorns
hide_acorns()

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

zombie_squirrel-0.25.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

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

zombie_squirrel-0.25.0-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file zombie_squirrel-0.25.0.tar.gz.

File metadata

  • Download URL: zombie_squirrel-0.25.0.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zombie_squirrel-0.25.0.tar.gz
Algorithm Hash digest
SHA256 135de9ebd6f0f7682845e086e8162a35c71dd747076ee277591f98e4ed8b8738
MD5 dae99e89eec6428cc3d1b4e0c5d22880
BLAKE2b-256 0634b05b985e1aa48bb2e967331f1d9d7f6d5a6306a48b837387aef55c438099

See more details on using hashes here.

File details

Details for the file zombie_squirrel-0.25.0-py3-none-any.whl.

File metadata

File hashes

Hashes for zombie_squirrel-0.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be5a1dc9059a78b1b5139fc061acfff837070a17b49cde1d3cb87f00099ceb76
MD5 108de2cf7856c96b4e3261faf7d45c0f
BLAKE2b-256 0909b9acbe2c6db3e32a6d519bc5bf9b076d65a790ee54d89329f3864ed6acd5

See more details on using hashes here.

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