Skip to content

Commit

Permalink
Merge branch 'main' into test_threads
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBer78 committed Dec 19, 2024
2 parents 9edab09 + bc1ac9b commit 73c32cc
Show file tree
Hide file tree
Showing 22 changed files with 2,547 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- LLM evaluation logic
- Integrated Alembic for managing chat history migrations
- Tool implementations without langchain or langgraph dependencies
- Unit tests for the migrated tools
- CRUDs.
- BlueNaas CRUD tools
- Tests for threads module
Expand Down
5 changes: 3 additions & 2 deletions swarm_copy/tools/get_morpho_tool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Get Morpho tool."""

import logging
from pathlib import Path
from typing import Any, ClassVar

from pydantic import BaseModel, Field
Expand Down Expand Up @@ -30,8 +31,8 @@ class GetMorphoMetadata(BaseMetadata):
knowledge_graph_url: str
token: str
morpho_search_size: int
brainregion_path: str
celltypes_path: str
brainregion_path: str | Path
celltypes_path: str | Path


class KnowledgeGraphOutput(BaseModel):
Expand Down
3 changes: 2 additions & 1 deletion swarm_copy/tools/kg_morpho_features_tool.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""KG Morpho Feature tool."""

import logging
from pathlib import Path
from typing import Any, ClassVar, Literal

from pydantic import BaseModel, Field, model_validator
Expand Down Expand Up @@ -151,7 +152,7 @@ class KGMorphoFeatureMetadata(BaseMetadata):
knowledge_graph_url: str
token: str
kg_morpho_feature_search_size: int
brainregion_path: str
brainregion_path: str | Path


class KGMorphoFeatureOutput(BaseModel):
Expand Down
Binary file added swarm_copy_tests/data/99111002.nwb
Binary file not shown.
201 changes: 201 additions & 0 deletions swarm_copy_tests/data/get_traces.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
{
"hits": {
"hits": [
{
"_id": "https://bbp.epfl.ch/data/demo/morpho-demo/1761e604-03fc-452b-9bf2-2214782bb751",
"_index": "nexus_search_d067e019-1398-4eb8-9e28-3af8a717dcd7_41b1545a-cb2e-4848-8c74-195ec79f7bd3_18",
"_score": 6.0860696,
"_source": {
"@id": "https://bbp.epfl.ch/data/demo/morpho-demo/1761e604-03fc-452b-9bf2-2214782bb751",
"@type": [
"https://neuroshapes.org/Trace",
"https://bbp.epfl.ch/ontologies/core/bmo/ExperimentalTrace"
],
"brainRegion": {
"@id": "http://api.brain-map.org/api/v2/data/Structure/382",
"idLabel": "http://api.brain-map.org/api/v2/data/Structure/382|Field CA1",
"identifier": "http://api.brain-map.org/api/v2/data/Structure/382",
"label": "Field CA1"
},
"contributors": [
{
"@id": "https://bbp.epfl.ch/neurosciencegraph/data/859a20a2-9eea-4ab5-9504-d080c3c79311",
"@type": [
"http://www.w3.org/ns/prov#Agent",
"http://schema.org/Person"
],
"idLabel": "https://bbp.epfl.ch/neurosciencegraph/data/859a20a2-9eea-4ab5-9504-d080c3c79311|Zsolt Kohus",
"label": "Zsolt Kohus"
}
],
"createdAt": "2024-04-09T21:47:08.569Z",
"createdBy": "https://bbp.epfl.ch/nexus/v1/realms/bbp/users/budd",
"deprecated": false,
"derivation": [
{
"@type": [
"http://www.w3.org/ns/prov#Entity",
"https://neuroshapes.org/PatchedCell"
],
"identifier": "https://bbp.epfl.ch/data/data/demo/morpho-demo/7173ea54-8e59-478d-85f3-ff86246ef22b",
"label": "s160106_0201"
}
],
"distribution": [
{
"contentSize": 4919928,
"contentUrl": "https://bbp.epfl.ch/nexus/v1/files/demo/morpho-demo/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdata%2Fdemo%2Fmorpho-demo%2F01dffb7b-1122-4e1a-9acf-837e683da4ba",
"encodingFormat": "application/nwb",
"label": "s160106_02.nwb"
}
],
"generation": {
"@id": "https://bbp.epfl.ch/data/demo/morpho-demo/d857ff82-b558-4117-b643-74d44dbda5e6",
"endedAt": "2016-01-06T23:59:00.000Z",
"startedAt": "2016-01-06T00:00:00.000Z"
},
"image": [
{
"@id": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdata%2Fdemo%2Fmorpho-demo%2Fc1ef69e4-0073-481d-9446-fcfd7b5b5f7a",
"about": "https://neuroshapes.org/StimulationTrace",
"identifier": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdata%2Fdemo%2Fmorpho-demo%2Fc1ef69e4-0073-481d-9446-fcfd7b5b5f7a",
"repetition": 0,
"stimulusType": "square"
},
{
"@id": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdata%2Fdemo%2Fmorpho-demo%2F6fd03e92-b2ae-4ab8-8c9e-f0ff52d20a0d",
"about": "https://neuroshapes.org/ResponseTrace",
"identifier": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdata%2Fdemo%2Fmorpho-demo%2F6fd03e92-b2ae-4ab8-8c9e-f0ff52d20a0d",
"repetition": 0,
"stimulusType": "square"
}
],
"name": "s160106_02",
"project": {
"@id": "https://bbp.epfl.ch/nexus/v1/projects/demo/morpho-demo",
"identifier": "https://bbp.epfl.ch/nexus/v1/projects/demo/morpho-demo",
"label": "demo/morpho-demo"
},
"subjectAge": {
"label": "59 days Post-natal",
"period": "Post-natal",
"unit": "days",
"value": 59
},
"subjectSpecies": {
"@id": "http://purl.obolibrary.org/obo/NCBITaxon_10090",
"identifier": "http://purl.obolibrary.org/obo/NCBITaxon_10090",
"label": "Mus musculus"
},
"updatedAt": "2024-04-10T08:40:23.039Z",
"updatedBy": "https://bbp.epfl.ch/nexus/v1/realms/bbp/users/cgonzale",
"_self": "https://bbp.epfl.ch/nexus/v1/resources/demo/morpho-demo/_/https:%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2F1761e604-03fc-452b-9bf2-2214782bb751"
}
},
{
"_id": "https://bbp.epfl.ch/data/demo/morpho-demo/5f710291-9aac-45d0-94ff-d3d318c6ba2f",
"_index": "nexus_search_d067e019-1398-4eb8-9e28-3af8a717dcd7_41b1545a-cb2e-4848-8c74-195ec79f7bd3_18",
"_score": 6.0860696,
"_source": {
"@id": "https://bbp.epfl.ch/data/demo/morpho-demo/5f710291-9aac-45d0-94ff-d3d318c6ba2f",
"@type": [
"https://neuroshapes.org/Trace",
"https://bbp.epfl.ch/ontologies/core/bmo/ExperimentalTrace"
],
"brainRegion": {
"@id": "http://api.brain-map.org/api/v2/data/Structure/382",
"idLabel": "http://api.brain-map.org/api/v2/data/Structure/382|Field CA1",
"identifier": "http://api.brain-map.org/api/v2/data/Structure/382",
"label": "Field CA1"
},
"contributors": [
{
"@id": "https://bbp.epfl.ch/neurosciencegraph/data/859a20a2-9eea-4ab5-9504-d080c3c79311",
"@type": [
"http://www.w3.org/ns/prov#Agent",
"http://schema.org/Person"
],
"idLabel": "https://bbp.epfl.ch/neurosciencegraph/data/859a20a2-9eea-4ab5-9504-d080c3c79311|Zsolt Kohus",
"label": "Zsolt Kohus"
}
],
"createdAt": "2024-04-10T13:58:37.803Z",
"createdBy": "https://bbp.epfl.ch/nexus/v1/realms/bbp/users/budd",
"deprecated": false,
"derivation": [
{
"@type": [
"https://neuroshapes.org/PatchedCell",
"http://www.w3.org/ns/prov#Entity"
],
"identifier": "https://bbp.epfl.ch/data/demo/morpho-demo/c5c68107-39e5-4124-8681-8a644ab0f8ce",
"label": "s160106_0201"
}
],
"distribution": [
{
"contentSize": 4919928,
"contentUrl": "https://bbp.epfl.ch/nexus/v1/files/demo/morpho-demo/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2Ff759098b-3db5-4236-a577-eac23191e063",
"encodingFormat": "application/nwb",
"label": "s160106_02.nwb"
}
],
"generation": {
"@id": "https://bbp.epfl.ch/data/demo/morpho-demo/d47968ad-7644-4153-9bf5-a68277f9e17e",
"endedAt": "2016-01-06T23:59:00.000Z",
"startedAt": "2016-01-06T00:00:00.000Z"
},
"image": [
{
"@id": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2F835b1f06-c688-4771-9e45-c9c091666a8d",
"about": "https://neuroshapes.org/ResponseTrace",
"identifier": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2F835b1f06-c688-4771-9e45-c9c091666a8d",
"repetition": 0,
"stimulusType": "square"
},
{
"@id": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2Fde25efaf-6f6a-4245-a5a5-eeed4eddc83e",
"about": "https://neuroshapes.org/StimulationTrace",
"identifier": "https://bbp.epfl.ch/neurosciencegraph/data/https%3A%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2Fde25efaf-6f6a-4245-a5a5-eeed4eddc83e",
"repetition": 0,
"stimulusType": "square"
}
],
"name": "s160106_02",
"project": {
"@id": "https://bbp.epfl.ch/nexus/v1/projects/demo/morpho-demo",
"identifier": "https://bbp.epfl.ch/nexus/v1/projects/demo/morpho-demo",
"label": "demo/morpho-demo"
},
"subjectAge": {
"label": "59 days Post-natal",
"period": "Post-natal",
"unit": "days",
"value": 59
},
"subjectSpecies": {
"@id": "http://purl.obolibrary.org/obo/NCBITaxon_10090",
"identifier": "http://purl.obolibrary.org/obo/NCBITaxon_10090",
"label": "Mus musculus"
},
"updatedAt": "2024-04-10T13:58:37.803Z",
"updatedBy": "https://bbp.epfl.ch/nexus/v1/realms/bbp/users/budd",
"_self": "https://bbp.epfl.ch/nexus/v1/resources/demo/morpho-demo/_/https:%2F%2Fbbp.epfl.ch%2Fdata%2Fdemo%2Fmorpho-demo%2F5f710291-9aac-45d0-94ff-d3d318c6ba2f"
}
}
],
"max_score": 6.0860696,
"total": {
"relation": "eq",
"value": 1905
}
},
"timed_out": false,
"took": 65,
"_shards": {
"failed": 0,
"skipped": 664,
"successful": 742,
"total": 742
}
}
Loading

0 comments on commit 73c32cc

Please sign in to comment.