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
      • Crystal (GUI)
    • 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?
    • Where can I get PRISM’s colormaps?
    • Which OSs are supported?
  • Community guidelines
    • License
    • Citation
    • Additions

API Reference

  • Pipeline
  • Emulator
    • Classes
      • Emulator
  • ModelLink
    • Classes
      • GaussianLink
      • ModelLink
      • PolyLink
      • SineWaveLink
    • Utilities
  • Utilities
  • Projection GUI
    • Classes
      • MainViewerWindow
      • OverviewDockWidget
      • ViewingAreaDockWidget
    • Widgets
      • GUI Base Layout Classes
      • GUI Base Widget Classes
      • GUI Widgets Core
      • GUI Widget Helpers
      • GUI Preferences
        • GUI Options
        • GUI Kwargs Dicts Options
        • GUI Custom Option Boxes
    • Functions
  • Internal
PRISM
  • Docs »
  • ModelLink
  • Edit on GitHub
Next Previous

ModelLink¶

Classes¶

  • GaussianLink
  • ModelLink
  • PolyLink
  • 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 (positional arguments) – Positional arguments that need to be provided to the constructor of the subclass.
  • kwargs (keyword arguments) – 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-2021, Ellert van der Velden Revision e5cc46fd.

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