nirs4all.api.library_playground module

Closed-contract Playground callable for a Rust-owned Studio stdio host.

The caller owns path authorization, transport, cancellation and any request or response byte budget. This module only validates one closed JSON request and delegates scientific work to the library’s stateless Playground facade. It opens no listener, queue or store and imposes no content-size ceiling.

A warm host process keeps the last loaded dataset between requests. It is reused only for an identical dataset request whose input files still have the same path, size, modification time and inode; scientific steps work on copies extracted from it, so a reused dataset gives the same result as a fresh load.

Response contract additions (nirs4all.studio-playground-result.v1):

  • With options.omit_unchanged_processed_spectra set to true, an execute result whose processed spectra are bitwise identical to its original spectra omits processed.spectra and carries processed_is_original: true; the caller reads original.spectra for both. Without the option, both matrices are always returned.

nirs4all.api.library_playground.studio_playground_job_v1(request: object) → dict[str, Any][source]

Run one closed Playground request for an attested stdio caller.