Skip to main content

The dag-modelling package is a python implementation of the dataflow programming with the lazy graph evaluation.

Project description

Summary

python pipeline coverage report

The DAGModelling software is a python implementation of the dataflow programming with the lazy graph evaluation approach.

Main goals:

  • Lazy evaluated directed acyclic graph;
  • Concise connection syntax;
  • Plotting with graphviz;
  • Flexibility. The goal of DAG-Modelling is not to be efficient, but rather flexible.

The framework is intented to be used for the statistical analysis of the data of JUNO and Daya Bay neutrino oscillation experiments.

Installation

For users (recommended)

For regular use, it's best to install the latest version of the project that's available on PyPi:

pip install dag-modelling

For developers

We recommend that developers install the package locally in editable mode:

git clone https://github.com/dagflow-team/dag-modelling.git
cd dag-modelling
pip install -e .

This way, the system will track all the changes made to the source files. This means that developers won't need to reinstall the package or set environment variables, even when a branch is changed.

Example

For example, let's consider a sum of three input nodes and then a product of the result with another array.

from numpy import arange

from dag_modelling.core.graph import Graph
from dag_modelling.plot.graphviz import savegraph
from dag_modelling.lib.common import Array
from dag_modelling.lib.arithmetic import Sum, Product

# Define a source data
array = arange(3, dtype="d")

# Check predefined Array, Sum and Product
with Graph(debug=debug) as graph:
    # Define nodes
    (in1, in2, in3, in4) = (Array(name, array) for name in ("n1", "n2", "n3", "n4"))
    s = Sum("sum")
    m = Product("product")

    # Connect nodes
    (in1, in2, in3) >> s
    (in4, s) >> m
    graph.close()

    print("Result:", m.outputs["result"].data) # must print [0. 3. 12.]
    savegraph(graph, "dag_modelling_example_1a.png")

The printed result must be [0. 3. 12.], and the created image looks as

graph example

For more examples see example/example.py or tests.

Please, note, that examples are using pygraphviz package, which is optional and not requested by default.

Repositories and additional modules

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

dag_modelling-0.14.2.tar.gz (130.6 kB view details)

Uploaded Source

Built Distribution

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

dag_modelling-0.14.2-py3-none-any.whl (194.6 kB view details)

Uploaded Python 3

File details

Details for the file dag_modelling-0.14.2.tar.gz.

File metadata

  • Download URL: dag_modelling-0.14.2.tar.gz
  • Upload date:
  • Size: 130.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for dag_modelling-0.14.2.tar.gz
Algorithm Hash digest
SHA256 d648e550f651e1341f016f3b9080337c22dc61b824dfaf4ac4488621c03e4fa8
MD5 47a20f42b23d8d3f534a5f7a2cd14855
BLAKE2b-256 2ba363daa3235865530ed1c390e0dcc9f4d9923cce7e83d2c72f22df73e82ecc

See more details on using hashes here.

File details

Details for the file dag_modelling-0.14.2-py3-none-any.whl.

File metadata

  • Download URL: dag_modelling-0.14.2-py3-none-any.whl
  • Upload date:
  • Size: 194.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for dag_modelling-0.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e8617e2b1835c05efb3b3b9c7040aa30329b106cec18fbcfb66a5d44a9c5441c
MD5 b6e24628a5957e88e1a0105a9fbcf43b
BLAKE2b-256 38a95845e441e617683f7395b51b77f2890266df3025b71597790c7257636e4f

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