zombie-squirrel 0.8.4__tar.gz → 0.8.5__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.
- {zombie_squirrel-0.8.4/src/zombie_squirrel.egg-info → zombie_squirrel-0.8.5}/PKG-INFO +2 -2
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/README.md +1 -1
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/__init__.py +1 -1
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/asset_basics.py +11 -3
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/raw_to_derived.py +6 -2
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/source_data.py +6 -2
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/unique_project_names.py +6 -2
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/unique_subject_ids.py +6 -2
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorns.py +4 -13
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/utils.py +12 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5/src/zombie_squirrel.egg-info}/PKG-INFO +2 -2
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/LICENSE +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/pyproject.toml +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/setup.cfg +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/setup.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/__init__.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/forest.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/sync.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel.egg-info/SOURCES.txt +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel.egg-info/dependency_links.txt +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel.egg-info/requires.txt +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel.egg-info/top_level.txt +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/tests/test_acorns.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/tests/test_sync.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/tests/test_trees.py +0 -0
- {zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zombie-squirrel
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.5
|
|
4
4
|
Summary: Generated from aind-library-template
|
|
5
5
|
Author: Allen Institute for Neural Dynamics
|
|
6
6
|
License: MIT
|
|
@@ -21,7 +21,7 @@ Dynamic: license-file
|
|
|
21
21
|

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

|
|
24
|
-

|
|
25
25
|

|
|
26
26
|
|
|
27
27
|
<img src="zombie-squirrel_logo.png" width="400" alt="Logo (image from ChatGPT)">
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

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

|
|
7
|
-

|
|
8
8
|

|
|
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.8.
|
|
6
|
+
__version__ = "0.8.5"
|
|
7
7
|
|
|
8
8
|
from zombie_squirrel.acorn_contents.asset_basics import asset_basics # noqa: F401
|
|
9
9
|
from zombie_squirrel.acorn_contents.raw_to_derived import raw_to_derived # noqa: F401
|
{zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/asset_basics.py
RENAMED
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from aind_data_access_api.document_db import MetadataDbClient
|
|
7
7
|
|
|
8
8
|
import zombie_squirrel.acorns as acorns
|
|
9
|
-
from zombie_squirrel.utils import setup_logging
|
|
9
|
+
from zombie_squirrel.utils import setup_logging, SquirrelMessage
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@acorns.register_acorn(acorns.NAMES["basics"])
|
|
@@ -45,7 +45,11 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
|
|
|
45
45
|
|
|
46
46
|
if df.empty or force_update:
|
|
47
47
|
setup_logging()
|
|
48
|
-
logging.info(
|
|
48
|
+
logging.info(SquirrelMessage(
|
|
49
|
+
tree=acorns.TREE.__class__.__name__,
|
|
50
|
+
acorn=acorns.NAMES["basics"],
|
|
51
|
+
message="Updating cache"
|
|
52
|
+
).to_json())
|
|
49
53
|
df = pd.DataFrame(
|
|
50
54
|
columns=[
|
|
51
55
|
"_id",
|
|
@@ -85,7 +89,11 @@ def asset_basics(force_update: bool = False) -> pd.DataFrame:
|
|
|
85
89
|
BATCH_SIZE = 100
|
|
86
90
|
asset_records = []
|
|
87
91
|
for i in range(0, len(keep_ids), BATCH_SIZE):
|
|
88
|
-
logging.info(
|
|
92
|
+
logging.info(SquirrelMessage(
|
|
93
|
+
tree=acorns.TREE.__class__.__name__,
|
|
94
|
+
acorn=acorns.NAMES["basics"],
|
|
95
|
+
message=f"Fetching batch {i // BATCH_SIZE + 1}"
|
|
96
|
+
).to_json())
|
|
89
97
|
batch_ids = keep_ids[i: i + BATCH_SIZE]
|
|
90
98
|
batch_records = client.retrieve_docdb_records(
|
|
91
99
|
filter_query={"_id": {"$in": batch_ids}},
|
{zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/raw_to_derived.py
RENAMED
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from aind_data_access_api.document_db import MetadataDbClient
|
|
7
7
|
|
|
8
8
|
import zombie_squirrel.acorns as acorns
|
|
9
|
-
from zombie_squirrel.utils import setup_logging
|
|
9
|
+
from zombie_squirrel.utils import setup_logging, SquirrelMessage
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@acorns.register_acorn(acorns.NAMES["r2d"])
|
|
@@ -30,7 +30,11 @@ def raw_to_derived(force_update: bool = False) -> pd.DataFrame:
|
|
|
30
30
|
|
|
31
31
|
if df.empty or force_update:
|
|
32
32
|
setup_logging()
|
|
33
|
-
logging.info(
|
|
33
|
+
logging.info(SquirrelMessage(
|
|
34
|
+
tree=acorns.TREE.__class__.__name__,
|
|
35
|
+
acorn=acorns.NAMES["r2d"],
|
|
36
|
+
message="Updating cache"
|
|
37
|
+
).to_json())
|
|
34
38
|
client = MetadataDbClient(
|
|
35
39
|
host=acorns.API_GATEWAY_HOST,
|
|
36
40
|
version="v2",
|
{zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/source_data.py
RENAMED
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from aind_data_access_api.document_db import MetadataDbClient
|
|
7
7
|
|
|
8
8
|
import zombie_squirrel.acorns as acorns
|
|
9
|
-
from zombie_squirrel.utils import setup_logging
|
|
9
|
+
from zombie_squirrel.utils import setup_logging, SquirrelMessage
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@acorns.register_acorn(acorns.NAMES["d2r"])
|
|
@@ -30,7 +30,11 @@ def source_data(force_update: bool = False) -> pd.DataFrame:
|
|
|
30
30
|
|
|
31
31
|
if df.empty or force_update:
|
|
32
32
|
setup_logging()
|
|
33
|
-
logging.info(
|
|
33
|
+
logging.info(SquirrelMessage(
|
|
34
|
+
tree=acorns.TREE.__class__.__name__,
|
|
35
|
+
acorn=acorns.NAMES["d2r"],
|
|
36
|
+
message="Updating cache"
|
|
37
|
+
).to_json())
|
|
34
38
|
client = MetadataDbClient(
|
|
35
39
|
host=acorns.API_GATEWAY_HOST,
|
|
36
40
|
version="v2",
|
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from aind_data_access_api.document_db import MetadataDbClient
|
|
7
7
|
|
|
8
8
|
import zombie_squirrel.acorns as acorns
|
|
9
|
-
from zombie_squirrel.utils import setup_logging
|
|
9
|
+
from zombie_squirrel.utils import setup_logging, SquirrelMessage
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@acorns.register_acorn(acorns.NAMES["upn"])
|
|
@@ -30,7 +30,11 @@ def unique_project_names(force_update: bool = False) -> list[str]:
|
|
|
30
30
|
|
|
31
31
|
if df.empty or force_update:
|
|
32
32
|
setup_logging()
|
|
33
|
-
logging.info(
|
|
33
|
+
logging.info(SquirrelMessage(
|
|
34
|
+
tree=acorns.TREE.__class__.__name__,
|
|
35
|
+
acorn=acorns.NAMES["upn"],
|
|
36
|
+
message="Updating cache"
|
|
37
|
+
).to_json())
|
|
34
38
|
client = MetadataDbClient(
|
|
35
39
|
host=acorns.API_GATEWAY_HOST,
|
|
36
40
|
version="v2",
|
|
@@ -6,7 +6,7 @@ import pandas as pd
|
|
|
6
6
|
from aind_data_access_api.document_db import MetadataDbClient
|
|
7
7
|
|
|
8
8
|
import zombie_squirrel.acorns as acorns
|
|
9
|
-
from zombie_squirrel.utils import setup_logging
|
|
9
|
+
from zombie_squirrel.utils import setup_logging, SquirrelMessage
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
@acorns.register_acorn(acorns.NAMES["usi"])
|
|
@@ -30,7 +30,11 @@ def unique_subject_ids(force_update: bool = False) -> list[str]:
|
|
|
30
30
|
|
|
31
31
|
if df.empty or force_update:
|
|
32
32
|
setup_logging()
|
|
33
|
-
logging.info(
|
|
33
|
+
logging.info(SquirrelMessage(
|
|
34
|
+
tree=acorns.TREE.__class__.__name__,
|
|
35
|
+
acorn=acorns.NAMES["usi"],
|
|
36
|
+
message="Updating cache"
|
|
37
|
+
).to_json())
|
|
34
38
|
client = MetadataDbClient(
|
|
35
39
|
host=acorns.API_GATEWAY_HOST,
|
|
36
40
|
version="v2",
|
|
@@ -16,12 +16,14 @@ API_GATEWAY_HOST = "api.allenneuraldynamics.org"
|
|
|
16
16
|
|
|
17
17
|
forest_type = os.getenv("FOREST_TYPE", "memory").lower()
|
|
18
18
|
|
|
19
|
-
if forest_type == "
|
|
19
|
+
if forest_type == "s3": # pragma: no cover
|
|
20
20
|
logging.info("Using S3 forest for caching")
|
|
21
21
|
TREE = S3Tree()
|
|
22
|
-
|
|
22
|
+
elif forest_type == "memory":
|
|
23
23
|
logging.info("Using in-memory forest for caching")
|
|
24
24
|
TREE = MemoryTree()
|
|
25
|
+
else:
|
|
26
|
+
raise ValueError(f"Unknown FOREST_TYPE: {forest_type}")
|
|
25
27
|
|
|
26
28
|
# --- Acorn registry and names -----------------------------------------------------
|
|
27
29
|
|
|
@@ -45,14 +47,3 @@ def register_acorn(name: str):
|
|
|
45
47
|
return func
|
|
46
48
|
|
|
47
49
|
return decorator
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
# Import acorn_contents modules to trigger registration
|
|
51
|
-
# This must be done after the registry and decorator are defined
|
|
52
|
-
from zombie_squirrel.acorn_contents import ( # noqa: E402, F401
|
|
53
|
-
asset_basics,
|
|
54
|
-
raw_to_derived,
|
|
55
|
-
source_data,
|
|
56
|
-
unique_project_names,
|
|
57
|
-
unique_subject_ids,
|
|
58
|
-
)
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"""Utility functions for zombie-squirrel package."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
from pydantic import BaseModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SquirrelMessage(BaseModel):
|
|
8
|
+
"""Structured logging message for zombie-squirrel operations."""
|
|
9
|
+
tree: str
|
|
10
|
+
acorn: str
|
|
11
|
+
message: str
|
|
12
|
+
|
|
13
|
+
def to_json(self) -> str:
|
|
14
|
+
"""Convert message to JSON string."""
|
|
15
|
+
return self.model_dump_json()
|
|
4
16
|
|
|
5
17
|
|
|
6
18
|
def setup_logging():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: zombie-squirrel
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.5
|
|
4
4
|
Summary: Generated from aind-library-template
|
|
5
5
|
Author: Allen Institute for Neural Dynamics
|
|
6
6
|
License: MIT
|
|
@@ -21,7 +21,7 @@ Dynamic: license-file
|
|
|
21
21
|

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

|
|
24
|
-

|
|
25
25
|

|
|
26
26
|
|
|
27
27
|
<img src="zombie-squirrel_logo.png" width="400" alt="Logo (image from ChatGPT)">
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel/acorn_contents/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{zombie_squirrel-0.8.4 → zombie_squirrel-0.8.5}/src/zombie_squirrel.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|