gplately.PlateModelManager

class gplately.PlateModelManager(model_manifest: str = '', timeout=(None, None))[source]

Bases: object

Manage a set of public available plate reconstruction models. The model files are hosted on EarthByte servers. You need Internet connection to download the files.

__init__(model_manifest: str = '', timeout=(None, None))[source]

Constructor. Create a PlateModelManager instance.

Parameters:

model_manifest – The URL to a models.json metadata file. Normally you don’t need to provide this parameter unless you would like to setup your own plate model server.

Methods

__init__([model_manifest, timeout])

Constructor.

download_all_models([data_dir])

Download all available models into the data_dir.

get_available_model_names()

Return the names of available models as a list.

get_default_repo_url()

Return the URL to the configuration data of models.

get_local_available_model_names(local_dir)

Return a list of model names in a local folder.

get_model([model_name, data_dir])

Return a PlateModel object for a given model name.

Attributes

models

The metadata for all the models.

download_all_models(data_dir: str = './') None[source]

Download all available models into the data_dir.

Parameters:

data_dir (str) – The folder to save the model files.

get_available_model_names()[source]

Return the names of available models as a list.

static get_default_repo_url()[source]

Return the URL to the configuration data of models.

static get_local_available_model_names(local_dir: str)[source]

Return a list of model names in a local folder.

Parameters:

local_dir (str) – The local folder containing models.

get_model(model_name: str = 'default', data_dir: str = '.') PlateModel | None[source]

Return a PlateModel object for a given model name.

Call get_available_model_names() to see a list of available model names.

Parameters:
  • model_name – the model name of interest

  • data_dir – The folder to save the model files. This data_dir can be changed with PlateModel.set_data_dir() later.

Returns:

a PlateModel object or None if the model name is no good.

property models: Dict

The metadata for all the models.