Skip to main content

Gridworks Base

Project description

Gridworks Base

PyPI Status Python Version License

Read the documentation at https://gridworks-base.readthedocs.io/ Tests Codecov

pre-commit Black

This repository serves two purposes:

  1. it provides the base class for the default GridWorks actor using pika, the main python package for interacting with RabbitMQ

    • install the gwbase package via
    $ pip install gridworks-base
    
  2. It provides scripts for runnig a local dev rabbit broker, which is the recommended way to develop.

Dev Rabbit Broker

All GridWorks repos require a running rabbitMQ dev broker running to pass tests or run dev simulations. Instructions for setting it up:

  • Make sure you have docker installed
  • Know whether your computer architecture is x86 or arm
  • Start the dev broker in a docker container:
    • x86 architecture: ./x86.sh
    • arm architecture: ./arm.sh

Tests for success:

  1. go to http://0.0.0.0:15672/ - it should look like this:

alt_text - Username/password for the dev rabbit broker: smqPublic/smqPublic - [More info]](https://gridworks.readthedocs.io/en/latest/gridworks-broker.html) on the GridWorks use of rabbit brokers

  1. tests pass
poetry install
poetry shell
pytest -v

This, and most other GridWorks repositories, use poetry installed via pipx to handle package management. They are also kicked off via Cookiecutter, which also sets up a template for continuous integration in github actions, package publishing on pypi as well as documentation at pypi.

TODO: EXPLAIN MORE ABOUT CI, BLACK, NOX, DEPENDABOT. A MORE LINKS TO WHY THIS STUFF IS IMPORTANT IN A PRODUCTION SYSTEM.

Hello Rabbit

Quick start for seeing how the actor base can send a message on the rabbit broker. Run hello_rabbit.py (after starting up the dev rabbit broker, see dev broker above) and look at the src/gwbase/actor_base.py code.

TODO: explain more about what this code does. Links to the type registroy, code generation. TODO: create a second hello script with two actors sending heartbeats back and forth.

Distributed under the terms of the MIT license, Gridworks Base is free and open source software.

Credits

This project was generated from @cjolowicz's Hypermodern Python Cookiecutter template.

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

gridworks_base-0.3.4.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

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

gridworks_base-0.3.4-py3-none-any.whl (53.8 kB view details)

Uploaded Python 3

File details

Details for the file gridworks_base-0.3.4.tar.gz.

File metadata

  • Download URL: gridworks_base-0.3.4.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for gridworks_base-0.3.4.tar.gz
Algorithm Hash digest
SHA256 2ed269191652cad930a4d5f090b77daac24e20eab72382043a0f7348236e720b
MD5 d23921f73a4a85adf87f27964ccb4963
BLAKE2b-256 bbf25c9929c43dc34358229354afddd0675870d8a2e33b8e7a2870b6567bd572

See more details on using hashes here.

File details

Details for the file gridworks_base-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: gridworks_base-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 53.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.8

File hashes

Hashes for gridworks_base-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 08eb5ebc60afe9c518e717e3ff1bc26627a79453b04a5cda3b4a99db6222612f
MD5 d3efd60bc1c86fce976210de0239e9dd
BLAKE2b-256 182cb37a84a930971baa5deae67119986262bbeeda20347b643f79f982b3a883

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