File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 5959 DataCollectionGroup ,
6060 FoilHole ,
6161 GridSquare ,
62+ MagnificationLookup ,
6263 Movie ,
6364 PreprocessStash ,
6465 ProcessingJob ,
@@ -166,6 +167,27 @@ def machine_info_by_name(instrument_name: str) -> Optional[MachineConfig]:
166167 return None
167168
168169
170+ @router .get ("/mag_table/" )
171+ def get_mag_table (db = murfey_db ) -> List [MagnificationLookup ]:
172+ return db .exec (select (MagnificationLookup )).all ()
173+
174+
175+ @router .post ("/mag_table/" )
176+ def add_to_mag_table (rows : List [MagnificationLookup ], db = murfey_db ):
177+ for r in rows :
178+ db .add (r )
179+ db .commit ()
180+
181+
182+ @router .delete ("/mag_table/{mag}" )
183+ def remove_mag_table_row (mag : int , db = murfey_db ):
184+ row = db .exec (
185+ select (MagnificationLookup ).where (MagnificationLookup .magnification == mag )
186+ ).one ()
187+ db .delete (row )
188+ db .commit ()
189+
190+
169191@router .get ("/instruments/{instrument_name}/instrument_name" )
170192def get_instrument_display_name (instrument_name : str ) -> str :
171193 machine_config = get_machine_config (instrument_name = instrument_name )[
You can’t perform that action at this time.
0 commit comments