Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
"""Add lod_mesh_block to asset labels

Revision ID: 3ba5873875fa
Revises: b07f22cc6f1a
Create Date: 2026-03-09 15:17:13.408906

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from alembic_postgresql_enum import TableReference

from sqlalchemy import Text
import app.db.types

# revision identifiers, used by Alembic.
revision: str = "3ba5873875fa"
down_revision: Union[str, None] = "b07f22cc6f1a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.execute("ALTER TYPE public.assetlabel ADD VALUE IF NOT EXISTS 'lod_mesh_block'")


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values(
enum_schema="public",
enum_name="assetlabel",
new_values=[
"morphology",
"morphology_with_spines",
"cell_composition_summary",
"cell_composition_volumes",
"single_neuron_synaptome_config",
"single_neuron_synaptome_simulation_data",
"single_neuron_simulation_data",
"sonata_circuit",
"compressed_sonata_circuit",
"circuit_figures",
"circuit_analysis_data",
"circuit_connectivity_matrices",
"nwb",
"neuron_hoc",
"emodel_optimization_output",
"sonata_simulation_config",
"simulation_generation_config",
"ion_channel_modeling_generation_config",
"custom_node_sets",
"campaign_generation_config",
"campaign_summary",
"replay_spikes",
"voltage_report",
"spike_report",
"neuron_mechanisms",
"brain_atlas_annotation",
"brain_atlas_region_mesh",
"voxel_densities",
"validation_result_figure",
"validation_result_details",
"simulation_designer_image",
"circuit_visualization",
"node_stats",
"network_stats_a",
"network_stats_b",
"cell_surface_mesh",
"jupyter_notebook",
"requirements",
"notebook_required_files",
"ion_channel_model_figure",
"ion_channel_model_figure_summary_json",
"ion_channel_model_thumbnail",
"circuit_extraction_config",
"skeletonization_config",
"task_config",
],
affected_columns=[
TableReference(table_schema="public", table_name="asset", column_name="label")
],
enum_values_to_rename=[],
)
# ### end Alembic commands ###
25 changes: 20 additions & 5 deletions app/db/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ class AssetLabel(StrEnum):
circuit_extraction_config = auto()
skeletonization_config = auto()
task_config = auto()
lod_mesh_block = auto()


class LabelRequirements(BaseModel):
Expand Down Expand Up @@ -791,6 +792,13 @@ class LabelRequirements(BaseModel):
),
),
],
AssetLabel.cell_surface_mesh: [
LabelRequirements(
content_type=ContentType.gltf_binary,
is_directory=False,
description=("A triangle mesh describing the surface of a cell in glb format."),
),
],
},
EntityType.simulation: {
AssetLabel.custom_node_sets: [
Expand Down Expand Up @@ -912,16 +920,23 @@ class LabelRequirements(BaseModel):
EntityType.em_cell_mesh: {
AssetLabel.cell_surface_mesh: [
LabelRequirements(
content_type=ContentType.h5,
content_type=ContentType.obj,
is_directory=False,
description="A triangle mesh describing the surface of a cell in h5 format.",
description="A triangle mesh describing the surface of a cell in obj format.",
),
LabelRequirements(
content_type=ContentType.obj,
content_type=ContentType.gltf_binary,
is_directory=False,
description="A triangle mesh describing the surface of a cell in obj format.",
description="A triangle mesh describing the surface of a cell in glb format.",
),
]
],
AssetLabel.lod_mesh_block: [
LabelRequirements(
content_type=None,
is_directory=True,
description="A directory containing all the LOD mesh blocks in glb format.",
),
],
},
EntityType.circuit_extraction_campaign: {
AssetLabel.campaign_generation_config: [
Expand Down
6 changes: 4 additions & 2 deletions docs/asset-labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
| | morphology | application/swc | .swc | Morphology in SWC format. |
| | morphology | application/x-hdf5 | .h5 | Morphology in HDF5 format. |
| cell_morphology | morphology_with_spines | application/x-hdf5 | .h5 | H5 file containing mesh and skeletons of spines. Also includes soma mesh, and morphology skeleton. |
| cell_morphology | cell_surface_mesh | model/gltf-binary | .glb | A triangle mesh describing the surface of a cell in glb format. |
| simulation | custom_node_sets | application/json | .json | Node set groups for regions, mtypes, etc. |
| simulation | replay_spikes | application/x-hdf5 | .h5 | SONATA spike report used for spike replay during simulation. |
| simulation | simulation_generation_config | application/json | .json | Single simulation generation configuration. |
Expand All @@ -55,8 +56,9 @@
| validation_result | validation_result_figure | application/pdf | .pdf | Validation result figure, pdf. |
| | validation_result_figure | image/png | .png | Validation result figure, png (legacy). |
| validation_result | validation_result_details | text/plain | .txt | Log and details about the validation execution. |
| em_cell_mesh | cell_surface_mesh | application/x-hdf5 | .h5 | A triangle mesh describing the surface of a cell in h5 format. |
| | cell_surface_mesh | application/obj | .obj | A triangle mesh describing the surface of a cell in obj format. |
| em_cell_mesh | cell_surface_mesh | application/obj | .obj | A triangle mesh describing the surface of a cell in obj format. |
| | cell_surface_mesh | model/gltf-binary | .glb | A triangle mesh describing the surface of a cell in glb format. |
| em_cell_mesh | lod_mesh_block | N/A | N/A (directory) | A directory containing all the LOD mesh blocks in glb format. |
| circuit_extraction_campaign | campaign_generation_config | application/json | .json | Circuit extraction campaign configuration. |
| circuit_extraction_config | circuit_extraction_config | application/json | .json | Single circuit extraction configuration. |
| skeletonization_campaign | campaign_generation_config | application/json | .json | Skeletonization campaign configuration. |
Expand Down
4 changes: 2 additions & 2 deletions scripts/export/build_database_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Automatically generated, do not edit!
set -euo pipefail
SCRIPT_VERSION="1"
SCRIPT_DB_VERSION="b07f22cc6f1a"
SCRIPT_DB_VERSION="3ba5873875fa"
echo "DB dump (version $SCRIPT_VERSION for db version $SCRIPT_DB_VERSION)"


Expand Down Expand Up @@ -269,7 +269,7 @@ install -m 755 /dev/stdin "$WORK_DIR/load.sh" <<'EOF_LOAD_SCRIPT'
# Automatically generated, do not edit!
set -euo pipefail
SCRIPT_VERSION="1"
SCRIPT_DB_VERSION="b07f22cc6f1a"
SCRIPT_DB_VERSION="3ba5873875fa"
echo "DB load (version $SCRIPT_VERSION for db version $SCRIPT_DB_VERSION)"


Expand Down
Loading