oasislmf.warmup =============== .. py:module:: oasislmf.warmup .. autoapi-nested-parse:: Warm the Numba JIT cache for all pytools modules. Runs each tool's compilation in a parallel process pool so that all ~191 Numba-compiled functions are cached in __pycache__ before the first real model run. This eliminates the 163-365 s cold-start overhead. Test assets are bundled in oasislmf/_data/warmup/ (~400 KB) so this works both from a source checkout and after ``pip install oasislmf`` from PyPI. Usage (CLI): oasislmf warmup Usage (standalone): python -m oasislmf.warmup Usage (Dockerfile): RUN pip install oasislmf && oasislmf warmup Usage (pytest): pytest tests/pytools/test_jit_compilation.py::test_jit_compile_all -v Disable (when using NUMBA_DISABLE_JIT): NUMBA_DISABLE_JIT=1 oasislmf warmup Attributes ---------- .. autoapisummary:: oasislmf.warmup.occurrence_rel_path oasislmf.warmup.periods_rel_path oasislmf.warmup.returnperiods_rel_path oasislmf.warmup.quantile_rel_path oasislmf.warmup.correlations_rel_path oasislmf.warmup.coverages_rel_path oasislmf.warmup.events_rel_path oasislmf.warmup.items_rel_path oasislmf.warmup.amplifications_rel_path oasislmf.warmup.damage_bin_dict_rel_path oasislmf.warmup.footprint_rel_path oasislmf.warmup.footprint_idx_rel_path oasislmf.warmup.vulnerability_rel_path oasislmf.warmup.lossfactors_rel_path oasislmf.warmup.summary_rel_path oasislmf.warmup.ALL_SILENT_TASKS Functions --------- .. autoapisummary:: oasislmf.warmup.warmup oasislmf.warmup.main Module Contents --------------- .. py:data:: occurrence_rel_path .. py:data:: periods_rel_path .. py:data:: returnperiods_rel_path .. py:data:: quantile_rel_path .. py:data:: correlations_rel_path .. py:data:: coverages_rel_path .. py:data:: events_rel_path .. py:data:: items_rel_path .. py:data:: amplifications_rel_path .. py:data:: damage_bin_dict_rel_path .. py:data:: footprint_rel_path .. py:data:: footprint_idx_rel_path .. py:data:: vulnerability_rel_path .. py:data:: lossfactors_rel_path .. py:data:: summary_rel_path .. py:data:: ALL_SILENT_TASKS .. py:function:: warmup(max_workers=None) Run all JIT compilations in parallel. Args: max_workers: Max parallel processes. Defaults to cpu_count. Returns: dict of task_name -> error for any failures (empty on success). .. py:function:: main()