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
12 changes: 12 additions & 0 deletions src/murfey/server/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,18 @@
return res


@router.get("/instruments/{instrument_name}/visits/{visit_name}/sessions")
def get_sessions_with_visit(
instrument_name: str, visit_name: str, db=murfey_db
) -> List[Session]:
sessions = db.exec(

Check warning on line 1812 in src/murfey/server/api/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/server/api/__init__.py#L1812

Added line #L1812 was not covered by tests
select(Session)
.where(Session.instrument_name == instrument_name)
.where(Session.visit == visit_name)
).all()
return sessions

Check warning on line 1817 in src/murfey/server/api/__init__.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/server/api/__init__.py#L1817

Added line #L1817 was not covered by tests


@router.get("/instruments/{instrument_name}/sessions")
async def get_sessions_by_instrument_name(
instrument_name: str, db=murfey_db
Expand Down
12 changes: 12 additions & 0 deletions src/murfey/server/demo_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1547,6 +1547,18 @@
return res


@router.get("/instruments/{instrument_name}/visits/{visit_name}/sessions")
def get_sessions_with_visit(

Check warning on line 1551 in src/murfey/server/demo_api.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/server/demo_api.py#L1550-L1551

Added lines #L1550 - L1551 were not covered by tests
instrument_name: str, visit_name: str, db=murfey_db
) -> List[Session]:
sessions = db.exec(

Check warning on line 1554 in src/murfey/server/demo_api.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/server/demo_api.py#L1554

Added line #L1554 was not covered by tests
select(Session)
.where(Session.instrument_name == instrument_name)
.where(Session.visit == visit_name)
).all()
return sessions

Check warning on line 1559 in src/murfey/server/demo_api.py

View check run for this annotation

Codecov / codecov/patch

src/murfey/server/demo_api.py#L1559

Added line #L1559 was not covered by tests


@router.get("/instruments/{instrument_name}/sessions")
async def get_sessions_by_instrument_name(
instrument_name: str, db=murfey_db
Expand Down