Skip to content
Open
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
84 changes: 84 additions & 0 deletions alembic/versions/20251027_160006_6f591862ac35_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
"""empty message

Revision ID: 6f591862ac35
Revises: ae294ddca4a7
Create Date: 2025-10-27 16:00:06.976715

"""

from collections.abc import Sequence

from alembic_postgresql_enum import TableReference

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "6f591862ac35"
down_revision: str | None = "ae294ddca4a7"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values(
enum_schema="public",
enum_name="servicesubtype",
new_values=[
"ML_LLM",
"ML_RAG",
"ML_RETRIEVAL",
"NEURON_MESH_SKELETONIZATION",
"NOTEBOOK",
"SINGLE_CELL_BUILD",
"SINGLE_CELL_SIM",
"SMALL_CIRCUIT_SIM",
"STORAGE",
"SYNAPTOME_BUILD",
"SYNAPTOME_SIM",
"SINGLE_SIM",
"PAIR_SIM",
"SMALL_SIM",
"MICROCIRCUIT_SIM",
"REGION_SIM",
"SYSTEM_SIM",
"WHOLE_BRAIN_SIM",
],
affected_columns=[
TableReference(table_schema="public", table_name="job", column_name="service_subtype"),
TableReference(
table_schema="public", table_name="price", column_name="service_subtype"
),
],
enum_values_to_rename=[],
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.sync_enum_values(
enum_schema="public",
enum_name="servicesubtype",
new_values=[
"ML_LLM",
"ML_RAG",
"ML_RETRIEVAL",
"NEURON_MESH_SKELETONIZATION",
"NOTEBOOK",
"SINGLE_CELL_BUILD",
"SINGLE_CELL_SIM",
"SMALL_CIRCUIT_SIM",
"STORAGE",
"SYNAPTOME_BUILD",
"SYNAPTOME_SIM",
],
affected_columns=[
TableReference(table_schema="public", table_name="job", column_name="service_subtype"),
TableReference(
table_schema="public", table_name="price", column_name="service_subtype"
),
],
enum_values_to_rename=[],
)
# ### end Alembic commands ###
27 changes: 27 additions & 0 deletions app/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,41 @@ class TransactionType(HyphenStrEnum):
class ServiceSubtype(HyphenStrEnum):
"""Service Subtype."""

# Please report the repository and what the constant is used for

# these need to be in sync with:

# * https://github.com/openbraininstitute/accounting-sdk/blob/main/src/obp_accounting_sdk/constants.py
# * https://github.com/openbraininstitute/core-web-app/blob/develop/src/types/accounting/index.ts
# (grep `ServiceSubtype` for other usages; for instanse, in:
# https://github.com/openbraininstitute/core-web-app/blob/develop/src/ui/segments/project/credits/job-report-list.tsx
# * virtual-lab-api takes its value from `accounting-sdk`; so a version bump may be required.

# `neuroagent`; Used for `qa` chat agent
ML_LLM = auto()
ML_RAG = auto()
ML_RETRIEVAL = auto()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is used (nor ML_RAG); what should we do for deprecations?

NEURON_MESH_SKELETONIZATION = auto()
# `notebook-service`: Currently running notebook
NOTEBOOK = auto()
# `Bluenaas`: Create a single neuron model
SINGLE_CELL_BUILD = auto()
# `Bluenaas`: Run a single neuron simulation
SINGLE_CELL_SIM = auto()
# `Bluenaas`: Multi-neuron simulation
SMALL_CIRCUIT_SIM = auto()
STORAGE = auto()
# `Bluenaas`: Single neuron synaptome
SYNAPTOME_BUILD = auto()
# `Bluenaas`: Single neuron synaptome simulation
SYNAPTOME_SIM = auto()
# these *_SIM are a mirror of the `CircuitScale`s in entitycore:
# { https://github.com/openbraininstitute/entitycore/blob/6a20aa95748136d7a54a98326d8140751fcf1a09/app/db/types.py#L620
SINGLE_SIM = auto()
PAIR_SIM = auto()
SMALL_SIM = auto()
MICROCIRCUIT_SIM = auto()
REGION_SIM = auto()
SYSTEM_SIM = auto()
WHOLE_BRAIN_SIM = auto()
# } end of `CircuitScale`