gplately.PlateModelManager

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

Bases: object

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

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

Constructor. Create a PlateModelManager instance. You need Internet connection to create an instance of this class. If you don’t have Internet connection, use PlateModel class directly in readonly mode. Visit this page to see an example.

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 plate 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 plate model name.

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

Parameters:
  • model_name – the plate model name of interest

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

Returns:

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

property models: Dict

The metadata for all the models.