Logo

User Documentation

  • Introduction
    • Why use PRISM?
    • When (not) to use PRISM?
  • Getting started
    • Installation
    • Running tests
    • Example usage
  • The PRISM pipeline
    • MPI implementation
  • ModelLink: A crash course
    • Writing a ModelLink subclass
    • Data identifiers (data_idx)
    • Wrapping a model (call_model)
      • Input arguments
      • Multi-calling
      • Backing up progress
    • Model discrepancy variance (md_var)
      • Theory
      • Implementation
  • Using PRISM
    • Minimal example
    • Projections
      • Properties
      • Options
    • Dual nature (normal/worker mode)
    • Hybrid sampling
      • Algorithm
      • Usage
      • Application
    • General usage rules
    • External data files
      • PRISM parameters file
      • Model parameters file
      • Model data file
  • Descriptions
    • Terminology
    • PRISM parameters
    • HDF5
  • FAQ
    • How do I contribute?
    • How do I report a bug/problem?
    • What does the term … mean?
    • What OS are supported?
  • Community guidelines
    • License
    • Additions

API Reference

  • Pipeline
  • Emulator
    • Classes
      • Emulator
  • ModelLink
    • Classes
      • GaussianLink
      • ModelLink
      • SineWaveLink
    • Utilities
  • Utilities
  • Internal
PRISM
  • Docs »
  • ModelLink
  • Edit on GitHub
Next Previous

ModelLink¶

Classes¶

  • GaussianLink
  • ModelLink
  • SineWaveLink

Utilities¶

prism.modellink.convert_data(model_data)[source]¶

Converts the provided model_data into a full data dict, taking into account all formatting options, and returns it.

This function can be used externally to check how the provided model_data would be interpreted when provided to the ModelLink subclass. Its output can be used for the ‘model_data’ input argument.

Parameters:model_data (array_like, dict or str) – Anything that can be converted to a dict that provides model data information.
Returns:data_dict (dict) – Dict with the provided model_data converted to its full format.
prism.modellink.convert_parameters(model_parameters)[source]¶

Converts the provided model_parameters into a full parameters dict, taking into account all formatting options, and returns it.

This function can be used externally to check how the provided model_parameters would be interpreted when provided to the ModelLink subclass. Its output can be used for the ‘model_parameters’ input argument.

Parameters:model_parameters (array_like, dict or str) – Anything that can be converted to a dict that provides model parameters information.
Returns:par_dict (dict) – Dict with the provided model_parameters converted to its full format.
prism.modellink.test_subclass(subclass, *args, **kwargs)[source]¶

Tests a provided ModelLink subclass by initializing it with the given args and kwargs and checking if all required methods can be properly called.

This function needs to be called by all MPI ranks.

Parameters:
  • subclass (ModelLink subclass) – The ModelLink subclass that requires testing.
  • args (tuple) – Positional arguments that need to be provided to the constructor of the subclass.
  • kwargs (dict) – Keyword arguments that need to be provided to the constructor of the subclass.
Returns:

modellink_obj (ModelLink object) – Instance of the provided subclass if all tests pass successfully. Specific exceptions are raised if a test fails.

Note

Depending on the complexity of the model wrapped in the given subclass, this function may take a while to execute.

Next Previous

© Copyright 2019, Ellert van der Velden Revision 76429a3f.

Built with Sphinx using a theme provided by Read the Docs.