dag-modelling 0.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dag_modelling-0.12/LICENSE +21 -0
- dag_modelling-0.12/PKG-INFO +126 -0
- dag_modelling-0.12/README.md +85 -0
- dag_modelling-0.12/pyproject.toml +53 -0
- dag_modelling-0.12/setup.cfg +4 -0
- dag_modelling-0.12/src/dag_modelling/__init__.py +0 -0
- dag_modelling-0.12/src/dag_modelling/bundles/__init__.py +0 -0
- dag_modelling-0.12/src/dag_modelling/bundles/file_reader.py +592 -0
- dag_modelling-0.12/src/dag_modelling/bundles/load_array.py +100 -0
- dag_modelling-0.12/src/dag_modelling/bundles/load_graph.py +163 -0
- dag_modelling-0.12/src/dag_modelling/bundles/load_hist.py +169 -0
- dag_modelling-0.12/src/dag_modelling/bundles/load_parameters.py +489 -0
- dag_modelling-0.12/src/dag_modelling/bundles/load_record.py +135 -0
- dag_modelling-0.12/src/dag_modelling/bundles/make_y_parameters_for_x.py +72 -0
- dag_modelling-0.12/src/dag_modelling/core/__init__.py +2 -0
- dag_modelling-0.12/src/dag_modelling/core/data_descriptor.py +125 -0
- dag_modelling-0.12/src/dag_modelling/core/edges.py +278 -0
- dag_modelling-0.12/src/dag_modelling/core/exception.py +115 -0
- dag_modelling-0.12/src/dag_modelling/core/flags_descriptor.py +123 -0
- dag_modelling-0.12/src/dag_modelling/core/graph.py +197 -0
- dag_modelling-0.12/src/dag_modelling/core/graph_base.py +45 -0
- dag_modelling-0.12/src/dag_modelling/core/input.py +285 -0
- dag_modelling-0.12/src/dag_modelling/core/input_strategy.py +292 -0
- dag_modelling-0.12/src/dag_modelling/core/iter.py +8 -0
- dag_modelling-0.12/src/dag_modelling/core/iterators.py +44 -0
- dag_modelling-0.12/src/dag_modelling/core/labels.py +693 -0
- dag_modelling-0.12/src/dag_modelling/core/make_fcn.py +117 -0
- dag_modelling-0.12/src/dag_modelling/core/meta_node.py +307 -0
- dag_modelling-0.12/src/dag_modelling/core/node.py +712 -0
- dag_modelling-0.12/src/dag_modelling/core/node_base.py +187 -0
- dag_modelling-0.12/src/dag_modelling/core/output.py +533 -0
- dag_modelling-0.12/src/dag_modelling/core/storage.py +903 -0
- dag_modelling-0.12/src/dag_modelling/core/type_functions/__init__.py +41 -0
- dag_modelling-0.12/src/dag_modelling/core/type_functions/axes_type_functions.py +289 -0
- dag_modelling-0.12/src/dag_modelling/core/type_functions/copy_type_functions.py +101 -0
- dag_modelling-0.12/src/dag_modelling/core/type_functions/input_type_functions.py +379 -0
- dag_modelling-0.12/src/dag_modelling/core/type_functions/output_type_functions.py +46 -0
- dag_modelling-0.12/src/dag_modelling/core/type_functions/tools_for_type_functions.py +62 -0
- dag_modelling-0.12/src/dag_modelling/core/types.py +8 -0
- dag_modelling-0.12/src/dag_modelling/export/__init__.py +0 -0
- dag_modelling-0.12/src/dag_modelling/export/to_root.py +262 -0
- dag_modelling-0.12/src/dag_modelling/lib/__init__.py +0 -0
- dag_modelling-0.12/src/dag_modelling/lib/abstract/__init__.py +7 -0
- dag_modelling-0.12/src/dag_modelling/lib/abstract/block_to_one_node.py +255 -0
- dag_modelling-0.12/src/dag_modelling/lib/abstract/many_to_one_node.py +243 -0
- dag_modelling-0.12/src/dag_modelling/lib/abstract/one_to_one_node.py +174 -0
- dag_modelling-0.12/src/dag_modelling/lib/arithmetic.py +195 -0
- dag_modelling-0.12/src/dag_modelling/lib/axis/__init__.py +5 -0
- dag_modelling-0.12/src/dag_modelling/lib/axis/bin_center.py +47 -0
- dag_modelling-0.12/src/dag_modelling/lib/axis/bin_width.py +48 -0
- dag_modelling-0.12/src/dag_modelling/lib/axis/mesh_to_edges.py +48 -0
- dag_modelling-0.12/src/dag_modelling/lib/calculus/__init__.py +3 -0
- dag_modelling-0.12/src/dag_modelling/lib/calculus/jacobian.py +161 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/__init__.py +17 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/array.py +230 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/cache.py +20 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/concatenation.py +57 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/copy.py +14 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/dummy.py +13 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/proxy.py +26 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/view.py +77 -0
- dag_modelling-0.12/src/dag_modelling/lib/common/view_concat.py +51 -0
- dag_modelling-0.12/src/dag_modelling/lib/exponential.py +73 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/__init__.py +15 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/axis_distortion_matrix.py +196 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/axis_distortion_matrix_linear.py +181 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/axis_distortion_matrix_pointwise.py +373 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/hist_smear_normal_matrix_b_c.py +125 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/rebin.py +140 -0
- dag_modelling-0.12/src/dag_modelling/lib/hist/rebin_matrix.py +211 -0
- dag_modelling-0.12/src/dag_modelling/lib/integration/__init__.py +7 -0
- dag_modelling-0.12/src/dag_modelling/lib/integration/integrator.py +149 -0
- dag_modelling-0.12/src/dag_modelling/lib/integration/integrator_core.py +287 -0
- dag_modelling-0.12/src/dag_modelling/lib/integration/integrator_sampler.py +296 -0
- dag_modelling-0.12/src/dag_modelling/lib/interpolation/__init__.py +7 -0
- dag_modelling-0.12/src/dag_modelling/lib/interpolation/interpolator.py +144 -0
- dag_modelling-0.12/src/dag_modelling/lib/interpolation/interpolator_core.py +399 -0
- dag_modelling-0.12/src/dag_modelling/lib/interpolation/segment_index.py +143 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/__init__.py +13 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/cholesky.py +57 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/linear_function.py +43 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/matrix_product_AB.py +82 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/matrix_product_DDt.py +38 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/matrix_product_DVDt.py +66 -0
- dag_modelling-0.12/src/dag_modelling/lib/linalg/vector_matrix_product.py +104 -0
- dag_modelling-0.12/src/dag_modelling/lib/normalization/__init__.py +5 -0
- dag_modelling-0.12/src/dag_modelling/lib/normalization/normalize_matrix.py +85 -0
- dag_modelling-0.12/src/dag_modelling/lib/normalization/renormalize_diag.py +121 -0
- dag_modelling-0.12/src/dag_modelling/lib/parameters/__init__.py +3 -0
- dag_modelling-0.12/src/dag_modelling/lib/parameters/par_array_input.py +64 -0
- dag_modelling-0.12/src/dag_modelling/lib/physics/__init__.py +4 -0
- dag_modelling-0.12/src/dag_modelling/lib/physics/energy_resolution.py +207 -0
- dag_modelling-0.12/src/dag_modelling/lib/physics/energy_resolution_sigma_rel_a_b_c.py +95 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/__init__.py +21 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/chi2.py +170 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/cnp_stat.py +117 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/covariance_matrix_group.py +271 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/covmatrix_from_cormatrix.py +54 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/log_poisson_ratio.py +97 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/log_prod_diag.py +77 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/monte_carlo.py +471 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/normalize_correlated_vars.py +117 -0
- dag_modelling-0.12/src/dag_modelling/lib/statistics/normalize_correlated_vars_two_ways.py +190 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/__init__.py +15 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/array_sum.py +32 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/el_sum_sq.py +39 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/partial_sums.py +74 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/sum_mat_or_diag.py +88 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/sum_sq.py +41 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/weighted_sum.py +75 -0
- dag_modelling-0.12/src/dag_modelling/lib/summation/weighted_sum_args.py +77 -0
- dag_modelling-0.12/src/dag_modelling/lib/trigonometry.py +105 -0
- dag_modelling-0.12/src/dag_modelling/parameters/__init__.py +9 -0
- dag_modelling-0.12/src/dag_modelling/parameters/gaussian_parameter.py +140 -0
- dag_modelling-0.12/src/dag_modelling/parameters/gaussian_parameters.py +296 -0
- dag_modelling-0.12/src/dag_modelling/parameters/parameter.py +170 -0
- dag_modelling-0.12/src/dag_modelling/parameters/parameters.py +219 -0
- dag_modelling-0.12/src/dag_modelling/plot/__init__.py +0 -0
- dag_modelling-0.12/src/dag_modelling/plot/graphviz.py +871 -0
- dag_modelling-0.12/src/dag_modelling/plot/plot.py +763 -0
- dag_modelling-0.12/src/dag_modelling/tools/__init__.py +0 -0
- dag_modelling-0.12/src/dag_modelling/tools/formatter.py +74 -0
- dag_modelling-0.12/src/dag_modelling/tools/iter.py +16 -0
- dag_modelling-0.12/src/dag_modelling/tools/logger.py +62 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/__init__.py +18 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/count_calls_profiler.py +100 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/delay_node.py +41 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/fit_simulation_profiling.py +203 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/framework_profiler.py +142 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/memory_profiler.py +176 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/node_profiler.py +131 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/profiler.py +222 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/timer_profiler.py +198 -0
- dag_modelling-0.12/src/dag_modelling/tools/profiling/utils.py +85 -0
- dag_modelling-0.12/src/dag_modelling/tools/save_records.py +123 -0
- dag_modelling-0.12/src/dag_modelling/tools/schema.py +180 -0
- dag_modelling-0.12/src/dag_modelling.egg-info/PKG-INFO +126 -0
- dag_modelling-0.12/src/dag_modelling.egg-info/SOURCES.txt +139 -0
- dag_modelling-0.12/src/dag_modelling.egg-info/dependency_links.txt +1 -0
- dag_modelling-0.12/src/dag_modelling.egg-info/requires.txt +21 -0
- dag_modelling-0.12/src/dag_modelling.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Gonchar Maxim, Tsegelnik Nikita
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dag-modelling
|
|
3
|
+
Version: 0.12
|
|
4
|
+
Summary: The dag-modelling package is a python implementation of the dataflow programming with the lazy graph evaluation.
|
|
5
|
+
Author-email: DAGModelling Team <dagflow@jinr.ru>
|
|
6
|
+
Maintainer-email: DAGModelling Team <dagflow@jinr.ru>
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/dagflow-team/dag-modelling/issues
|
|
9
|
+
Project-URL: DAGModelling Team, https://github.com/dagflow-team
|
|
10
|
+
Project-URL: documentation, https://github.com/dagflow-team/dag-modelling/wiki
|
|
11
|
+
Project-URL: homepage, https://github.com/dagflow-team/dag-modelling
|
|
12
|
+
Project-URL: repository, https://github.com/dagflow-team/dag-modelling
|
|
13
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.11
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: contextlib2
|
|
21
|
+
Requires-Dist: h5py
|
|
22
|
+
Requires-Dist: latexdatax
|
|
23
|
+
Requires-Dist: matplotlib
|
|
24
|
+
Requires-Dist: nested-mapping
|
|
25
|
+
Requires-Dist: numba
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: ordered-set
|
|
28
|
+
Requires-Dist: pandas
|
|
29
|
+
Requires-Dist: plotille
|
|
30
|
+
Requires-Dist: pygraphviz
|
|
31
|
+
Requires-Dist: pyyaml
|
|
32
|
+
Requires-Dist: schema
|
|
33
|
+
Requires-Dist: scipy
|
|
34
|
+
Requires-Dist: tabulate
|
|
35
|
+
Requires-Dist: uproot
|
|
36
|
+
Provides-Extra: test
|
|
37
|
+
Requires-Dist: coverage; extra == "test"
|
|
38
|
+
Requires-Dist: pytest; extra == "test"
|
|
39
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# Summary
|
|
43
|
+
|
|
44
|
+
[](https://www.python.org/)
|
|
45
|
+
[](https://git.jinr.ru/dagflow-team/dag-modelling/commits/master)
|
|
46
|
+
[](https://git.jinr.ru/dagflow-team/dag-modelling/-/commits/master)
|
|
47
|
+
<!--- Uncomment here after adding docs!
|
|
48
|
+
[](http://dagflow-team.pages.jinr.ru/dag-modelling)
|
|
49
|
+
-->
|
|
50
|
+
|
|
51
|
+
The **DAGModelling** software is a python implementation of the dataflow programming with the lazy graph evaluation approach.
|
|
52
|
+
|
|
53
|
+
Main goals:
|
|
54
|
+
* Lazy evaluated directed acyclic graph;
|
|
55
|
+
* Concise connection syntax;
|
|
56
|
+
* Plotting with graphviz;
|
|
57
|
+
* Flexibility. The goal of DAG-Modelling is not to be efficient, but rather flexible.
|
|
58
|
+
|
|
59
|
+
The framework is intented to be used for the statistical analysis of the data of *JUNO* and *Daya Bay* neutrino oscillation experiments.
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
### For users (*recommended*)
|
|
64
|
+
|
|
65
|
+
For regular use, it's best to install [the latest version of the project that's available on PyPi](https://pypi.org/project/dag-modelling/):
|
|
66
|
+
```bash
|
|
67
|
+
pip install dag-modelling
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### For developers
|
|
71
|
+
|
|
72
|
+
We recommend that developers install the package locally in editable mode:
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/dagflow-team/dag-modelling.git
|
|
75
|
+
cd dag-modelling
|
|
76
|
+
pip install -e .
|
|
77
|
+
```
|
|
78
|
+
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.
|
|
79
|
+
|
|
80
|
+
## Example
|
|
81
|
+
|
|
82
|
+
For example, let's consider a sum of three input nodes and then a product of the result with another array.
|
|
83
|
+
|
|
84
|
+
```python
|
|
85
|
+
from numpy import arange
|
|
86
|
+
|
|
87
|
+
from dag_modelling.core.graph import Graph
|
|
88
|
+
from dag_modelling.plot.graphviz import savegraph
|
|
89
|
+
from dag_modelling.lib.common import Array
|
|
90
|
+
from dag_modelling.lib.arithmetic import Sum, Product
|
|
91
|
+
|
|
92
|
+
# Define a source data
|
|
93
|
+
array = arange(3, dtype="d")
|
|
94
|
+
|
|
95
|
+
# Check predefined Array, Sum and Product
|
|
96
|
+
with Graph(debug=debug) as graph:
|
|
97
|
+
# Define nodes
|
|
98
|
+
(in1, in2, in3, in4) = (Array(name, array) for name in ("n1", "n2", "n3", "n4"))
|
|
99
|
+
s = Sum("sum")
|
|
100
|
+
m = Product("product")
|
|
101
|
+
|
|
102
|
+
# Connect nodes
|
|
103
|
+
(in1, in2, in3) >> s
|
|
104
|
+
(in4, s) >> m
|
|
105
|
+
graph.close()
|
|
106
|
+
|
|
107
|
+
print("Result:", m.outputs["result"].data) # must print [0. 3. 12.]
|
|
108
|
+
savegraph(graph, "dagmodelling_example_1a.png")
|
|
109
|
+
```
|
|
110
|
+
The printed result must be `[0. 3. 12.]`, and the created image looks as
|
|
111
|
+

|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
For more examples see [example/example.py](https://github.com/dagflow-team/dag-modelling/blob/master/example/example.py) or [tests](https://github.com/dagflow-team/dag-modelling/tree/master/tests).
|
|
115
|
+
|
|
116
|
+
## Repositories and additional modules
|
|
117
|
+
|
|
118
|
+
- Main repo:
|
|
119
|
+
* Development/CI: https://git.jinr.ru/dagflow-team/dag-modelling
|
|
120
|
+
* Contact/pypi/mirror: https://github.com/dagflow-team/dag-modelling
|
|
121
|
+
* PYPI: https://pypi.org/project/dag-modelling
|
|
122
|
+
- Supplementary python modules:
|
|
123
|
+
* [dgm-reactor-neutrino](https://github.com/dagflow-team/dgm-reactor-neutrino) — nodes related to reactor neutrino oscillations
|
|
124
|
+
* [dgm-fit](https://github.com/dagflow-team/dgm-fit) — fitter interface
|
|
125
|
+
* [Daya Bay model](https://github.com/dagflow-team/dgm-dayabay-dev) — implementation of the Daya Bay oscillation analysis, development version
|
|
126
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Summary
|
|
2
|
+
|
|
3
|
+
[](https://www.python.org/)
|
|
4
|
+
[](https://git.jinr.ru/dagflow-team/dag-modelling/commits/master)
|
|
5
|
+
[](https://git.jinr.ru/dagflow-team/dag-modelling/-/commits/master)
|
|
6
|
+
<!--- Uncomment here after adding docs!
|
|
7
|
+
[](http://dagflow-team.pages.jinr.ru/dag-modelling)
|
|
8
|
+
-->
|
|
9
|
+
|
|
10
|
+
The **DAGModelling** software is a python implementation of the dataflow programming with the lazy graph evaluation approach.
|
|
11
|
+
|
|
12
|
+
Main goals:
|
|
13
|
+
* Lazy evaluated directed acyclic graph;
|
|
14
|
+
* Concise connection syntax;
|
|
15
|
+
* Plotting with graphviz;
|
|
16
|
+
* Flexibility. The goal of DAG-Modelling is not to be efficient, but rather flexible.
|
|
17
|
+
|
|
18
|
+
The framework is intented to be used for the statistical analysis of the data of *JUNO* and *Daya Bay* neutrino oscillation experiments.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
### For users (*recommended*)
|
|
23
|
+
|
|
24
|
+
For regular use, it's best to install [the latest version of the project that's available on PyPi](https://pypi.org/project/dag-modelling/):
|
|
25
|
+
```bash
|
|
26
|
+
pip install dag-modelling
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### For developers
|
|
30
|
+
|
|
31
|
+
We recommend that developers install the package locally in editable mode:
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/dagflow-team/dag-modelling.git
|
|
34
|
+
cd dag-modelling
|
|
35
|
+
pip install -e .
|
|
36
|
+
```
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
## Example
|
|
40
|
+
|
|
41
|
+
For example, let's consider a sum of three input nodes and then a product of the result with another array.
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from numpy import arange
|
|
45
|
+
|
|
46
|
+
from dag_modelling.core.graph import Graph
|
|
47
|
+
from dag_modelling.plot.graphviz import savegraph
|
|
48
|
+
from dag_modelling.lib.common import Array
|
|
49
|
+
from dag_modelling.lib.arithmetic import Sum, Product
|
|
50
|
+
|
|
51
|
+
# Define a source data
|
|
52
|
+
array = arange(3, dtype="d")
|
|
53
|
+
|
|
54
|
+
# Check predefined Array, Sum and Product
|
|
55
|
+
with Graph(debug=debug) as graph:
|
|
56
|
+
# Define nodes
|
|
57
|
+
(in1, in2, in3, in4) = (Array(name, array) for name in ("n1", "n2", "n3", "n4"))
|
|
58
|
+
s = Sum("sum")
|
|
59
|
+
m = Product("product")
|
|
60
|
+
|
|
61
|
+
# Connect nodes
|
|
62
|
+
(in1, in2, in3) >> s
|
|
63
|
+
(in4, s) >> m
|
|
64
|
+
graph.close()
|
|
65
|
+
|
|
66
|
+
print("Result:", m.outputs["result"].data) # must print [0. 3. 12.]
|
|
67
|
+
savegraph(graph, "dagmodelling_example_1a.png")
|
|
68
|
+
```
|
|
69
|
+
The printed result must be `[0. 3. 12.]`, and the created image looks as
|
|
70
|
+

|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
For more examples see [example/example.py](https://github.com/dagflow-team/dag-modelling/blob/master/example/example.py) or [tests](https://github.com/dagflow-team/dag-modelling/tree/master/tests).
|
|
74
|
+
|
|
75
|
+
## Repositories and additional modules
|
|
76
|
+
|
|
77
|
+
- Main repo:
|
|
78
|
+
* Development/CI: https://git.jinr.ru/dagflow-team/dag-modelling
|
|
79
|
+
* Contact/pypi/mirror: https://github.com/dagflow-team/dag-modelling
|
|
80
|
+
* PYPI: https://pypi.org/project/dag-modelling
|
|
81
|
+
- Supplementary python modules:
|
|
82
|
+
* [dgm-reactor-neutrino](https://github.com/dagflow-team/dgm-reactor-neutrino) — nodes related to reactor neutrino oscillations
|
|
83
|
+
* [dgm-fit](https://github.com/dagflow-team/dgm-fit) — fitter interface
|
|
84
|
+
* [Daya Bay model](https://github.com/dagflow-team/dgm-dayabay-dev) — implementation of the Daya Bay oscillation analysis, development version
|
|
85
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
build-backend = "setuptools.build_meta"
|
|
3
|
+
|
|
4
|
+
requires = [ "packaging", "setuptools", "wheel" ]
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "dag-modelling"
|
|
8
|
+
version = "0.12"
|
|
9
|
+
description = "The dag-modelling package is a python implementation of the dataflow programming with the lazy graph evaluation."
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
maintainers = [ { name = "DAGModelling Team", email = "dagflow@jinr.ru" } ]
|
|
13
|
+
authors = [ { name = "DAGModelling Team", email = "dagflow@jinr.ru" } ]
|
|
14
|
+
requires-python = ">=3.11"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"contextlib2",
|
|
23
|
+
"h5py",
|
|
24
|
+
"latexdatax",
|
|
25
|
+
"matplotlib",
|
|
26
|
+
"nested-mapping",
|
|
27
|
+
"numba",
|
|
28
|
+
"numpy",
|
|
29
|
+
"ordered-set",
|
|
30
|
+
"pandas",
|
|
31
|
+
"plotille",
|
|
32
|
+
"pygraphviz",
|
|
33
|
+
"pyyaml",
|
|
34
|
+
"schema",
|
|
35
|
+
"scipy",
|
|
36
|
+
"tabulate",
|
|
37
|
+
"uproot",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
optional-dependencies.test = [ "coverage", "pytest", "pytest-cov" ]
|
|
41
|
+
urls."Bug Tracker" = "https://github.com/dagflow-team/dag-modelling/issues"
|
|
42
|
+
urls."DAGModelling Team" = "https://github.com/dagflow-team"
|
|
43
|
+
urls.documentation = "https://github.com/dagflow-team/dag-modelling/wiki"
|
|
44
|
+
urls.homepage = "https://github.com/dagflow-team/dag-modelling"
|
|
45
|
+
urls.repository = "https://github.com/dagflow-team/dag-modelling"
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = [ "src" ]
|
|
49
|
+
exclude = [
|
|
50
|
+
"tests*",
|
|
51
|
+
"docs*",
|
|
52
|
+
"example*",
|
|
53
|
+
]
|
|
File without changes
|
|
File without changes
|