biodata-cache 0.32.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- biodata_cache-0.32.0/LICENSE +21 -0
- biodata_cache-0.32.0/PKG-INFO +113 -0
- biodata_cache-0.32.0/README.md +96 -0
- biodata_cache-0.32.0/pyproject.toml +92 -0
- biodata_cache-0.32.0/setup.cfg +4 -0
- biodata_cache-0.32.0/setup.py +6 -0
- biodata_cache-0.32.0/src/biodata_cache/__init__.py +32 -0
- biodata_cache-0.32.0/src/biodata_cache/backend.py +310 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/__init__.py +20 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/asset_basics.py +271 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/behavior_curriculum.py +170 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/custom.py +31 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/foraging_sessions.py +110 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/metadata_core.py +120 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/metadata_upgrade.py +150 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/platform_exaspim.py +171 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/platform_fib.py +197 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/platform_qc.py +196 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/platform_smartspim.py +274 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/qc.py +259 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/raw_to_derived.py +37 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/source_data.py +97 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/unique_genotypes.py +63 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/unique_project_names.py +62 -0
- biodata_cache-0.32.0/src/biodata_cache/cache_table_helpers/unique_subject_ids.py +62 -0
- biodata_cache-0.32.0/src/biodata_cache/models.py +40 -0
- biodata_cache-0.32.0/src/biodata_cache/registry.py +66 -0
- biodata_cache-0.32.0/src/biodata_cache/sync.py +186 -0
- biodata_cache-0.32.0/src/biodata_cache/utils.py +124 -0
- biodata_cache-0.32.0/src/biodata_cache.egg-info/PKG-INFO +113 -0
- biodata_cache-0.32.0/src/biodata_cache.egg-info/SOURCES.txt +41 -0
- biodata_cache-0.32.0/src/biodata_cache.egg-info/dependency_links.txt +1 -0
- biodata_cache-0.32.0/src/biodata_cache.egg-info/requires.txt +5 -0
- biodata_cache-0.32.0/src/biodata_cache.egg-info/top_level.txt +2 -0
- biodata_cache-0.32.0/src/zombie_squirrel/__init__.py +32 -0
- biodata_cache-0.32.0/tests/test_backend.py +246 -0
- biodata_cache-0.32.0/tests/test_backend_coverage.py +39 -0
- biodata_cache-0.32.0/tests/test_build_platform_qc.py +189 -0
- biodata_cache-0.32.0/tests/test_models.py +188 -0
- biodata_cache-0.32.0/tests/test_registry.py +22 -0
- biodata_cache-0.32.0/tests/test_sync.py +438 -0
- biodata_cache-0.32.0/tests/test_sync_coverage.py +49 -0
- biodata_cache-0.32.0/tests/test_utils.py +171 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Allen Institute for Neural Dynamics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: biodata-cache
|
|
3
|
+
Version: 0.32.0
|
|
4
|
+
Summary: Caching and synchronization for AIND metadata.
|
|
5
|
+
Author: Allen Institute for Neural Dynamics
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Requires-Python: <3.14,>=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Dist: duckdb
|
|
12
|
+
Requires-Dist: pyarrow
|
|
13
|
+
Requires-Dist: boto3
|
|
14
|
+
Requires-Dist: pandas>=2.2.0
|
|
15
|
+
Requires-Dist: aind-data-access-api[docdb]
|
|
16
|
+
Dynamic: license-file
|
|
17
|
+
|
|
18
|
+
# biodata-cache
|
|
19
|
+
|
|
20
|
+
[](LICENSE)
|
|
21
|
+

|
|
22
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
23
|
+

|
|
24
|
+

|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
`biodata-cache` is a set of one-line functions that handle the entire process of caching and retrieving data (and metadata) from AIND data assets.
|
|
28
|
+
|
|
29
|
+
In the background, the ZOMBIE squirrel repackages data/metadata into dataframes and stores them on S3 in versioned folders (`data-asset-cache/bdc-v{version}/`), or in memory for testing. Each release writes to its own versioned folder, so older versions of the website remain accessible while new versions are deployed. A top-level `data-asset-cache/cache_versions.json` index lists all available version folders.
|
|
30
|
+
|
|
31
|
+
Important: this package is not at 1.0. It is changing *fast* and breaking changes are still occurring, although rarely. To reduce the chance of impact on your code the cache tables are versioned. This does mean that if you want the latest version of the tables you need to keep biodata-cache up-to-date, but it also means your code won't immediately break when I change the way the tables work.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pip install biodata-cache
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage
|
|
40
|
+
|
|
41
|
+
### Set backend
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
export BIODATA_CACHE_BACKEND='S3'
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Options are 'S3', 'MEMORY'.
|
|
48
|
+
|
|
49
|
+
### Fetch data
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from biodata_cache import unique_project_names
|
|
53
|
+
|
|
54
|
+
project_names = unique_project_names()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Cache tables
|
|
58
|
+
|
|
59
|
+
`get_cache_registry` returns the following information about all available cache tables. Paths are versioned — `{version}` is the installed `biodata-cache` package version (e.g. `0.27.3`).
|
|
60
|
+
|
|
61
|
+
| Table | Description | Location | Type | Partitioned | Columns |
|
|
62
|
+
| ----- | ----------- | -------- | ---- | ----------- | ------- |
|
|
63
|
+
| `unique_project_names` | Unique project names across all assets | `s3://allen-data-views/data-asset-cache/bdc-v{version}/unique_project_names.pqt` | metadata | False | `project_name` |
|
|
64
|
+
| `unique_subject_ids` | Unique subject_ids across all assets | `s3://allen-data-views/data-asset-cache/bdc-v{version}/unique_subject_ids.pqt` | metadata | False | `subject_id` |
|
|
65
|
+
| `unique_genotypes` | Unique genotypes across all assets where `subject.subject_details.genotype` is present | `s3://allen-data-views/data-asset-cache/bdc-v{version}/unique_genotypes.pqt` | metadata | False | `genotype` |
|
|
66
|
+
| `asset_basics` | Commonly used asset metadata, one row per data asset | `s3://allen-data-views/data-asset-cache/bdc-v{version}/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`, `experimenters_normalized`, `instrument_id`, `instrument_id_normalized`, `investigators`, `investigators_normalized` |
|
|
67
|
+
| `source_data` | Mapping from derived asset names to their source raw asset names | `s3://allen-data-views/data-asset-cache/bdc-v{version}/source_data.pqt` | metadata | False | `name`, `source_data`, `pipeline_name`, `processing_time` |
|
|
68
|
+
| `quality_control` | Quality control table with one row per QC metric, partitioned by subject_id | `s3://allen-data-views/data-asset-cache/bdc-v{version}/qc/` | asset | True (by `subject_id`) | `name`, `stage`, `modality`, `value`, `status`, `asset_name` |
|
|
69
|
+
| `platform_qc` | Tag-level QC statuses aggregated per platform, one row per asset/tag combination | `s3://allen-data-views/data-asset-cache/bdc-v{version}/platform_qc/` | platform | True (by `platform`) | `asset_name`, `tag`, `status`, `timestamp`, `instrument_id_normalized`, `experimenters_normalized` |
|
|
70
|
+
| `assets_smartspim` | SmartSPIM assets with processing status and neuroglancer links, one row per (asset, channel) | `s3://allen-data-views/data-asset-cache/bdc-v{version}/assets_smartspim.pqt` | metadata | False | `name`, `raw_name`, `processed`, `institution`, `processing_end_time`, `stitched_link`, `raw_link`, `channel`, `segmentation_link`, `quantification_link`, `alignment_link` |
|
|
71
|
+
| `platform_fib` | Fiber photometry assets in long form, one row per asset/fiber/channel combination | `s3://allen-data-views/data-asset-cache/bdc-v{version}/platform_fib.pqt` | metadata | False | `asset_name`, `fiber`, `patch_cord`, `channel`, `intended_measurement`, `targeted_structure` |
|
|
72
|
+
| `foraging_sessions` | Foraging behavior sessions with key performance metrics, one row per session | `s3://allen-data-views/data-asset-cache/bdc-v{version}/foraging_sessions.pqt` | metadata | False | `subject_id`, `session_date`, `session`, `nwb_suffix`, `rig`, `trainer`, `trainer_normalized`, `task`, `curriculum_name`, `curriculum_version`, `current_stage_actual`, `foraging_eff`, `foraging_eff_random_seed`, `finished_trials`, `finished_rate`, `total_trials`, `bias_naive` |
|
|
73
|
+
| `behavior_curriculum` | Behavior assets with curriculum name and stage, one row per behavior asset | `s3://allen-data-views/data-asset-cache/bdc-v{version}/behavior_curriculum.pqt` | asset | False | `asset_name`, `curriculum_name`, `stage_name`, `stage_node_id` |
|
|
74
|
+
|
|
75
|
+
Hive-partitioned tables use `key=value` directory segments, enabling DuckDB queries like:
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import duckdb
|
|
79
|
+
duckdb.query("""
|
|
80
|
+
SELECT * FROM read_parquet(
|
|
81
|
+
's3://allen-data-views/data-asset-cache/bdc-v0.27.3/qc/**',
|
|
82
|
+
hive_partitioning=true,
|
|
83
|
+
union_by_name=true
|
|
84
|
+
)
|
|
85
|
+
""")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The `cache_registry.json` registry lives at `s3://allen-data-views/data-asset-cache/bdc-v{version}/cache_registry.json`. The top-level `s3://allen-data-views/data-asset-cache/cache_versions.json` lists all available version folders as a JSON array.
|
|
89
|
+
|
|
90
|
+
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.
|
|
91
|
+
|
|
92
|
+
### Custom cache table
|
|
93
|
+
|
|
94
|
+
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.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
from biodata_cache import custom
|
|
98
|
+
import pandas as pd
|
|
99
|
+
|
|
100
|
+
df = pd.DataFrame({"col": [1, 2, 3]})
|
|
101
|
+
custom("my_data", df)
|
|
102
|
+
|
|
103
|
+
retrieved_df = custom("my_data")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Update all cache tables
|
|
107
|
+
|
|
108
|
+
We run a nightly capsule on Code Ocean with this code to update all cache tables (not the custom ones).
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
from biodata_cache.sync import update_all_tables
|
|
112
|
+
update_all_tables()
|
|
113
|
+
```
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# biodata-cache
|
|
2
|
+
|
|
3
|
+
[](LICENSE)
|
|
4
|
+

|
|
5
|
+
[](https://github.com/semantic-release/semantic-release)
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
|
|
10
|
+
`biodata-cache` is a set of one-line functions that handle the entire process of caching and retrieving data (and metadata) from AIND data assets.
|
|
11
|
+
|
|
12
|
+
In the background, the ZOMBIE squirrel repackages data/metadata into dataframes and stores them on S3 in versioned folders (`data-asset-cache/bdc-v{version}/`), or in memory for testing. Each release writes to its own versioned folder, so older versions of the website remain accessible while new versions are deployed. A top-level `data-asset-cache/cache_versions.json` index lists all available version folders.
|
|
13
|
+
|
|
14
|
+
Important: this package is not at 1.0. It is changing *fast* and breaking changes are still occurring, although rarely. To reduce the chance of impact on your code the cache tables are versioned. This does mean that if you want the latest version of the tables you need to keep biodata-cache up-to-date, but it also means your code won't immediately break when I change the way the tables work.
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install biodata-cache
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
### Set backend
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
export BIODATA_CACHE_BACKEND='S3'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Options are 'S3', 'MEMORY'.
|
|
31
|
+
|
|
32
|
+
### Fetch data
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
from biodata_cache import unique_project_names
|
|
36
|
+
|
|
37
|
+
project_names = unique_project_names()
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Cache tables
|
|
41
|
+
|
|
42
|
+
`get_cache_registry` returns the following information about all available cache tables. Paths are versioned — `{version}` is the installed `biodata-cache` package version (e.g. `0.27.3`).
|
|
43
|
+
|
|
44
|
+
| Table | Description | Location | Type | Partitioned | Columns |
|
|
45
|
+
| ----- | ----------- | -------- | ---- | ----------- | ------- |
|
|
46
|
+
| `unique_project_names` | Unique project names across all assets | `s3://allen-data-views/data-asset-cache/bdc-v{version}/unique_project_names.pqt` | metadata | False | `project_name` |
|
|
47
|
+
| `unique_subject_ids` | Unique subject_ids across all assets | `s3://allen-data-views/data-asset-cache/bdc-v{version}/unique_subject_ids.pqt` | metadata | False | `subject_id` |
|
|
48
|
+
| `unique_genotypes` | Unique genotypes across all assets where `subject.subject_details.genotype` is present | `s3://allen-data-views/data-asset-cache/bdc-v{version}/unique_genotypes.pqt` | metadata | False | `genotype` |
|
|
49
|
+
| `asset_basics` | Commonly used asset metadata, one row per data asset | `s3://allen-data-views/data-asset-cache/bdc-v{version}/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`, `experimenters_normalized`, `instrument_id`, `instrument_id_normalized`, `investigators`, `investigators_normalized` |
|
|
50
|
+
| `source_data` | Mapping from derived asset names to their source raw asset names | `s3://allen-data-views/data-asset-cache/bdc-v{version}/source_data.pqt` | metadata | False | `name`, `source_data`, `pipeline_name`, `processing_time` |
|
|
51
|
+
| `quality_control` | Quality control table with one row per QC metric, partitioned by subject_id | `s3://allen-data-views/data-asset-cache/bdc-v{version}/qc/` | asset | True (by `subject_id`) | `name`, `stage`, `modality`, `value`, `status`, `asset_name` |
|
|
52
|
+
| `platform_qc` | Tag-level QC statuses aggregated per platform, one row per asset/tag combination | `s3://allen-data-views/data-asset-cache/bdc-v{version}/platform_qc/` | platform | True (by `platform`) | `asset_name`, `tag`, `status`, `timestamp`, `instrument_id_normalized`, `experimenters_normalized` |
|
|
53
|
+
| `assets_smartspim` | SmartSPIM assets with processing status and neuroglancer links, one row per (asset, channel) | `s3://allen-data-views/data-asset-cache/bdc-v{version}/assets_smartspim.pqt` | metadata | False | `name`, `raw_name`, `processed`, `institution`, `processing_end_time`, `stitched_link`, `raw_link`, `channel`, `segmentation_link`, `quantification_link`, `alignment_link` |
|
|
54
|
+
| `platform_fib` | Fiber photometry assets in long form, one row per asset/fiber/channel combination | `s3://allen-data-views/data-asset-cache/bdc-v{version}/platform_fib.pqt` | metadata | False | `asset_name`, `fiber`, `patch_cord`, `channel`, `intended_measurement`, `targeted_structure` |
|
|
55
|
+
| `foraging_sessions` | Foraging behavior sessions with key performance metrics, one row per session | `s3://allen-data-views/data-asset-cache/bdc-v{version}/foraging_sessions.pqt` | metadata | False | `subject_id`, `session_date`, `session`, `nwb_suffix`, `rig`, `trainer`, `trainer_normalized`, `task`, `curriculum_name`, `curriculum_version`, `current_stage_actual`, `foraging_eff`, `foraging_eff_random_seed`, `finished_trials`, `finished_rate`, `total_trials`, `bias_naive` |
|
|
56
|
+
| `behavior_curriculum` | Behavior assets with curriculum name and stage, one row per behavior asset | `s3://allen-data-views/data-asset-cache/bdc-v{version}/behavior_curriculum.pqt` | asset | False | `asset_name`, `curriculum_name`, `stage_name`, `stage_node_id` |
|
|
57
|
+
|
|
58
|
+
Hive-partitioned tables use `key=value` directory segments, enabling DuckDB queries like:
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import duckdb
|
|
62
|
+
duckdb.query("""
|
|
63
|
+
SELECT * FROM read_parquet(
|
|
64
|
+
's3://allen-data-views/data-asset-cache/bdc-v0.27.3/qc/**',
|
|
65
|
+
hive_partitioning=true,
|
|
66
|
+
union_by_name=true
|
|
67
|
+
)
|
|
68
|
+
""")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The `cache_registry.json` registry lives at `s3://allen-data-views/data-asset-cache/bdc-v{version}/cache_registry.json`. The top-level `s3://allen-data-views/data-asset-cache/cache_versions.json` lists all available version folders as a JSON array.
|
|
72
|
+
|
|
73
|
+
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.
|
|
74
|
+
|
|
75
|
+
### Custom cache table
|
|
76
|
+
|
|
77
|
+
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.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
from biodata_cache import custom
|
|
81
|
+
import pandas as pd
|
|
82
|
+
|
|
83
|
+
df = pd.DataFrame({"col": [1, 2, 3]})
|
|
84
|
+
custom("my_data", df)
|
|
85
|
+
|
|
86
|
+
retrieved_df = custom("my_data")
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Update all cache tables
|
|
90
|
+
|
|
91
|
+
We run a nightly capsule on Code Ocean with this code to update all cache tables (not the custom ones).
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
from biodata_cache.sync import update_all_tables
|
|
95
|
+
update_all_tables()
|
|
96
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "biodata-cache"
|
|
7
|
+
description = "Caching and synchronization for AIND metadata."
|
|
8
|
+
license = {text = "MIT"}
|
|
9
|
+
requires-python = ">=3.10,<3.14"
|
|
10
|
+
authors = [
|
|
11
|
+
{name = "Allen Institute for Neural Dynamics"}
|
|
12
|
+
]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3"
|
|
15
|
+
]
|
|
16
|
+
readme = "README.md"
|
|
17
|
+
dynamic = ["version"]
|
|
18
|
+
|
|
19
|
+
dependencies = [
|
|
20
|
+
'duckdb',
|
|
21
|
+
'pyarrow',
|
|
22
|
+
'boto3',
|
|
23
|
+
'pandas>=2.2.0',
|
|
24
|
+
'aind-data-access-api[docdb]',
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[dependency-groups]
|
|
28
|
+
dev = [
|
|
29
|
+
'ruff',
|
|
30
|
+
'coverage',
|
|
31
|
+
'interrogate',
|
|
32
|
+
'pre-commit',
|
|
33
|
+
'pytest',
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.packages.find]
|
|
37
|
+
where = ["src"]
|
|
38
|
+
|
|
39
|
+
[tool.setuptools.dynamic]
|
|
40
|
+
version = {attr = "biodata_cache.__version__"}
|
|
41
|
+
|
|
42
|
+
[tool.ruff]
|
|
43
|
+
line-length = 120
|
|
44
|
+
target-version = "py310"
|
|
45
|
+
exclude = [
|
|
46
|
+
".git",
|
|
47
|
+
"__pycache__",
|
|
48
|
+
"build",
|
|
49
|
+
".venv",
|
|
50
|
+
"venv",
|
|
51
|
+
".conda",
|
|
52
|
+
".eggs",
|
|
53
|
+
".hg",
|
|
54
|
+
".mypy_cache",
|
|
55
|
+
".tox",
|
|
56
|
+
"_build",
|
|
57
|
+
"dist",
|
|
58
|
+
".gitignore"
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# Choose what to enable: these roughly replace flake8, isort, etc.
|
|
63
|
+
lint.select = [
|
|
64
|
+
"E", # pycodestyle errors
|
|
65
|
+
"F", # pyflakes
|
|
66
|
+
"I", # isort rules
|
|
67
|
+
"B", # flake8-bugbear
|
|
68
|
+
"UP", # pyupgrade
|
|
69
|
+
]
|
|
70
|
+
lint.ignore = [
|
|
71
|
+
"E501", # line length (handled by formatter)
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
[tool.pytest.ini_options]
|
|
75
|
+
testpaths = ["tests"]
|
|
76
|
+
|
|
77
|
+
[tool.coverage.run]
|
|
78
|
+
omit = ["*__init__*"]
|
|
79
|
+
source = ["biodata_cache", "tests"]
|
|
80
|
+
|
|
81
|
+
[tool.coverage.report]
|
|
82
|
+
exclude_lines = [
|
|
83
|
+
"if __name__ == .__main__.:",
|
|
84
|
+
"^from .* import .*",
|
|
85
|
+
"^import .*",
|
|
86
|
+
"pragma: no cover"
|
|
87
|
+
]
|
|
88
|
+
fail_under = 100
|
|
89
|
+
|
|
90
|
+
[tool.interrogate]
|
|
91
|
+
exclude = ["setup.py", "docs", "build", ".conda"]
|
|
92
|
+
fail-under = 100
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Zombie-squirrel: caching and synchronization for AIND metadata.
|
|
2
|
+
|
|
3
|
+
Provides functions to fetch and cache project names, subject IDs, and asset
|
|
4
|
+
metadata from the AIND metadata database with support for multiple backends.
|
|
5
|
+
Also exposes get_cache_registry to retrieve the cache_registry.json registry of all
|
|
6
|
+
available cache tables and their metadata.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
__version__ = "0.32.0"
|
|
10
|
+
|
|
11
|
+
from biodata_cache.cache_table_helpers.asset_basics import asset_basics # noqa: F401
|
|
12
|
+
from biodata_cache.cache_table_helpers.behavior_curriculum import behavior_curriculum # noqa: F401
|
|
13
|
+
from biodata_cache.cache_table_helpers.custom import custom # noqa: F401
|
|
14
|
+
from biodata_cache.cache_table_helpers.foraging_sessions import foraging_sessions # noqa: F401
|
|
15
|
+
from biodata_cache.cache_table_helpers.metadata_upgrade import metadata_upgrade # noqa: F401
|
|
16
|
+
from biodata_cache.cache_table_helpers.platform_exaspim import platform_exaspim # noqa: F401
|
|
17
|
+
from biodata_cache.cache_table_helpers.platform_fib import platform_fib # noqa: F401
|
|
18
|
+
from biodata_cache.cache_table_helpers.platform_qc import platform_qc # noqa: F401
|
|
19
|
+
from biodata_cache.cache_table_helpers.platform_smartspim import assets_smartspim # noqa: F401
|
|
20
|
+
from biodata_cache.cache_table_helpers.qc import qc, qc_columns # noqa: F401
|
|
21
|
+
from biodata_cache.cache_table_helpers.raw_to_derived import raw_to_derived # noqa: F401
|
|
22
|
+
from biodata_cache.cache_table_helpers.source_data import source_data # noqa: F401
|
|
23
|
+
from biodata_cache.cache_table_helpers.unique_genotypes import ( # noqa: F401
|
|
24
|
+
unique_genotypes,
|
|
25
|
+
)
|
|
26
|
+
from biodata_cache.cache_table_helpers.unique_project_names import ( # noqa: F401
|
|
27
|
+
unique_project_names,
|
|
28
|
+
)
|
|
29
|
+
from biodata_cache.cache_table_helpers.unique_subject_ids import ( # noqa: F401
|
|
30
|
+
unique_subject_ids,
|
|
31
|
+
)
|
|
32
|
+
from biodata_cache.utils import get_cache_registry # noqa: F401
|