zombie-squirrel 0.4.7__tar.gz → 0.5.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.
Files changed (20) hide show
  1. {zombie_squirrel-0.4.7/src/zombie_squirrel.egg-info → zombie_squirrel-0.5.0}/PKG-INFO +2 -2
  2. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/README.md +1 -1
  3. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel/__init__.py +1 -1
  4. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel/squirrels.py +18 -1
  5. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0/src/zombie_squirrel.egg-info}/PKG-INFO +2 -2
  6. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/LICENSE +0 -0
  7. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/pyproject.toml +0 -0
  8. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/setup.cfg +0 -0
  9. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/setup.py +0 -0
  10. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel/acorns.py +0 -0
  11. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel/sync.py +0 -0
  12. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel/utils.py +0 -0
  13. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel.egg-info/SOURCES.txt +0 -0
  14. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel.egg-info/dependency_links.txt +0 -0
  15. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel.egg-info/requires.txt +0 -0
  16. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/src/zombie_squirrel.egg-info/top_level.txt +0 -0
  17. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/tests/test_acorns.py +0 -0
  18. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/tests/test_squirrels.py +0 -0
  19. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/tests/test_sync.py +0 -0
  20. {zombie_squirrel-0.4.7 → zombie_squirrel-0.5.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zombie-squirrel
3
- Version: 0.4.7
3
+ Version: 0.5.0
4
4
  Summary: Generated from aind-library-template
5
5
  Author: Allen Institute for Neural Dynamics
6
6
  License: MIT
@@ -17,7 +17,7 @@ Dynamic: license-file
17
17
  ![Code Style](https://img.shields.io/badge/code%20style-black-black)
18
18
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
19
19
  ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
20
- ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
20
+ ![Coverage](https://img.shields.io/badge/coverage-99%25-brightgreen)
21
21
  ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
22
22
 
23
23
  <img src="zombie-squirrel_logo.png" width="400" alt="Logo (image from ChatGPT)">
@@ -4,7 +4,7 @@
4
4
  ![Code Style](https://img.shields.io/badge/code%20style-black-black)
5
5
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
6
6
  ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
7
- ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
7
+ ![Coverage](https://img.shields.io/badge/coverage-99%25-brightgreen)
8
8
  ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
9
9
 
10
10
  <img src="zombie-squirrel_logo.png" width="400" alt="Logo (image from ChatGPT)">
@@ -3,7 +3,7 @@
3
3
  Provides functions to fetch and cache project names, subject IDs, and asset
4
4
  metadata from the AIND metadata database with support for multiple backends."""
5
5
 
6
- __version__ = "0.4.7"
6
+ __version__ = "0.5.0"
7
7
 
8
8
  from zombie_squirrel.squirrels import ( # noqa: F401
9
9
  asset_basics,
@@ -143,6 +143,9 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
143
143
  "subject.subject_id",
144
144
  "acquisition.acquisition_start_time",
145
145
  "acquisition.acquisition_end_time",
146
+ "processing.data_processes.start_date_time",
147
+ "subject.subject_details.genotype",
148
+ "location",
146
149
  ]
147
150
 
148
151
  if df.empty or force_update:
@@ -157,6 +160,9 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
157
160
  "subject_id",
158
161
  "acquisition_start_time",
159
162
  "acquisition_end_time",
163
+ "process_date",
164
+ "genotype",
165
+ "location",
160
166
  ]
161
167
  )
162
168
  client = MetadataDbClient(
@@ -183,7 +189,7 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
183
189
  asset_records = []
184
190
  for i in range(0, len(keep_ids), BATCH_SIZE):
185
191
  logging.info(f"Fetching asset basics batch {i // BATCH_SIZE + 1}...")
186
- batch_ids = keep_ids[i : i + BATCH_SIZE]
192
+ batch_ids = keep_ids[i: i + BATCH_SIZE]
187
193
  batch_records = client.retrieve_docdb_records(
188
194
  filter_query={"_id": {"$in": batch_ids}},
189
195
  projection={field: 1 for field in FIELDS + ["_id", "_last_modified"]},
@@ -197,6 +203,14 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
197
203
  modalities = record.get("data_description", {}).get("modalities", [])
198
204
  modality_abbreviations = [modality["abbreviation"] for modality in modalities if "abbreviation" in modality]
199
205
  modality_abbreviations_str = ", ".join(modality_abbreviations)
206
+
207
+ # Get the process date, convert to YYYY-MM-DD if present
208
+ process_datetime = record.get("processing", {}).get("data_processes", [{}])[-1].get("start_date_time", None)
209
+ if process_datetime:
210
+ process_date = process_datetime.split("T")[0]
211
+ else:
212
+ process_date = None
213
+
200
214
  flat_record = {
201
215
  "_id": record["_id"],
202
216
  "_last_modified": record.get("_last_modified", None),
@@ -206,6 +220,9 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
206
220
  "subject_id": record.get("subject", {}).get("subject_id", None),
207
221
  "acquisition_start_time": record.get("acquisition", {}).get("acquisition_start_time", None),
208
222
  "acquisition_end_time": record.get("acquisition", {}).get("acquisition_end_time", None),
223
+ "process_date": process_date,
224
+ "genotype": record.get("subject", {}).get("subject_details", {}).get("genotype", None),
225
+ "location": record.get("location", None),
209
226
  }
210
227
  records.append(flat_record)
211
228
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: zombie-squirrel
3
- Version: 0.4.7
3
+ Version: 0.5.0
4
4
  Summary: Generated from aind-library-template
5
5
  Author: Allen Institute for Neural Dynamics
6
6
  License: MIT
@@ -17,7 +17,7 @@ Dynamic: license-file
17
17
  ![Code Style](https://img.shields.io/badge/code%20style-black-black)
18
18
  [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
19
19
  ![Interrogate](https://img.shields.io/badge/interrogate-100.0%25-brightgreen)
20
- ![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)
20
+ ![Coverage](https://img.shields.io/badge/coverage-99%25-brightgreen)
21
21
  ![Python](https://img.shields.io/badge/python->=3.10-blue?logo=python)
22
22
 
23
23
  <img src="zombie-squirrel_logo.png" width="400" alt="Logo (image from ChatGPT)">
File without changes