-
Notifications
You must be signed in to change notification settings - Fork 0
Import and expose emodel traces #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2ab1de8
Import and expose derivation between ElectricalCellRecording and EModel
GianlucaFicarelli 2cd4ae8
Add EModel.electrical_cell_recordings
GianlucaFicarelli 792fe6b
Add EModel.electrical_cell_recordings
GianlucaFicarelli c4c8519
Rebase and update migration
GianlucaFicarelli 6604e0d
Add endpoint /{entity_route}/{entity_id}/generated-by
GianlucaFicarelli 4a94eaf
Replace generated-by with derived-from
GianlucaFicarelli 6207667
Remove 1 and 2
GianlucaFicarelli 6d15605
Merge remote-tracking branch 'origin/main' into import_emodel_traces
GianlucaFicarelli 5be625f
Update migration after merge
GianlucaFicarelli 98bd2f5
Remove 3
GianlucaFicarelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
alembic/versions/20250602_145126_8f0d631d2bd4_default_migration_message.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Default migration message | ||
|
||
Revision ID: 8f0d631d2bd4 | ||
Revises: 1589bff44728 | ||
Create Date: 2025-06-02 14:51:26.859717 | ||
|
||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
from sqlalchemy import Text | ||
import app.db.types | ||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "8f0d631d2bd4" | ||
down_revision: Union[str, None] = "1589bff44728" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table( | ||
"derivation", | ||
sa.Column("used_id", sa.Uuid(), nullable=False), | ||
sa.Column("generated_id", sa.Uuid(), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["generated_id"], ["entity.id"], name=op.f("fk_derivation_generated_id_entity") | ||
), | ||
sa.ForeignKeyConstraint( | ||
["used_id"], ["entity.id"], name=op.f("fk_derivation_used_id_entity") | ||
), | ||
sa.PrimaryKeyConstraint("used_id", "generated_id", name=op.f("pk_derivation")), | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table("derivation") | ||
# ### end Alembic commands ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from typing import Annotated | ||
|
||
from fastapi_filter import FilterDepends | ||
|
||
from app.db.model import Entity | ||
from app.db.types import EntityType | ||
from app.filters.base import CustomFilter | ||
|
||
|
||
class BasicEntityFilter(CustomFilter): | ||
type: EntityType | None = None | ||
|
||
order_by: list[str] = ["-creation_date"] # noqa: RUF012 | ||
|
||
class Constants(CustomFilter.Constants): | ||
model = Entity | ||
ordering_model_fields = ["creation_date", "update_date", "name"] # noqa: RUF012 | ||
|
||
|
||
BasicEntityFilterDep = Annotated[BasicEntityFilter, FilterDepends(BasicEntityFilter)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
"""Generic derivation routes.""" | ||
|
||
from fastapi import APIRouter | ||
|
||
import app.service.derivation | ||
|
||
router = APIRouter( | ||
prefix="", | ||
tags=["derivation"], | ||
) | ||
|
||
router.get("/{entity_route}/{entity_id}/derived-from")(app.service.derivation.read_many) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.