base_integrator module

Implementation of basic integrator functions

class BaseIntegrator(*args, **kwargs)[source]

Bases: zunis.integration.integratorAPI.SurveyRefineIntegratorAPI

Base abstract class that implements common functionality

Parameters
  • f (function) – the function to integrate

  • n_iter (int) – general number of iterations - ignored for survey/refine if n_iter_survey/n_inter_refine is set

  • n_iter_survey (int) – number of iterations for the survey stage

  • n_iter_refine (int) – number of iterations for the refine stage

  • n_points – general number of points per iteration - ignored for survey/refine if n_points_survey/n_points_refine is set

  • n_points_survey (int) – number of points per iteration for the survey stage

  • n_points_refine (int) – number of points per iteration for the refine stage

  • use_survey (bool) – whether to use the points generated during the survey to compute the final integral not recommended due to uncontrolled correlations in error estimates

  • verbosity (int) – verbosity level of the integrator

static empty_history()[source]

Create an empty history object

finalize_integration(use_survey=None, **kwargs)[source]

Perform the final operations of the whole integration

finalize_refine(**kwargs)[source]

Perform the final operations of the refine phase

finalize_survey(**kwargs)[source]

Perform the final operations of the survey phase

initialize(**kwargs)[source]

Intialization before the whole integration process

initialize_refine(**kwargs)[source]

Initialization before the survey phase

initialize_survey(**kwargs)[source]

Initialization before the survey phase

integrate(n_survey_steps=None, n_refine_steps=None, **kwargs)[source]

Perform the integration

process_refine_step(sample, integral, integral_var, **kwargs)[source]

Process the result of a refine step

process_survey_step(sample, integral, integral_var, training_record, **kwargs)[source]

Process the result of a survey step

refine(n_refine_steps=None, **kwargs)[source]

Perform the refine phase of integration

Possible keyword arguments:

trainer_config_args: dict refine_step_args: dict finalize_refine_args: dict

sample_refine(*, n_points=None, f=None, **kwargs)[source]

Sample points for a refine step

survey(n_survey_steps=None, **kwargs)[source]

Perform a survey phase of integration

possible keyword arguments:

trainer_config_args: dict survey_step_args: dict finalize_survey_args: dict