A function-managing package for models and systems with shared variables.
Project description
porchlight
porchlight
is a function management suite that manages common inputs and
outputs of methods and/or functions.
This package's original intent was to be a part of a modular scientific package yet to be released. Rather than isolating this method to a single model, the already-developed work has been modified to stand alone as a package.
porchlight
does not have any dependencies outside of the standard CPython
library. Please note that porchlight
requires Python 3.9+.
Installation
You can install porchlight
by cloning this repository to a local directory,
opening a command line, and running:
pip install porchlight
Usage
The main object used in porchlight
is the porchlight.Neighborhood
object.
This groups all functions together and keeps track of call order and
parameters.
import porchlight
# We call a porchlight.Neighborhood object to instantiate it with no functions
# yet.
neighborhood = porchlight.Neighborhood()
# To add a function, we simply define it and pass it to porchlight.
def increment_x(x: int, y: int) -> int:
x = x * y
return x
neighborhood.add_function(increment_x)
# The neighborhood object inspects the function, finding input and output
# variables if present. These are added to the collections of functions and
# parameters.
print(neighborhood) # porchlight.Neighborhood has a pretty-print string.
Although this is the current extent of documentation, there should be some more complete documentation within the next couple weeks/months.
Documentation
Documentation for porchlight
can be found on Read the Docs here: https://porchlight.readthedocs.io/en/latest/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for porchlight-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6770c068cad6ed5e8e0063b341f4901d34a6c98f0b41e227224df19d8f95cda |
|
MD5 | 6488aa38eb342c3672c418b952bc35ac |
|
BLAKE2b-256 | e6eb0dcbebd692cfd6e5da6187b5fafa00b8cb1fcf985b4d935df073bd600126 |