Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/howtocalibration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ In this tutorial, we describe how to include a new calibrator to the surmise's
framework. We illustrate this with ``directbayeswoodbury``--a calibrator method located
in the directory ``\calibrationmethods``.

In surmise, all calibrator methods inherit from the base class
:py:class:`surmise.calibration.calibrator`. A calibrator class calls the user
input method, and fits the corresponding calibrator.
In surmise, all calibrator methods are automatically discovered from `.py` code files under ``\calibrationmethods``.
A calibrator class calls the user input method via the filename without extension, e.g., `directbayeswoodbury`, and fits the corresponding calibrator.
:py:meth:`surmise.calibration.calibrator.fit` is the main
:py:class:`surmise.calibration.calibrator` class methods. It also provides the
functionality of updating and manipulating the fitted calibrator by
:py:meth:`surmise.calibration.calibrator.predict` class methods.

In order to use the functionality of the base class :py:class:`surmise.calibration.calibrator`, we categorize the functions to be included in a new emulation method (for example, ``directbayeswoodbury``) into two categories.
In order to use the functionality of the base class :py:class:`surmise.calibration.calibrator`,
we categorize the functions to be included in a new emulation method (for example, ``directbayeswoodbury``)
into two categories.

Mandatory functions
++++++++++++++++++++
Expand Down
23 changes: 15 additions & 8 deletions docs/howtoemulation.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
How to include a new emulator
==============================================

In this tutorial, we describe how to include a new emulator to the surmise's
framework. We illustrate this with ``PCGP``--an emulator method located in the
directory ``\emulationmethods``.

In surmise, all emulator methods inherit from the base class :py:class:`surmise.emulation.emulator`.
An emulator class calls the user input method, and fits the corresponding
emulator. :py:func:`surmise.emulation.emulator.fit` and :py:func:`surmise.emulation.emulator.predict`
When loaded, the surmise package automatically identifies all available
emulators by locating all ``.py`` codes in the ``emulationmethods`` folder
within its installation [#f1]_. For example, it assumes that the
``emulationmethods/PCGP.py`` file provides the ``PCGP`` emulator, which is the
emulator name that users should provide when choosing a particular emulator to
use for a fit. Therefore, users can integrate their own emulator in surmise by
placing their emulator's Python source code in that same folder. This tutorial
describes how to structure a custom emulator code so that this integration is
successful.

:py:func:`surmise.emulation.emulator.fit` and :py:func:`surmise.emulation.emulator.predict`
are the main :py:class:`surmise.emulation.emulator` class methods.
It also provides the functionality of updating and manipulating the
fitted emulator by :py:func:`surmise.emulation.emulator.supplement`,
Expand Down Expand Up @@ -67,3 +70,7 @@ Optional functions
++++++++++++++++++++

``supplementtheta()`` is an optional function for an emulation method.

.. rubric:: Footnotes

.. [#f1] The location of a surmise installation that was installed into a virtual environment, for example, might be ``~/local/venv/my_surmise/lib/python3.14/site-packages/surmise`` or, in Windows, ``~/local/surmise_venv/Lib/site-packages/surmise/emulationmethods``