Mark Live Session as complete via the CLI

What’s the correct approach to marking a live session as complete from the cli? trying to automate lifetime of sessions and cleaning up session data as correctly as possible. I couldn’t find a function for doing so in the limited poking around of the cli object, maybe cli.update_session()?

A post was split to a new topic: Job card still visible after cli delete_job()

Hey @yoshiokc,

This is currently not documented anywhere, but you can run:
cryosparcm rtpcli "mark_session_completed(project_uid, session_uid)"
or in cryosparcm icli:

rtp.mark_session_completed(project_uid, session_uid)

NOICE! thanks, out of curiosity, what exactly does being marked for completion do? It takes long enough in the GUI that I assume some FS operations are being done on the backend rather than just DB updates. Thanks again!

never mind, answered my own question by checking the code for the function call, thanks!

For posterity, marking a session as “completed” via the UI or through the above CLI function will:

  1. Pause the session if it’s not already paused
  2. Set the session’s status to completed
  3. Compute session statistics (total exposures, total failed, etc.)
  4. Update the size of each data type in the session (e.g., micrographs, particles, thumbnails, etc.,) for the data management tab
  5. Export the database documents of the session to disk (all images, log messages, etc.,)

For more information about managing a CryoSPARC Live session via the CLI, please see: