gplately.PlateModelManager
- class gplately.PlateModelManager(model_manifest: str = '', timeout=(None, None))[source]
Bases:
objectManage 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
PlateModelManagerinstance. You need Internet connection to create an instance of this class. If you don’t have Internet connection, usePlateModelclass directly inreadonlymode. Visit this page to see an example.- Parameters:
model_manifest – The URL to a
models.jsonmetadata 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.Return the names of available models as a list.
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
PlateModelobject for a given plate model name.Attributes
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.
- 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
PlateModelobject 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_dircan be changed withPlateModel.set_data_dir()later.
- Returns:
a
PlateModelobject orNoneif the plate model name is no good.