entitysdk 0.2.2__tar.gz → 0.2.4__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.
- {entitysdk-0.2.2/src/entitysdk.egg-info → entitysdk-0.2.4}/PKG-INFO +1 -1
- {entitysdk-0.2.2 → entitysdk-0.2.4}/examples/01_searching.ipynb +5 -4
- {entitysdk-0.2.2 → entitysdk-0.2.4}/examples/02_morphology.ipynb +1 -1
- {entitysdk-0.2.2 → entitysdk-0.2.4}/examples/03_contribution.ipynb +1 -3
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/client.py +1 -1
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/common.py +1 -1
- entitysdk-0.2.4/src/entitysdk/models/__init__.py +37 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/agent.py +6 -6
- entitysdk-0.2.4/src/entitysdk/models/brain_location.py +33 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/brain_region.py +3 -2
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/contribution.py +7 -2
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/core.py +1 -1
- entitysdk-0.2.4/src/entitysdk/models/electrical_cell_recording.py +92 -0
- entitysdk-0.2.4/src/entitysdk/models/emodel.py +89 -0
- entitysdk-0.2.4/src/entitysdk/models/entity.py +74 -0
- entitysdk-0.2.4/src/entitysdk/models/etype.py +28 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/ion_channel_model.py +1 -2
- entitysdk-0.2.4/src/entitysdk/models/license.py +33 -0
- entitysdk-0.2.4/src/entitysdk/models/memodel.py +96 -0
- entitysdk-0.2.4/src/entitysdk/models/morphology.py +54 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/mtype.py +2 -2
- entitysdk-0.2.4/src/entitysdk/models/subject.py +41 -0
- entitysdk-0.2.4/src/entitysdk/models/taxonomy.py +72 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/route.py +4 -1
- entitysdk-0.2.4/src/entitysdk/types.py +67 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/util.py +1 -1
- {entitysdk-0.2.2 → entitysdk-0.2.4/src/entitysdk.egg-info}/PKG-INFO +1 -1
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk.egg-info/SOURCES.txt +12 -1
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/integration/test_searching.py +15 -4
- entitysdk-0.2.4/tests/unit/models/data/electrical_cell_recording.json +123 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/data/ion_channel_model.json +6 -8
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/data/reconstruction_morphology.json +7 -13
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/test_agent.py +6 -6
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/test_brain_region.py +1 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/test_contribution.py +1 -1
- entitysdk-0.2.4/tests/unit/models/test_electrical_cell_recording.py +42 -0
- entitysdk-0.2.4/tests/unit/models/test_init.py +17 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_client.py +12 -7
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_common.py +1 -1
- entitysdk-0.2.2/src/entitysdk/models/__init__.py +0 -1
- entitysdk-0.2.2/src/entitysdk/models/entity.py +0 -38
- entitysdk-0.2.2/src/entitysdk/models/morphology.py +0 -190
- entitysdk-0.2.2/src/entitysdk/typedef.py +0 -13
- {entitysdk-0.2.2 → entitysdk-0.2.4}/.github/workflows/sdist.yml +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/.github/workflows/tox.yml +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/.gitignore +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/CHANGELOG.rst +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/CONTRIBUTING.md +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/LICENSE.txt +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/README.md +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/pyproject.toml +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/setup.cfg +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/__init__.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/config.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/core.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/exception.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/mixin.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/asset.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/base.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/models/response.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/result.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/serdes.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk/token_manager.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk.egg-info/dependency_links.txt +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk.egg-info/requires.txt +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/src/entitysdk.egg-info/top_level.txt +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/__init__.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/integration/__init__.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/integration/conftest.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/__init__.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/conftest.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/__init__.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/data/.gitignore +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/test_asset.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/test_ion_channel_model.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/models/test_morphology.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_base.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_config.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_result.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_route.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_serdes.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_token_manager.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/test_util.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tests/unit/util.py +0 -0
- {entitysdk-0.2.2 → entitysdk-0.2.4}/tox.ini +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: entitysdk
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.4
|
4
4
|
Summary: Python library for interacting with the entitycore service
|
5
5
|
Author-email: Open Brain Institute <info@openbraininstitute.org>
|
6
6
|
Maintainer-email: Open Brain Institute <info@openbraininstitute.org>
|
@@ -13,14 +13,15 @@
|
|
13
13
|
"\n",
|
14
14
|
"from entitysdk.client import Client\n",
|
15
15
|
"from entitysdk.common import ProjectContext\n",
|
16
|
-
"from entitysdk.models
|
17
|
-
"
|
18
|
-
"
|
16
|
+
"from entitysdk.models import (\n",
|
17
|
+
" MTypeClass,\n",
|
18
|
+
" Organization,\n",
|
19
|
+
" Person,\n",
|
19
20
|
" ReconstructionMorphology,\n",
|
21
|
+
" Role,\n",
|
20
22
|
" Species,\n",
|
21
23
|
" Strain,\n",
|
22
24
|
")\n",
|
23
|
-
"from entitysdk.models.mtype import MTypeClass\n",
|
24
25
|
"\n",
|
25
26
|
"entitycore_api_url = \"http://127.0.0.1:8000\"\n",
|
26
27
|
"project_context = ProjectContext(\n",
|
@@ -16,7 +16,7 @@
|
|
16
16
|
"\n",
|
17
17
|
"from entitysdk.client import Client\n",
|
18
18
|
"from entitysdk.common import ProjectContext\n",
|
19
|
-
"from entitysdk.models
|
19
|
+
"from entitysdk.models import (\n",
|
20
20
|
" BrainLocation,\n",
|
21
21
|
" BrainRegion,\n",
|
22
22
|
" ReconstructionMorphology,\n",
|
@@ -13,9 +13,7 @@
|
|
13
13
|
"\n",
|
14
14
|
"from entitysdk.client import Client\n",
|
15
15
|
"from entitysdk.common import ProjectContext\n",
|
16
|
-
"from entitysdk.models
|
17
|
-
"from entitysdk.models.contribution import Contribution, Role\n",
|
18
|
-
"from entitysdk.models.morphology import ReconstructionMorphology\n",
|
16
|
+
"from entitysdk.models import Contribution, Organization, ReconstructionMorphology, Role\n",
|
19
17
|
"\n",
|
20
18
|
"entitycore_api_url = \"http://127.0.0.1:8000\"\n",
|
21
19
|
"project_context = ProjectContext(\n",
|
@@ -13,7 +13,7 @@ from entitysdk.models.asset import Asset, LocalAssetMetadata
|
|
13
13
|
from entitysdk.models.core import Identifiable
|
14
14
|
from entitysdk.result import IteratorResult
|
15
15
|
from entitysdk.token_manager import TokenManager
|
16
|
-
from entitysdk.
|
16
|
+
from entitysdk.types import ID, DeploymentEnvironment
|
17
17
|
from entitysdk.util import build_api_url
|
18
18
|
|
19
19
|
|
@@ -7,7 +7,7 @@ from uuid import UUID
|
|
7
7
|
from pydantic import BaseModel
|
8
8
|
|
9
9
|
from entitysdk.exception import EntitySDKError
|
10
|
-
from entitysdk.
|
10
|
+
from entitysdk.types import DeploymentEnvironment
|
11
11
|
|
12
12
|
UUID_RE = "[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}"
|
13
13
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
"""Models for entitysdk."""
|
2
|
+
|
3
|
+
from entitysdk.models.agent import Organization, Person
|
4
|
+
from entitysdk.models.asset import Asset
|
5
|
+
from entitysdk.models.brain_location import BrainLocation
|
6
|
+
from entitysdk.models.brain_region import BrainRegion
|
7
|
+
from entitysdk.models.contribution import Contribution, Role
|
8
|
+
from entitysdk.models.electrical_cell_recording import ElectricalCellRecording
|
9
|
+
from entitysdk.models.emodel import EModel
|
10
|
+
from entitysdk.models.ion_channel_model import IonChannelModel, NeuronBlock, UseIon
|
11
|
+
from entitysdk.models.license import License
|
12
|
+
from entitysdk.models.memodel import MEModel
|
13
|
+
from entitysdk.models.morphology import ReconstructionMorphology
|
14
|
+
from entitysdk.models.mtype import MTypeClass
|
15
|
+
from entitysdk.models.taxonomy import Species, Strain, Taxonomy
|
16
|
+
|
17
|
+
__all__ = [
|
18
|
+
"Asset",
|
19
|
+
"BrainLocation",
|
20
|
+
"BrainRegion",
|
21
|
+
"Contribution",
|
22
|
+
"ElectricalCellRecording",
|
23
|
+
"EModel",
|
24
|
+
"IonChannelModel",
|
25
|
+
"License",
|
26
|
+
"MEModel",
|
27
|
+
"MTypeClass",
|
28
|
+
"NeuronBlock",
|
29
|
+
"Organization",
|
30
|
+
"Person",
|
31
|
+
"ReconstructionMorphology",
|
32
|
+
"Role",
|
33
|
+
"Species",
|
34
|
+
"Strain",
|
35
|
+
"Taxonomy",
|
36
|
+
"UseIon",
|
37
|
+
]
|
@@ -33,20 +33,20 @@ class Person(Agent):
|
|
33
33
|
description="The type of this agent. Should be 'agent'",
|
34
34
|
),
|
35
35
|
] = "person"
|
36
|
-
|
37
|
-
str,
|
36
|
+
given_name: Annotated[
|
37
|
+
str | None,
|
38
38
|
Field(
|
39
39
|
examples=["John", "Jane"],
|
40
40
|
description="The given name of the person.",
|
41
41
|
),
|
42
|
-
]
|
43
|
-
|
44
|
-
str,
|
42
|
+
] = None
|
43
|
+
family_name: Annotated[
|
44
|
+
str | None,
|
45
45
|
Field(
|
46
46
|
examples=["Doe", "Smith"],
|
47
47
|
description="The family name of the person.",
|
48
48
|
),
|
49
|
-
]
|
49
|
+
] = None
|
50
50
|
|
51
51
|
|
52
52
|
class Organization(Agent):
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"""Brain location model."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
from entitysdk.models.core import Struct
|
8
|
+
|
9
|
+
|
10
|
+
class BrainLocation(Struct):
|
11
|
+
"""BrainLocation model."""
|
12
|
+
|
13
|
+
x: Annotated[
|
14
|
+
float,
|
15
|
+
Field(
|
16
|
+
examples=[1.0, 2.0, 3.0],
|
17
|
+
description="The x coordinate of the brain location.",
|
18
|
+
),
|
19
|
+
]
|
20
|
+
y: Annotated[
|
21
|
+
float,
|
22
|
+
Field(
|
23
|
+
examples=[1.0, 2.0, 3.0],
|
24
|
+
description="The y coordinate of the brain location.",
|
25
|
+
),
|
26
|
+
]
|
27
|
+
z: Annotated[
|
28
|
+
float,
|
29
|
+
Field(
|
30
|
+
examples=[1.0, 2.0, 3.0],
|
31
|
+
description="The z coordinate of the brain location.",
|
32
|
+
),
|
33
|
+
]
|
@@ -5,7 +5,7 @@ from typing import Annotated
|
|
5
5
|
from pydantic import Field
|
6
6
|
|
7
7
|
from entitysdk.models.core import Identifiable
|
8
|
-
from entitysdk.
|
8
|
+
from entitysdk.types import ID
|
9
9
|
|
10
10
|
|
11
11
|
class BrainRegion(Identifiable):
|
@@ -29,8 +29,9 @@ class BrainRegion(Identifiable):
|
|
29
29
|
),
|
30
30
|
]
|
31
31
|
parent_structure_id: Annotated[
|
32
|
-
ID, Field(examples=[], description="The parent region structure UUID.")
|
32
|
+
ID | None, Field(examples=[], description="The parent region structure UUID.")
|
33
33
|
]
|
34
34
|
hierarchy_id: Annotated[
|
35
35
|
ID, Field(examples=[], description="The brain hierarchy that includes this brain region.")
|
36
36
|
]
|
37
|
+
color_hex_triplet: Annotated[str, Field(description="Region's color hex triplet.")]
|
@@ -6,7 +6,6 @@ from pydantic import Field
|
|
6
6
|
|
7
7
|
from entitysdk.models.agent import AgentUnion
|
8
8
|
from entitysdk.models.core import Identifiable
|
9
|
-
from entitysdk.models.entity import Entity
|
10
9
|
|
11
10
|
|
12
11
|
class Role(Identifiable):
|
@@ -42,6 +41,12 @@ class Contribution(Identifiable):
|
|
42
41
|
),
|
43
42
|
]
|
44
43
|
entity: Annotated[
|
45
|
-
Entity | None,
|
44
|
+
"Entity | None",
|
46
45
|
Field(description="The entity that resulted in this contribution."),
|
47
46
|
] = None
|
47
|
+
|
48
|
+
|
49
|
+
# Update forward reference for Entity
|
50
|
+
from entitysdk.models.entity import Entity # noqa: E402
|
51
|
+
|
52
|
+
Contribution.model_rebuild(force=True)
|
@@ -0,0 +1,92 @@
|
|
1
|
+
"""Electrical cell recording models."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
from entitysdk.models.brain_region import BrainRegion
|
8
|
+
from entitysdk.models.entity import Entity
|
9
|
+
from entitysdk.models.license import License
|
10
|
+
from entitysdk.models.subject import Subject
|
11
|
+
from entitysdk.types import (
|
12
|
+
ElectricalRecordingOrigin,
|
13
|
+
ElectricalRecordingStimulusShape,
|
14
|
+
ElectricalRecordingStimulusType,
|
15
|
+
ElectricalRecordingType,
|
16
|
+
)
|
17
|
+
|
18
|
+
|
19
|
+
class ElectricalRecordingStimulus(Entity):
|
20
|
+
"""Electrical cell recording stimulus model."""
|
21
|
+
|
22
|
+
dt: float | None = None
|
23
|
+
injection_type: ElectricalRecordingStimulusType
|
24
|
+
shape: ElectricalRecordingStimulusShape
|
25
|
+
start_time: float | None = None
|
26
|
+
end_time: float | None = None
|
27
|
+
|
28
|
+
|
29
|
+
class ElectricalCellRecording(Entity):
|
30
|
+
"""Electrical cell recording model."""
|
31
|
+
|
32
|
+
ljp: Annotated[
|
33
|
+
float,
|
34
|
+
Field(
|
35
|
+
title="Liquid Junction Potential",
|
36
|
+
description="Correction applied to the voltage trace, in mV",
|
37
|
+
examples=[0.1],
|
38
|
+
),
|
39
|
+
] = 0.0
|
40
|
+
recording_location: Annotated[
|
41
|
+
list[str],
|
42
|
+
Field(
|
43
|
+
title="Recording Location",
|
44
|
+
description=(
|
45
|
+
"Location on the cell where recording was performed, in hoc-compatible format."
|
46
|
+
),
|
47
|
+
),
|
48
|
+
]
|
49
|
+
recording_type: Annotated[
|
50
|
+
ElectricalRecordingType,
|
51
|
+
Field(
|
52
|
+
title="Recording Type",
|
53
|
+
description="Recording type.",
|
54
|
+
),
|
55
|
+
]
|
56
|
+
recording_origin: Annotated[
|
57
|
+
ElectricalRecordingOrigin,
|
58
|
+
Field(
|
59
|
+
title="Recording Origin",
|
60
|
+
description="Recording origin.",
|
61
|
+
),
|
62
|
+
]
|
63
|
+
comment: Annotated[
|
64
|
+
str | None,
|
65
|
+
Field(
|
66
|
+
title="Comment",
|
67
|
+
description="Comment with further details.",
|
68
|
+
),
|
69
|
+
] = None
|
70
|
+
brain_region: Annotated[
|
71
|
+
BrainRegion,
|
72
|
+
Field(
|
73
|
+
description="The region of the brain where the morphology is located.",
|
74
|
+
),
|
75
|
+
]
|
76
|
+
subject: Annotated[
|
77
|
+
Subject,
|
78
|
+
Field(title="Subject", description="The subject of the electrical cell recording."),
|
79
|
+
]
|
80
|
+
stimuli: Annotated[
|
81
|
+
list[ElectricalRecordingStimulus] | None,
|
82
|
+
Field(
|
83
|
+
title="Electrical Recording Stimuli",
|
84
|
+
description="List of stimuli applied to the cell with their respective time steps",
|
85
|
+
),
|
86
|
+
] = None
|
87
|
+
license: Annotated[
|
88
|
+
License | None,
|
89
|
+
Field(
|
90
|
+
description="The license attached to the morphology.",
|
91
|
+
),
|
92
|
+
] = None
|
@@ -0,0 +1,89 @@
|
|
1
|
+
"""Electrical cell model."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
from entitysdk.models.contribution import Contribution
|
8
|
+
from entitysdk.models.entity import Entity
|
9
|
+
from entitysdk.models.etype import ETypeClass
|
10
|
+
from entitysdk.models.ion_channel_model import IonChannelModel
|
11
|
+
from entitysdk.models.morphology import (
|
12
|
+
BrainRegion,
|
13
|
+
License,
|
14
|
+
ReconstructionMorphology,
|
15
|
+
Species,
|
16
|
+
Strain,
|
17
|
+
)
|
18
|
+
from entitysdk.models.mtype import MTypeClass
|
19
|
+
|
20
|
+
|
21
|
+
class EModel(Entity):
|
22
|
+
"""Electrical cell model."""
|
23
|
+
|
24
|
+
species: Annotated[
|
25
|
+
Species,
|
26
|
+
Field(description="The species for which the emodel applies."),
|
27
|
+
]
|
28
|
+
strain: Annotated[
|
29
|
+
Strain | None,
|
30
|
+
Field(description="The specific strain of the species, if applicable."),
|
31
|
+
] = None
|
32
|
+
brain_region: Annotated[
|
33
|
+
BrainRegion,
|
34
|
+
Field(description="The brain region where the emodel is used or applies."),
|
35
|
+
]
|
36
|
+
license: Annotated[
|
37
|
+
License | None,
|
38
|
+
Field(description="License under which the emodel is distributed."),
|
39
|
+
] = None
|
40
|
+
contributions: Annotated[
|
41
|
+
list[Contribution] | None,
|
42
|
+
Field(description="List of contributions related to this emodel."),
|
43
|
+
] = None
|
44
|
+
iteration: Annotated[
|
45
|
+
str,
|
46
|
+
Field(
|
47
|
+
description="The iteration of the emodel used during optimisation.",
|
48
|
+
examples="1372346",
|
49
|
+
),
|
50
|
+
]
|
51
|
+
score: Annotated[
|
52
|
+
float,
|
53
|
+
Field(
|
54
|
+
description="The score of the emodel gotten during validation.",
|
55
|
+
examples=54.0,
|
56
|
+
),
|
57
|
+
]
|
58
|
+
seed: Annotated[
|
59
|
+
int,
|
60
|
+
Field(
|
61
|
+
description="The RNG seed used during optimisation.",
|
62
|
+
examples=13,
|
63
|
+
),
|
64
|
+
]
|
65
|
+
exemplar_morphology: Annotated[
|
66
|
+
ReconstructionMorphology | None,
|
67
|
+
Field(
|
68
|
+
description="The morphology used during optimisation.",
|
69
|
+
),
|
70
|
+
] = None
|
71
|
+
etypes: Annotated[
|
72
|
+
list[ETypeClass] | None,
|
73
|
+
Field(
|
74
|
+
description="The etype classes of the emodel.",
|
75
|
+
),
|
76
|
+
] = None
|
77
|
+
mtypes: Annotated[
|
78
|
+
list[MTypeClass] | None,
|
79
|
+
Field(
|
80
|
+
description="The mtype classes of the emodel.",
|
81
|
+
),
|
82
|
+
] = None
|
83
|
+
ion_channel_models: Annotated[
|
84
|
+
list[IonChannelModel] | None,
|
85
|
+
Field(
|
86
|
+
description="List of ion channel models.",
|
87
|
+
),
|
88
|
+
] = None
|
89
|
+
legacy_id: list[str] | None = None
|
@@ -0,0 +1,74 @@
|
|
1
|
+
"""Entity model."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
from uuid import UUID
|
5
|
+
|
6
|
+
from pydantic import Field
|
7
|
+
|
8
|
+
from entitysdk.mixin import HasAssets
|
9
|
+
from entitysdk.models.agent import AgentUnion
|
10
|
+
from entitysdk.models.core import Identifiable
|
11
|
+
from entitysdk.types import ID
|
12
|
+
|
13
|
+
|
14
|
+
class Entity(Identifiable, HasAssets):
|
15
|
+
"""Entity is a model with id and authorization."""
|
16
|
+
|
17
|
+
name: Annotated[
|
18
|
+
str | None,
|
19
|
+
Field(
|
20
|
+
examples=["Entity 1"],
|
21
|
+
description="The name of the entity.",
|
22
|
+
),
|
23
|
+
] = None
|
24
|
+
description: Annotated[
|
25
|
+
str | None,
|
26
|
+
Field(
|
27
|
+
examples=["This is entity 1"],
|
28
|
+
description="The description of the entity.",
|
29
|
+
),
|
30
|
+
] = None
|
31
|
+
type: Annotated[
|
32
|
+
str | None,
|
33
|
+
Field(
|
34
|
+
examples=["license"],
|
35
|
+
description="The type of this Entity.",
|
36
|
+
),
|
37
|
+
] = None
|
38
|
+
created_by: Annotated[
|
39
|
+
AgentUnion | None,
|
40
|
+
Field(description="The agent that created this entity."),
|
41
|
+
] = None
|
42
|
+
updated_by: Annotated[
|
43
|
+
AgentUnion | None,
|
44
|
+
Field(
|
45
|
+
description="The agent that updated this entity.",
|
46
|
+
),
|
47
|
+
] = None
|
48
|
+
authorized_public: Annotated[
|
49
|
+
bool | None,
|
50
|
+
Field(
|
51
|
+
examples=[True, False],
|
52
|
+
description="Whether the resource is authorized to be public.",
|
53
|
+
),
|
54
|
+
] = None
|
55
|
+
authorized_project_id: Annotated[
|
56
|
+
ID | None,
|
57
|
+
Field(
|
58
|
+
examples=[UUID("12345678-1234-1234-1234-123456789012")],
|
59
|
+
description="The project ID the resource is authorized to be public.",
|
60
|
+
),
|
61
|
+
] = None
|
62
|
+
contributions: Annotated[
|
63
|
+
"list[Contribution] | None", Field(description="The constributions for this entity.")
|
64
|
+
] = None
|
65
|
+
legacy_id: Annotated[
|
66
|
+
list[str] | None,
|
67
|
+
Field(description="Legacy NEXUS ids."),
|
68
|
+
] = None
|
69
|
+
|
70
|
+
|
71
|
+
# Update forward reference for Contribution
|
72
|
+
from entitysdk.models.contribution import Contribution # noqa: E402
|
73
|
+
|
74
|
+
Entity.model_rebuild(force=True)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"""EType classification models."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
from entitysdk.models.core import Identifiable
|
8
|
+
|
9
|
+
|
10
|
+
class ETypeClass(Identifiable):
|
11
|
+
"""EType model class."""
|
12
|
+
|
13
|
+
pref_label: Annotated[
|
14
|
+
str,
|
15
|
+
Field(
|
16
|
+
description="The preferred label of the etype class.",
|
17
|
+
),
|
18
|
+
]
|
19
|
+
definition: Annotated[
|
20
|
+
str,
|
21
|
+
Field(
|
22
|
+
description="The definition of the etype class.",
|
23
|
+
),
|
24
|
+
]
|
25
|
+
alt_label: Annotated[
|
26
|
+
str | None,
|
27
|
+
Field(description="The alternative label of th etype class."),
|
28
|
+
]
|
@@ -4,7 +4,6 @@ from typing import Annotated
|
|
4
4
|
|
5
5
|
from pydantic import Field
|
6
6
|
|
7
|
-
from entitysdk.mixin import HasAssets
|
8
7
|
from entitysdk.models.base import BaseModel
|
9
8
|
from entitysdk.models.contribution import Contribution
|
10
9
|
from entitysdk.models.entity import Entity
|
@@ -83,7 +82,7 @@ class NeuronBlock(BaseModel):
|
|
83
82
|
] = None
|
84
83
|
|
85
84
|
|
86
|
-
class IonChannelModel(
|
85
|
+
class IonChannelModel(Entity):
|
87
86
|
"""Ion channel mechanism model."""
|
88
87
|
|
89
88
|
name: Annotated[
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"""License model."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
from entitysdk.models.core import Identifiable
|
8
|
+
|
9
|
+
|
10
|
+
class License(Identifiable):
|
11
|
+
"""License model."""
|
12
|
+
|
13
|
+
name: Annotated[
|
14
|
+
str,
|
15
|
+
Field(
|
16
|
+
examples=["Apache 2.0"],
|
17
|
+
description="The name of the license.",
|
18
|
+
),
|
19
|
+
]
|
20
|
+
description: Annotated[
|
21
|
+
str,
|
22
|
+
Field(
|
23
|
+
examples=["The 2.0 version of the Apache License"],
|
24
|
+
description="The description of the license.",
|
25
|
+
),
|
26
|
+
]
|
27
|
+
label: Annotated[
|
28
|
+
str,
|
29
|
+
Field(
|
30
|
+
examples=["Apache 2.0"],
|
31
|
+
description="The label of the license.",
|
32
|
+
),
|
33
|
+
]
|
@@ -0,0 +1,96 @@
|
|
1
|
+
"""Simulatable neuron model."""
|
2
|
+
|
3
|
+
from typing import Annotated
|
4
|
+
|
5
|
+
from pydantic import Field
|
6
|
+
|
7
|
+
from entitysdk.models.contribution import Contribution
|
8
|
+
from entitysdk.models.emodel import EModel
|
9
|
+
from entitysdk.models.entity import Entity
|
10
|
+
from entitysdk.models.etype import ETypeClass
|
11
|
+
from entitysdk.models.morphology import (
|
12
|
+
BrainRegion,
|
13
|
+
License,
|
14
|
+
ReconstructionMorphology,
|
15
|
+
Species,
|
16
|
+
Strain,
|
17
|
+
)
|
18
|
+
from entitysdk.models.mtype import MTypeClass
|
19
|
+
from entitysdk.types import ValidationStatus
|
20
|
+
|
21
|
+
|
22
|
+
class MEModel(Entity):
|
23
|
+
"""Simulatable neuron model."""
|
24
|
+
|
25
|
+
species: Annotated[
|
26
|
+
Species,
|
27
|
+
Field(description="The species for which the memodel applies."),
|
28
|
+
]
|
29
|
+
strain: Annotated[
|
30
|
+
Strain | None,
|
31
|
+
Field(description="The specific strain of the species, if applicable."),
|
32
|
+
] = None
|
33
|
+
brain_region: Annotated[
|
34
|
+
BrainRegion,
|
35
|
+
Field(description="The brain region where the memodel is used or applies."),
|
36
|
+
]
|
37
|
+
license: Annotated[
|
38
|
+
License | None,
|
39
|
+
Field(description="License under which the memodel is distributed."),
|
40
|
+
] = None
|
41
|
+
contributions: Annotated[
|
42
|
+
list[Contribution] | None,
|
43
|
+
Field(description="List of contributions related to this memodel."),
|
44
|
+
] = None
|
45
|
+
iteration: Annotated[
|
46
|
+
str | None,
|
47
|
+
Field(
|
48
|
+
description="The iteration of the memodel used during optimisation.",
|
49
|
+
examples="1372346",
|
50
|
+
),
|
51
|
+
] = None
|
52
|
+
validation_status: Annotated[
|
53
|
+
ValidationStatus,
|
54
|
+
Field(
|
55
|
+
description="The validation status of the memodel.",
|
56
|
+
),
|
57
|
+
]
|
58
|
+
holding_current: Annotated[
|
59
|
+
float | None,
|
60
|
+
Field(
|
61
|
+
description="The holding current of the memodel.",
|
62
|
+
examples=0.0,
|
63
|
+
),
|
64
|
+
] = None
|
65
|
+
threshold_current: Annotated[
|
66
|
+
float | None,
|
67
|
+
Field(
|
68
|
+
description="The threshold current of the memodel.",
|
69
|
+
examples=0.1,
|
70
|
+
),
|
71
|
+
] = None
|
72
|
+
morphology: Annotated[
|
73
|
+
ReconstructionMorphology,
|
74
|
+
Field(
|
75
|
+
description="The morphology of the memodel.",
|
76
|
+
),
|
77
|
+
]
|
78
|
+
emodel: Annotated[
|
79
|
+
EModel,
|
80
|
+
Field(
|
81
|
+
description="The emodel of the memodel.",
|
82
|
+
),
|
83
|
+
]
|
84
|
+
etypes: Annotated[
|
85
|
+
list[ETypeClass] | None,
|
86
|
+
Field(
|
87
|
+
description="The etype classes of the memodel.",
|
88
|
+
),
|
89
|
+
] = None
|
90
|
+
mtypes: Annotated[
|
91
|
+
list[MTypeClass] | None,
|
92
|
+
Field(
|
93
|
+
description="The mtype classes of the memodel.",
|
94
|
+
),
|
95
|
+
] = None
|
96
|
+
legacy_id: list[str] | None = None
|