Skip to main content

A Python package for integrating OpenGMS geographic model services.

Project description

PyGeoModel

PyGeoModel is a Python package for integrating OpenGMS geographic model services into Python-based urban data science workflows. It provides programmatic access to model-service discovery, metadata inspection, service invocation, and result management. For exploratory notebook-based analysis, PyGeoModel also provides an optional Jupyter interface built on the same core API.

Installation

pip install PyGeoModel

Use the package in Python with:

from pygeomodel import GeoModeler

Core API

from pygeomodel import GeoModeler

modeler = GeoModeler()

models = modeler.search_models("photovoltaic")
model = modeler.get_model("Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model")

print(model.description)
print(model.inputs)
print(model.outputs)

Model services can be invoked programmatically:

result = modeler.invoke(
    "Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
    params={
        "system_efficiency": 0.8,
        "start_time": "2018-01",
        "end_time": "2018-12",
        "roof_vector_path": "data/rooftops.zip",
    },
)

saved_files = result.save(output_dir="data/result/live_run")

The model configuration is recorded directly in the Python cell through the explicit params dictionary, while TaskResult.save() stores the downloadable model outputs for subsequent analysis.

Notebook Interface

modeler.show_models()
modeler.invoke_model("Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model")

The notebook interface renders model search, metadata inspection, parameter entry, task execution, and output display. It uses the same search_models(), get_model(), and invoke() functions as the programmatic API so GUI operations can be converted into explicit Python parameters and saved model outputs when needed.

Recommendation and Q&A

recommendation = modeler.suggest_model()

answer = modeler.ask_model(
    "Roof Photovoltaic Carbon Emission Reduction Potential Assessment Model",
    "What input data are required?",
)

The recommendation service automatically builds notebook/data context and calls the configured recommendation workflow. Q&A uses OpenGMS model metadata and an OpenAI-compatible web-enabled model. The main notebook workflow is designed to run out of the box for demonstration use.

Relation to OpenGMS

OpenGMS provides the model-service platform and online execution infrastructure. PyGeoModel is a Python client package that exposes OpenGMS model-service discovery, metadata inspection, task invocation, and result management to Python and notebook workflows.

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

pygeomodel-1.0.15.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

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

pygeomodel-1.0.15-py3-none-any.whl (4.5 MB view details)

Uploaded Python 3

File details

Details for the file pygeomodel-1.0.15.tar.gz.

File metadata

  • Download URL: pygeomodel-1.0.15.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for pygeomodel-1.0.15.tar.gz
Algorithm Hash digest
SHA256 f3612fb4d03290b5f427f51455ac6e9d9b095a70e3732c6be0e00f26b6f3cfaf
MD5 c0d9df68f02d91939df991ab203a99d2
BLAKE2b-256 8d42e73c7d525290673c023fe5e7401f7fd38b23c5be38e679259ae6237ae996

See more details on using hashes here.

File details

Details for the file pygeomodel-1.0.15-py3-none-any.whl.

File metadata

  • Download URL: pygeomodel-1.0.15-py3-none-any.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for pygeomodel-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 ee97b2021d9c21d6bcd4f8c2ee3a8b3cc759ced3f4342890e81ab557135d6f2b
MD5 c5c9506e00af7f0e88aed49d1c398562
BLAKE2b-256 13812d043e72b73aeaaaec9e82a87d1e641a4a4fadab6e67a6054c5a647cdd2f

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