Convert the saved session state into a NeuronView. May be slow because the NeuronView constructor recomputes activations.
(session_id: str)
| 126 | |
| 127 | |
| 128 | def get_nv(session_id: str) -> NeuronView: |
| 129 | """ |
| 130 | Convert the saved session state into a NeuronView. |
| 131 | May be slow because the NeuronView constructor recomputes activations. |
| 132 | """ |
| 133 | |
| 134 | if session_id not in SESSIONS: |
| 135 | raise HTTPException(status_code=404, detail="Session not found") |
| 136 | |
| 137 | cc, filter = SESSIONS[session_id] |
| 138 | nv = NeuronView(SUBJECT, DB, cc, PERCENTILES_PLI) |
| 139 | if filter is not None: |
| 140 | nv.set_filter(filter) |
| 141 | return nv |
| 142 | |
| 143 | |
| 144 | @asgi_app.post("/register") |
no test coverage detected