entitysdk 0.7.0__tar.gz → 0.7.1__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.7.0/src/entitysdk.egg-info → entitysdk-0.7.1}/PKG-INFO +1 -1
- {entitysdk-0.7.0 → entitysdk-0.7.1}/pyproject.toml +1 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/client.py +28 -9
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/core.py +1 -1
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/asset.py +2 -2
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/staging/circuit.py +1 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1/src/entitysdk.egg-info}/PKG-INFO +1 -1
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/downloaders/test_emodel.py +1 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/downloaders/test_ion_channel_model.py +1 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/downloaders/test_memodel.py +3 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/downloaders/test_morphology.py +1 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/electrical_cell_recording.json +1 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/ion_channel_model.json +2 -1
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/reconstruction_morphology.json +2 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_asset.py +4 -2
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/conftest.py +1 -1
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_client.py +25 -24
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/utils/test_asset.py +3 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/.github/workflows/sdist.yml +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/.github/workflows/tox.yml +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/.gitignore +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/CHANGELOG.rst +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/CONTRIBUTING.md +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/LICENSE.txt +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/README.md +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/examples/01_searching.ipynb +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/examples/02_morphology.ipynb +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/examples/03_circuit.ipynb +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/examples/04_simulation_campaign.ipynb +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/examples/utils.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/setup.cfg +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/common.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/config.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/dependencies/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/dependencies/entity.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/emodel.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/ion_channel_model.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/memodel.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/morphology.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/simulation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/downloaders/simulation_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/exception.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/mixin.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/activity.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/agent.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/base.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/brain_location.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/brain_region.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/brain_region_hierarchy.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/circuit.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/classification.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/contribution.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/core.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/electrical_cell_recording.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/emodel.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/entity.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/etype.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/ion_channel_model.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/license.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/memodel.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/memodelcalibrationresult.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/morphology.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/mtype.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/response.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/scientific_artifact.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/simulation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/simulation_campaign.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/simulation_execution.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/simulation_generation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/simulation_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/single_neuron_simulation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/single_neuron_synaptome_simulation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/subject.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/synaptome.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/taxonomy.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/validation_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/route.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/schemas/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/schemas/asset.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/schemas/base.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/schemas/memodel.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/serdes.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/staging/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/staging/simulation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/staging/simulation_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/token_manager.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/types.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/util.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/utils/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/utils/asset.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/utils/filesystem.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/utils/io.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk.egg-info/SOURCES.txt +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk.egg-info/dependency_links.txt +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk.egg-info/requires.txt +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk.egg-info/top_level.txt +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/integration/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/integration/conftest.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/integration/test_searching.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/conftest.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/dependencies/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/dependencies/test_entity.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/.gitignore +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/circuit.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/memodel_calibration_result.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/simulation_campaign.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/data/validation_result.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_agent.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_brain_region.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_circuit.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_contribution.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_electrical_cell_recording.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_init.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_ion_channel_model.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_memodel_calibration_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_morphology.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_simulation_campaign.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/models/test_validation_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/__init__.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/SomaVoltRec 1.h5 +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/SomaVoltRec 2.h5 +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/circuit/circuit_config.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/circuit/edges.h5 +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/circuit/nodes.h5 +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/node_sets.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/simulation_config.json +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/spike_replays.h5 +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/data/spikes.h5 +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/test_simulation.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/staging/test_simulation_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_base.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_common.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_config.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_result.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_route.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_serdes.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_token_manager.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/test_util.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/util.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tests/unit/utils/test_filesystem.py +0 -0
- {entitysdk-0.7.0 → entitysdk-0.7.1}/tox.ini +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: entitysdk
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.1
|
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>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"""Identifiable SDK client."""
|
2
2
|
|
3
|
+
import concurrent.futures
|
3
4
|
import io
|
4
5
|
import os
|
5
6
|
from pathlib import Path
|
@@ -216,7 +217,7 @@ class Client:
|
|
216
217
|
file_content_type: str,
|
217
218
|
file_name: str | None = None,
|
218
219
|
file_metadata: dict | None = None,
|
219
|
-
asset_label: str
|
220
|
+
asset_label: str,
|
220
221
|
project_context: ProjectContext | None = None,
|
221
222
|
) -> Asset:
|
222
223
|
"""Upload asset to an existing entity's endpoint from a file path."""
|
@@ -252,7 +253,7 @@ class Client:
|
|
252
253
|
file_name: str,
|
253
254
|
file_content_type: str,
|
254
255
|
file_metadata: dict | None = None,
|
255
|
-
asset_label: str
|
256
|
+
asset_label: str,
|
256
257
|
project_context: ProjectContext | None = None,
|
257
258
|
) -> Asset:
|
258
259
|
"""Upload asset to an existing entity's endpoint from a file-like object."""
|
@@ -286,7 +287,7 @@ class Client:
|
|
286
287
|
name: str,
|
287
288
|
paths: dict[os.PathLike, os.PathLike],
|
288
289
|
metadata: dict | None = None,
|
289
|
-
label: str
|
290
|
+
label: str,
|
290
291
|
project_context: ProjectContext | None = None,
|
291
292
|
) -> Asset:
|
292
293
|
"""Attach directory to an entity from with a group of paths."""
|
@@ -349,8 +350,9 @@ class Client:
|
|
349
350
|
output_path: os.PathLike,
|
350
351
|
project_context: ProjectContext | None = None,
|
351
352
|
ignore_directory_name: bool = False,
|
353
|
+
max_concurrent: int = 1,
|
352
354
|
) -> list[Path]:
|
353
|
-
"""
|
355
|
+
"""Download directory of assets."""
|
354
356
|
output_path = Path(output_path)
|
355
357
|
|
356
358
|
if output_path.exists() and output_path.is_file():
|
@@ -386,9 +388,8 @@ class Client:
|
|
386
388
|
project_context=project_context,
|
387
389
|
)
|
388
390
|
|
389
|
-
|
390
|
-
|
391
|
-
paths.append(
|
391
|
+
if max_concurrent == 1:
|
392
|
+
paths = [
|
392
393
|
self.download_file(
|
393
394
|
entity_id=entity_id,
|
394
395
|
entity_type=entity_type,
|
@@ -397,7 +398,24 @@ class Client:
|
|
397
398
|
asset_path=path,
|
398
399
|
project_context=context,
|
399
400
|
)
|
400
|
-
|
401
|
+
for path in contents.files
|
402
|
+
]
|
403
|
+
else:
|
404
|
+
with concurrent.futures.ThreadPoolExecutor(max_workers=max_concurrent) as executor:
|
405
|
+
futures = [
|
406
|
+
executor.submit(
|
407
|
+
self.download_file,
|
408
|
+
entity_id=entity_id,
|
409
|
+
entity_type=entity_type,
|
410
|
+
asset_id=asset if asset else asset_id,
|
411
|
+
output_path=output_path / path,
|
412
|
+
asset_path=path,
|
413
|
+
project_context=context,
|
414
|
+
)
|
415
|
+
for path in contents.files
|
416
|
+
]
|
417
|
+
result = concurrent.futures.wait(futures)
|
418
|
+
paths = [res.result() for res in result.done]
|
401
419
|
|
402
420
|
return paths
|
403
421
|
|
@@ -597,7 +615,7 @@ class Client:
|
|
597
615
|
|
598
616
|
Note: This operation is not atomic. Deletion can succeed and upload can fail.
|
599
617
|
"""
|
600
|
-
self.delete_asset(
|
618
|
+
deleted_asset = self.delete_asset(
|
601
619
|
entity_id=entity_id,
|
602
620
|
entity_type=entity_type,
|
603
621
|
asset_id=asset_id,
|
@@ -611,4 +629,5 @@ class Client:
|
|
611
629
|
file_name=file_name,
|
612
630
|
file_metadata=file_metadata,
|
613
631
|
project_context=project_context,
|
632
|
+
asset_label=deleted_asset.label,
|
614
633
|
)
|
@@ -65,7 +65,7 @@ class Asset(Identifiable):
|
|
65
65
|
dict,
|
66
66
|
Field(description="Asset json metadata."),
|
67
67
|
] = {}
|
68
|
-
label: Annotated[str
|
68
|
+
label: Annotated[str, Field(description="Asset label.")]
|
69
69
|
|
70
70
|
|
71
71
|
class LocalAssetMetadata(BaseModel):
|
@@ -96,7 +96,7 @@ class LocalAssetMetadata(BaseModel):
|
|
96
96
|
description="The metadata of the asset.",
|
97
97
|
),
|
98
98
|
] = None
|
99
|
-
label: Annotated[str
|
99
|
+
label: Annotated[str, Field(description="Optional asset label.")]
|
100
100
|
|
101
101
|
|
102
102
|
class DetailedFile(BaseModel):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: entitysdk
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.1
|
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>
|
@@ -16,6 +16,7 @@ def _mock_morph_asset_response(asset_id):
|
|
16
16
|
"full_path": "foo.asc",
|
17
17
|
"is_directory": False,
|
18
18
|
"content_type": "application/asc",
|
19
|
+
"label": "morphology",
|
19
20
|
"size": 100,
|
20
21
|
"status": "created",
|
21
22
|
"meta": {},
|
@@ -31,6 +32,7 @@ def _mock_ic_asset_response(asset_id):
|
|
31
32
|
"full_path": "foo.mod",
|
32
33
|
"is_directory": False,
|
33
34
|
"content_type": "application/mod",
|
35
|
+
"label": "neuron_mechanisms",
|
34
36
|
"size": 100,
|
35
37
|
"status": "created",
|
36
38
|
"meta": {},
|
@@ -46,6 +48,7 @@ def _mock_emodel_asset_response(asset_id):
|
|
46
48
|
"full_path": "foo.hoc",
|
47
49
|
"is_directory": False,
|
48
50
|
"content_type": "application/hoc",
|
51
|
+
"label": "neuron_hoc",
|
49
52
|
"size": 100,
|
50
53
|
"status": "created",
|
51
54
|
"meta": {},
|
@@ -84,7 +84,8 @@
|
|
84
84
|
"path": "Ca_HVA.mod",
|
85
85
|
"full_path": "public/a98b7abc-fc46-4700-9e3d-37137812c730/0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6/assets/ion_channel_model/9720aa4a-0cd1-4f10-b6ad-04deb8f997b6/Ca_HVA.mod",
|
86
86
|
"is_directory": false,
|
87
|
-
"content_type": "application/
|
87
|
+
"content_type": "application/mod",
|
88
|
+
"label": "neuron_mechanisms",
|
88
89
|
"size": 561221,
|
89
90
|
"sha256_digest": "8b850eface3e7b881db62c361dc5da62be008ca81501c406a59646bf7075c95b",
|
90
91
|
"status": "created",
|
@@ -17,6 +17,7 @@
|
|
17
17
|
"full_path": "public/a98b7abc-fc46-4700-9e3d-37137812c730/0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6/assets/reconstruction_morphology/9720aa4a-0cd1-4f10-b6ad-04deb8f997b6/mpg150211_A_idA.swc",
|
18
18
|
"is_directory": false,
|
19
19
|
"content_type": "application/swc",
|
20
|
+
"label": "morphology",
|
20
21
|
"size": 561221,
|
21
22
|
"sha256_digest": "8b850eface3e7b881db62c361dc5da62be008ca81501c406a59646bf7075c95b",
|
22
23
|
"status": "created",
|
@@ -55,6 +56,7 @@
|
|
55
56
|
"full_path": "public/a98b7abc-fc46-4700-9e3d-37137812c730/0dbced5f-cc3d-488a-8c7f-cfb8ea039dc6/assets/reconstruction_morphology/9720aa4a-0cd1-4f10-b6ad-04deb8f997b6/mpg150211_A_idA.ASC",
|
56
57
|
"is_directory": false,
|
57
58
|
"content_type": "application/asc",
|
59
|
+
"label": "morphology",
|
58
60
|
"size": 525332,
|
59
61
|
"sha256_digest": "bf00878444539ead825f2d451cdf6f87072526f9a82c87de35fca5563ae5596b",
|
60
62
|
"status": "created",
|
@@ -8,6 +8,7 @@ def test_asset():
|
|
8
8
|
id=MOCK_UUID,
|
9
9
|
path="path/to/asset",
|
10
10
|
full_path="full/path/to/asset",
|
11
|
+
label="mock",
|
11
12
|
is_directory=False,
|
12
13
|
content_type="text/plain",
|
13
14
|
size=100,
|
@@ -25,7 +26,7 @@ def test_asset():
|
|
25
26
|
"status": None,
|
26
27
|
"sha256_digest": None,
|
27
28
|
"meta": {},
|
28
|
-
"label":
|
29
|
+
"label": "mock",
|
29
30
|
}
|
30
31
|
|
31
32
|
|
@@ -34,10 +35,11 @@ def test_local_asset_metadata():
|
|
34
35
|
file_name="file_name",
|
35
36
|
content_type="text/plain",
|
36
37
|
metadata={"key": "value"},
|
38
|
+
label="mock",
|
37
39
|
)
|
38
40
|
assert res.model_dump() == {
|
39
41
|
"file_name": "file_name",
|
40
42
|
"content_type": "text/plain",
|
41
43
|
"metadata": {"key": "value"},
|
42
|
-
"label":
|
44
|
+
"label": "mock",
|
43
45
|
}
|
@@ -129,6 +129,7 @@ def _mock_asset_response(asset_id):
|
|
129
129
|
"status": "created",
|
130
130
|
"meta": {},
|
131
131
|
"sha256_digest": "sha256_digest",
|
132
|
+
"label": "morphology",
|
132
133
|
}
|
133
134
|
|
134
135
|
|
@@ -146,14 +147,8 @@ def test_client_upload_file(
|
|
146
147
|
method="POST",
|
147
148
|
url=f"{api_url}/entity/{entity_id}/assets",
|
148
149
|
match_headers=request_headers,
|
149
|
-
match_files={
|
150
|
-
|
151
|
-
"foo",
|
152
|
-
b"foo",
|
153
|
-
"text/plain",
|
154
|
-
)
|
155
|
-
},
|
156
|
-
match_data={"label": "swc"},
|
150
|
+
match_files={"file": ("foo", b"foo", "application/swc")},
|
151
|
+
match_data={"label": "morphology"},
|
157
152
|
json=_mock_asset_response(asset_id),
|
158
153
|
)
|
159
154
|
|
@@ -165,9 +160,9 @@ def test_client_upload_file(
|
|
165
160
|
entity_type=Entity,
|
166
161
|
file_name="foo",
|
167
162
|
file_path=path,
|
168
|
-
file_content_type="
|
163
|
+
file_content_type="application/swc",
|
169
164
|
file_metadata={"key": "value"},
|
170
|
-
asset_label="
|
165
|
+
asset_label="morphology",
|
171
166
|
)
|
172
167
|
|
173
168
|
assert res.id == asset_id
|
@@ -182,24 +177,18 @@ def test_client_upload_content(client, httpx_mock, api_url, request_headers):
|
|
182
177
|
method="POST",
|
183
178
|
url=f"{api_url}/entity/{entity_id}/assets",
|
184
179
|
match_headers=request_headers,
|
185
|
-
match_files={
|
186
|
-
|
187
|
-
"foo.txt",
|
188
|
-
buffer,
|
189
|
-
"text/plain",
|
190
|
-
)
|
191
|
-
},
|
192
|
-
match_data={"label": "swc"},
|
180
|
+
match_files={"file": ("foo.swc", buffer, "application/swc")},
|
181
|
+
match_data={"label": "morphology"},
|
193
182
|
json=_mock_asset_response(asset_id),
|
194
183
|
)
|
195
184
|
res = client.upload_content(
|
196
185
|
entity_id=entity_id,
|
197
186
|
entity_type=Entity,
|
198
|
-
file_name="foo.
|
187
|
+
file_name="foo.swc",
|
199
188
|
file_content=buffer,
|
200
|
-
file_content_type="
|
189
|
+
file_content_type="application/swc",
|
201
190
|
file_metadata={"key": "value"},
|
202
|
-
asset_label="
|
191
|
+
asset_label="morphology",
|
203
192
|
)
|
204
193
|
|
205
194
|
assert res.id == asset_id
|
@@ -468,9 +457,10 @@ def test_client_get(
|
|
468
457
|
def _mock_asset_delete_response(asset_id):
|
469
458
|
return {
|
470
459
|
"path": "buffer.h5",
|
471
|
-
"full_path": "private/103d7868/103d7868/assets/reconstruction_morphology/8703/buffer.
|
460
|
+
"full_path": "private/103d7868/103d7868/assets/reconstruction_morphology/8703/buffer.swc",
|
472
461
|
"is_directory": False,
|
473
462
|
"content_type": "application/swc",
|
463
|
+
"label": "morphology",
|
474
464
|
"size": 18,
|
475
465
|
"sha256_digest": "47ddc1b6e05dcbfbd2db9dcec4a49d83c6f9f10ad595649bacdcb629671fd954",
|
476
466
|
"meta": {},
|
@@ -682,6 +672,7 @@ def test_client_download_assets__entity(
|
|
682
672
|
full_path="/foo/asset1",
|
683
673
|
is_directory=False,
|
684
674
|
content_type="application/json",
|
675
|
+
label="cell_composition_summary",
|
685
676
|
size=1,
|
686
677
|
),
|
687
678
|
],
|
@@ -731,7 +722,7 @@ def test_upload_directory_by_paths(
|
|
731
722
|
entity_type=Entity,
|
732
723
|
name="test-directory",
|
733
724
|
paths=paths,
|
734
|
-
label=
|
725
|
+
label="sonata_circuit",
|
735
726
|
metadata=None,
|
736
727
|
)
|
737
728
|
|
@@ -744,7 +735,7 @@ def test_upload_directory_by_paths(
|
|
744
735
|
"full_path": "asdf",
|
745
736
|
"id": "a370a57b-7211-4426-8046-970758ceaf68",
|
746
737
|
"is_directory": True,
|
747
|
-
"label":
|
738
|
+
"label": "sonata_circuit",
|
748
739
|
"meta": {},
|
749
740
|
"path": "",
|
750
741
|
"sha256_digest": None,
|
@@ -880,12 +871,14 @@ def test_client_list_directory(
|
|
880
871
|
assert res.files[Path("a/b/foo.txt")].name == "a/b/foo.txt"
|
881
872
|
|
882
873
|
|
874
|
+
@pytest.mark.parametrize("max_concurrent", [1, 4])
|
883
875
|
def test_client_download_directory_ignore_directory(
|
884
876
|
tmp_path,
|
885
877
|
client,
|
886
878
|
httpx_mock,
|
887
879
|
api_url,
|
888
880
|
request_headers,
|
881
|
+
max_concurrent,
|
889
882
|
):
|
890
883
|
entity_id = uuid.uuid4()
|
891
884
|
asset_id = uuid.uuid4()
|
@@ -924,17 +917,20 @@ def test_client_download_directory_ignore_directory(
|
|
924
917
|
asset_id=asset_id,
|
925
918
|
output_path=tmp_path,
|
926
919
|
ignore_directory_name=True,
|
920
|
+
max_concurrent=max_concurrent,
|
927
921
|
)
|
928
922
|
assert len(res) == 1
|
929
923
|
assert res[0] == (tmp_path / "foo.txt").absolute()
|
930
924
|
|
931
925
|
|
926
|
+
@pytest.mark.parametrize("max_concurrent", [1, 4])
|
932
927
|
def test_client_download_directory(
|
933
928
|
tmp_path,
|
934
929
|
client,
|
935
930
|
httpx_mock,
|
936
931
|
api_url,
|
937
932
|
request_headers,
|
933
|
+
max_concurrent,
|
938
934
|
):
|
939
935
|
entity_id = uuid.uuid4()
|
940
936
|
asset_id = uuid.uuid4()
|
@@ -987,15 +983,18 @@ def test_client_download_directory(
|
|
987
983
|
asset_id=asset_id,
|
988
984
|
output_path=target,
|
989
985
|
ignore_directory_name=False,
|
986
|
+
max_concurrent=max_concurrent,
|
990
987
|
)
|
991
988
|
|
992
989
|
|
990
|
+
@pytest.mark.parametrize("max_concurrent", [1, 4])
|
993
991
|
def test_client_download_directory__asset(
|
994
992
|
tmp_path,
|
995
993
|
client,
|
996
994
|
httpx_mock,
|
997
995
|
api_url,
|
998
996
|
request_headers,
|
997
|
+
max_concurrent,
|
999
998
|
):
|
1000
999
|
entity_id = uuid.uuid4()
|
1001
1000
|
asset_id = uuid.uuid4()
|
@@ -1009,6 +1008,7 @@ def test_client_download_directory__asset(
|
|
1009
1008
|
is_directory=True,
|
1010
1009
|
size=0,
|
1011
1010
|
content_type="application/vnd.directory",
|
1011
|
+
label="sonata_circuit",
|
1012
1012
|
)
|
1013
1013
|
|
1014
1014
|
# for listing dirs
|
@@ -1037,6 +1037,7 @@ def test_client_download_directory__asset(
|
|
1037
1037
|
asset_id=asset,
|
1038
1038
|
output_path=tmp_path,
|
1039
1039
|
ignore_directory_name=False,
|
1040
|
+
max_concurrent=max_concurrent,
|
1040
1041
|
)
|
1041
1042
|
assert len(res) == 1
|
1042
1043
|
assert res[0] == (tmp_path / "path_to_asset/foo.txt").absolute()
|
@@ -17,6 +17,7 @@ def assets():
|
|
17
17
|
is_directory=False,
|
18
18
|
content_type="application/json",
|
19
19
|
size=1,
|
20
|
+
label="json",
|
20
21
|
),
|
21
22
|
Asset(
|
22
23
|
id=uuid.uuid4(),
|
@@ -25,6 +26,7 @@ def assets():
|
|
25
26
|
is_directory=False,
|
26
27
|
content_type="application/csv",
|
27
28
|
size=1,
|
29
|
+
label="csv",
|
28
30
|
),
|
29
31
|
Asset(
|
30
32
|
id=uuid.uuid4(),
|
@@ -33,6 +35,7 @@ def assets():
|
|
33
35
|
is_directory=False,
|
34
36
|
content_type="application/csv",
|
35
37
|
size=1,
|
38
|
+
label="csv",
|
36
39
|
),
|
37
40
|
]
|
38
41
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{entitysdk-0.7.0 → entitysdk-0.7.1}/src/entitysdk/models/single_neuron_synaptome_simulation.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|