Save N latest computed spectra to improve performances when computing the same one twice
The SpectrumFactory (machinery behind calc_spectrum) can be connected to a SpecDatabase, which is really only a local folder, to automatically retrieve a Spectrum if it's already there; and store it if it's not.
This is not implemented at the calc_spectrum level, but it could be done quite easily (already asked for a few years ago in https://github.com/radis/radis/issues/135 ). The api would be something like :
s = calc_spectrum(..., local_folder="~/radis_spectra") # automatically retrieve spectra if needed, computes and stores then if not
Advantages :
similarities & tests are kept at the Radis backend level; we're sure Radis-App is not mistakently returning a different spectrum it thoughts was the same
Radis has HDF5 read/write of spectra, so ready/writing will be almost instantaneous (if we're smart in the computation conditions ; retrieving a spectrum on a narrower spectrum than the one already computed would work too )
no need to change much in Radis-app
we'd probably only have to add a feature to keep only the N latest spectra ; or clean the cache periodically.
Save N latest computed spectra to improve performances when computing the same one twice
The
SpectrumFactory
(machinery behindcalc_spectrum
) can be connected to aSpecDatabase
, which is really only a local folder, to automatically retrieve a Spectrum if it's already there; and store it if it's not.This is not implemented at the
calc_spectrum
level, but it could be done quite easily (already asked for a few years ago in https://github.com/radis/radis/issues/135 ). The api would be something like :Advantages :
_Originally posted by @erwanp in https://github.com/suzil/radis-app/pull/619#discussion_r942676770_