Skip to content

Commit 118a746

Browse files
Add fiber app to metadata portal (#55)
This PR adds a fiber viewer app to {metadata portal url}/fiber_viewer. This pulls fiber locations from the metadata service, the displays fiber names and locations in a top down view. For example: <img width="806" height="995" alt="image" src="https://github.com/user-attachments/assets/485b047c-1255-4453-b67d-7c5c2aa703d8" /> This is designed to limit the possibility that scientists/RAs at the rig inadvertently plug the a patch cable to the wrong implanted fiber. Queries to the metadata service are slow, so first time views take about 30 seconds. Procedures records are cached so subsequent calls for the same mouse are fast. To test the PR: * check out this branch: `git checkout add_fiber_app` * run the panel app locally: `uv run panel serve src/aind_metadata_viz/fiber_viewer.py --show --autoreload` * enter a mouse id (e.g. 804434, 804430, 813992). Mice without fiber implants will return an error.
2 parents e37e613 + b37576f commit 118a746

File tree

5 files changed

+1035
-1
lines changed

5 files changed

+1035
-1
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,9 @@ dmypy.json
141141
# Local UI testing
142142
panel_chat_query.py
143143
.github/copilot-instructions.md
144+
145+
# Procedures cache
146+
.cache/procedures/
147+
148+
# Claude Code project instructions
149+
.claude/

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ credential_source = EcsContainer
1717
EOF
1818

1919
EXPOSE 8000
20-
ENTRYPOINT ["sh", "-c", "panel serve src/aind_metadata_viz/app.py src/aind_metadata_viz/view.py src/aind_metadata_viz/query.py src/aind_metadata_viz/upgrade.py --static-dirs images=src/aind_metadata_viz/images --plugins aind_metadata_viz.validation --address 0.0.0.0 --port 8000 --allow-websocket-origin ${ALLOW_WEBSOCKET_ORIGIN} --keep-alive 10000 --index app.py"]
20+
ENTRYPOINT ["sh", "-c", "panel serve src/aind_metadata_viz/app.py src/aind_metadata_viz/view.py src/aind_metadata_viz/query.py src/aind_metadata_viz/upgrade.py src/aind_metadata_viz/fiber_viewer.py --static-dirs images=src/aind_metadata_viz/images --plugins aind_metadata_viz.validation --address 0.0.0.0 --port 8000 --allow-websocket-origin ${ALLOW_WEBSOCKET_ORIGIN} --keep-alive 10000 --index app.py"]

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ dependencies = [
2929
'langchain_aws',
3030
'aind-metadata-upgrader>=0.6.2',
3131
'numpy<2.0',
32+
'vl-convert-python',
3233
]
3334

3435
[project.optional-dependencies]

0 commit comments

Comments
 (0)