Model Library API

The JuliaSim software is available for preview only. Please contact us for access, by emailing [email protected], if you are interested in evaluating JuliaSim.

In this section, we provide a high-level overview of the JuliaSim Model Library API. The general functions are presented first, and are then followed by more specialized entries. The function names are largely self-explanatory. Where needed, an additional description is provided.

Searching for a model

A model can be easily found by invoking the available_model_families or available_models functions. For instance, the user might want to check whether there exists a poissonpde model in the PDESurrogates library:

using PDESurrogates
available_models(PDESurrogates, "poissonpde")

It is also useful to inspect the complete list of models offered by a library:

available_model_families(PDESurrogates)

We then obtain the following information:

2-element Vector{String}:
 "lorenzpde"
 "poissonpde"

available_model_families function

The available_model_families function takes the following positional argument:

  • library: The library to be queried.

available_models function

The available_models function takes the following positional arguments:

  • library: The library to be queried.

  • name: The name of the model (a String).

The keyword argument is:

  • variants: Variants of the model.

Note that other keyword arguments are specific to a given model.

If the exact match is found, the function returns the following list: [(variant named tuple, available versions)]. Otherwise, all partial matches are returned according to the format: [(variant named tuple, available versions)]. A partial matched is defined as a match where the fields in variants are a proper subset of the variants in the model. For example, (a = 1, b = 2) would match with (a = 1, b = 2, c = 3) but not with (a = 1, c = 3). In the case where no partial match is found, an empty list is returned.


Querying a specific model

load_model function

The load_model function takes the following positional arguments:

  • library: The library that hosts the model.

  • name: The name of the model (a String).

The keyword arguments are:

  • version: Version of the model. Default: nothing (the latest version of a given variant)

  • variants: Variants of the model.

Note that other keyword arguments are specific to a given model.

model_description function

The model_description function takes the following positional arguments:

  • library: The library that hosts the model.

  • name: The name of the model (a String).

The keyword argument is:

  • variants: Variants of the model.

Note that other keyword arguments are specific to a given model.

query_metadata function

The query_metadata function fetches the model metadata. The full list includes:

  • name: The name of the model.

  • version: The version of the model.

  • timestamp: A precise date and time when the model was added.

Format: YYYY-MM-DDTH:M:S.MS.

  • states: Model-specific states.

  • observables: Model-specific observables.

  • parameters: Model-specific parameters.

  • description: A full description of the model.

  • tldr: A summary of the model.

  • source: The source of the model.

  • variants: The variants of the model.

Additional variant-specific information is also be available.

The function takes the following positional arguments:

  • library: The library that hosts the model.

  • name: The name of the model (a String).

The keyword arguments are:

  • version: Version of the model. Default: nothing.

  • variants: Variants of the model.

Note that other keyword arguments are specific to a given model.