Build Steps
- Run build_and_deploy.sh
Process Runners to update state
Pure functions should not modify the state. Instead they should return a copy of the state.
Each function should take the input state and output a modified copy of that state without effecting the original state. The global state can be then set to equal this new state. This ensures that we can easily test each process and be explicit on what it is modifying.
Process runner
Initial State ===> [Process 1] ====> New state
New State ===> [Process 2] ====> New state
New State ===> [Process 3] ====> New state
New State ===> [Process 4] ====> Output State
Through the use of functools.reduce we can create a process runner that will run a set of processes in turn on a state.
The process runner takes a list of processes and returns a function that takes the previous state and current process id.
Example runner:
def run_process(prev_state, process):
"""used in a reduce function to take previous state
and pass to next function"""
return process(prev_state)
def run_hour(processes):
"""Take a set of processes and return the process runner"""
def run_processes(initial_state: Model_State_Shape, hr: int) -> Model_State_Shape:
"""Takes the initial state at start of hour and the hour number"""
new_state = reduce(run_process, processes, initial_state)
return new_state
return run_processes
To use the runner:
def example_process(prev_state):
# do some stuff to the state
return new_state
initial_state = Model_State_Shape(1)
hr = 1
output_state = run_hour(
[
example_process,
]
)(initial_state, hr)
Example State
...
Example Processes
from proflow.Objects import Process, I
processes = [
Process(
func=lambda x, y, z: x + y + z,
comment="Demo process a",
config_inputs=[
I("foo.bar", as_="x"),
],
state_inputs=[I("info.today", as_="y"), I("info.hour", as_="z")],
state_outputs=[
I("_result", as_="info.tomorrow"),
],
),
Process(
func=lambda x, y: x + y,
comment="Demo process b",
config_inputs=[
I("foo.bar", as_="x"),
],
state_inputs=[
I("info.tomorrow", as_="y"),
],
state_outputs=[
I("_result", as_="info.today"),
],
),
Process(
func=lambda x, y: x + y,
comment="Demo process c with a really long comment and info",
config_inputs=[
I("foo.bar", as_="x"),
],
state_inputs=[
I("info.tomorrow", as_="y"),
],
state_outputs=[
I("_result", as_="info.today"),
],
),
Process(
func=lambda x, y: x + y,
comment="Demo process d",
config_inputs=[
I("foo.bar", as_="x"),
],
state_inputs=[
I("info.today", as_="y"),
],
state_outputs=[
I("_result", as_="info.tomorrow"),
I("_result", as_="log.extra"),
],
),
]
Process Attributes:
func
Callable[[Model_State_Shape], Model_State_Shape]
The function to call
gate
bool default = True
if False process is skipped
comment
str default = ""
used for logging
config_inputs
List[I] default = []
Dot notation config inputs
parameters_inputs
List[I] default = []
external_state_inputs
List[I] default = []
additional_inputs
List[tuple] default = []
state_inputs
List[I] default = []
state_outputs
List[I] default = []
args
List[any] default = []
additional args
Analysis Of Processes
In the experiments directory are some example of using the analysis tools
Link state and processes
Metadata
Release files for proflow 0.7.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| proflow-0.7.4.tar.gz | 533.8 kB | Without provenance | Details for proflow-0.7.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| proflow-0.7.4-py3-none-any.whl | Python 3 | none | any | Details for proflow-0.7.4-py3-none-any.whl |
Total release size: 605.7 kB
Release files / proflow-0.7.4.tar.gz
| Download URL | proflow-0.7.4.tar.gz |
|---|---|
| Size | 533.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bd88676a91c751614e4501cd47ba82ab780ce1f4fbf67cb1aeebaddf79bb2bc
|
|
BLAKE2b-256 checksum How to use checksums |
a9b725c31bec9b57d8e08030b719956eb83f19dc63ff847157133f26a6c0d218
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / proflow-0.7.4-py3-none-any.whl
| Download URL | proflow-0.7.4-py3-none-any.whl |
|---|---|
| Size | 71.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6657b6bf2b62d03c450cfc7d8f69540b3ef60f5f8d3fbdcd281602fe46548aa4
|
|
BLAKE2b-256 checksum How to use checksums |
12f45fe1d9f8fe13772bb6c4d0d3212f210bcdec95e148ce5d690f8d92e4cc01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for proflow 0.7.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.