Skip to main content

Plate Model Manager

Project description

plate-model-manager

build workflow PyPI version anaconda_badge platforms downloads

Originally the plate-model-manager was designed for GPlately. Later, it was found also useful in other scenarios and contexts. The plate-model-manager downloads and manages the plate reconstruction model files. It is a dataset manager for plate tectonic reconstruction models, similar to NPM or Conda for software packages.

Have you ever wondered where to get the plate tectonic reconstruction models for your research? Are you tired of downloading files from Internet manually and specify file paths when calling PyGPlates functions? If the answer is yes, you probably want to check out this plate-model-manager Python module.

How to install

pip install plate-model-manager

How to use

Use the command line

  • pmm ls

    This command will list all available plate tectonic reconstruction models.

    pmm ls command screenshot

  • pmm ls Muller2019

    This command will show the details of model 'Muller2019'.

    pmm ls model command screenshot

  • pmm download Muller2019 plate-models-data-dir

    This command will download model "Muller2019" into a folder 'plate-models-data-dir'.

    pmm download model screenshot

  • pmm download all

    This command will download all available models into the current working directory.

    pmm download all screenshot

Use in Python script

👉 The Python code below prints all available model names.

# print all available model names
from plate_model_manager import PlateModelManager

pm_manager = PlateModelManager()
for name in pm_manager.get_available_model_names():
  print(name)

python list all models screenshot

👉 The Python code below downloads the "Muller2019" model into folder "plate-models-data-dir". The model.get_rotation_model() function returns the rotation file location.

from plate_model_manager import PlateModelManager

pm_manager = PlateModelManager()
model = pm_manager.get_model("Muller2019",data_dir="plate-models-data-dir")
print(model.get_rotation_model())

python print rotation screenshot

Examples

This Python module is mostly used in GPlately, GPlates Web Service, PyGPlates Tutorials and GPlates Python Proxy.

A good example of using PlateModelManager with PyGPlates can be found at https://github.com/GPlates/pygplates-tutorials/blob/master/notebooks/working-with-plate-model-manager.ipynb.

The examples of using PlateModelManager with GPlately:

The PlateModelManager can also be used with the GPlates desktop. Use the command line to download the plate model files and open the files with GPlates desktop. This will save the trouble of downloading files from Internet manually.

Dependencies

  • aiohttp
  • requests
  • nest_asyncio

Event loop RuntimeError

For Jupyter Notebook, Web Server or GUI application users, you need the following two lines to workaround the event loop RuntimeError. If you do not add these two lines, the PlateModelManager still works. But you will see a warning message. You can ignore the warning message safely. If the warning message bothers you, add the two lines before calling PlateModelManager.

https://anaconda.org/conda-forge/nest-asyncio/

import nest_asyncio
nest_asyncio.apply()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plate-model-manager-1.1.4.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plate_model_manager-1.1.4-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file plate-model-manager-1.1.4.tar.gz.

File metadata

  • Download URL: plate-model-manager-1.1.4.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for plate-model-manager-1.1.4.tar.gz
Algorithm Hash digest
SHA256 11dca342deae5a8df8207481bec1b641d14c67fca2cddca14248fffa8ddbc688
MD5 d13aee44d5e1bd1cc1cc09ab7269b25e
BLAKE2b-256 9a0b8f92665692429ac699c7d41468f69ffdd0048167d516776fd8026bbce226

See more details on using hashes here.

File details

Details for the file plate_model_manager-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for plate_model_manager-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 89355bb935515881c908234f1d15f46ac20e729fd73c52799b78725558de5aa7
MD5 ec9b03cc688f1fc9f4ef1575eb155fb6
BLAKE2b-256 ee172176b1c8b815fd6cee9775f25cebade35303e26ad8e58803631f62bed8fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page