causing 2.4.0__tar.gz → 2.4.2__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.
Potentially problematic release.
This version of causing might be problematic. Click here for more details.
- {causing-2.4.0 → causing-2.4.2}/PKG-INFO +7 -1
- {causing-2.4.0 → causing-2.4.2}/causing/graph.py +7 -4
- {causing-2.4.0 → causing-2.4.2}/causing/model.py +12 -1
- {causing-2.4.0 → causing-2.4.2}/causing/utils.py +1 -1
- {causing-2.4.0 → causing-2.4.2}/causing.egg-info/PKG-INFO +7 -1
- {causing-2.4.0 → causing-2.4.2}/setup.py +1 -1
- {causing-2.4.0 → causing-2.4.2}/LICENSE.md +0 -0
- {causing-2.4.0 → causing-2.4.2}/README.md +0 -0
- {causing-2.4.0 → causing-2.4.2}/causing/__init__.py +0 -0
- {causing-2.4.0 → causing-2.4.2}/causing.egg-info/SOURCES.txt +0 -0
- {causing-2.4.0 → causing-2.4.2}/causing.egg-info/dependency_links.txt +0 -0
- {causing-2.4.0 → causing-2.4.2}/causing.egg-info/requires.txt +0 -0
- {causing-2.4.0 → causing-2.4.2}/causing.egg-info/top_level.txt +0 -0
- {causing-2.4.0 → causing-2.4.2}/setup.cfg +0 -0
- {causing-2.4.0 → causing-2.4.2}/tests/__init__.py +0 -0
- {causing-2.4.0 → causing-2.4.2}/tests/examples/__init__.py +0 -0
- {causing-2.4.0 → causing-2.4.2}/tests/examples/models.py +0 -0
- {causing-2.4.0 → causing-2.4.2}/tests/test_estimate.py +0 -0
- {causing-2.4.0 → causing-2.4.2}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: causing
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2
|
|
4
4
|
Summary: Causing: CAUSal INterpretation using Graphs
|
|
5
5
|
Home-page: https://github.com/realrate/Causing
|
|
6
6
|
Author: Dr. Holger Bartel
|
|
@@ -11,6 +11,12 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE.md
|
|
14
|
+
Requires-Dist: numpy~=1.23
|
|
15
|
+
Requires-Dist: pandas~=1.3
|
|
16
|
+
Requires-Dist: scipy~=1.9
|
|
17
|
+
Requires-Dist: sympy~=1.5
|
|
18
|
+
Requires-Dist: networkx~=2.7
|
|
19
|
+
Requires-Dist: pre-commit
|
|
14
20
|
|
|
15
21
|
# Causing: CAUSal INterpretation using Graphs
|
|
16
22
|
|
|
@@ -69,8 +69,8 @@ def save_graph(path: Path, graph_dot):
|
|
|
69
69
|
svg_code = subprocess.check_output(
|
|
70
70
|
[DOT_COMMAND, "-Tsvg"], input=graph_dot, encoding="utf-8"
|
|
71
71
|
)
|
|
72
|
-
if dot_version()[0] < 3:
|
|
73
|
-
|
|
72
|
+
# if dot_version()[0] < 3:
|
|
73
|
+
# svg_code = fix_svg_scale(svg_code)
|
|
74
74
|
with open(path, "w") as f:
|
|
75
75
|
f.write(svg_code)
|
|
76
76
|
|
|
@@ -116,7 +116,7 @@ def annotated_graphs(
|
|
|
116
116
|
|
|
117
117
|
NODE_PALETTE = "#ff7973 #FFC7AD #EEEEEE #BDE7BD #75cf73".split(" ")
|
|
118
118
|
EDGE_PALETTE = "#ff7973 #FFC7AD #BBBBBB #aad3aa #75cf73".split(" ")
|
|
119
|
-
PEN_WIDTH_PALETTE = [
|
|
119
|
+
PEN_WIDTH_PALETTE = [12, 8, 4, 8, 12]
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
def color(val, max_val, palette):
|
|
@@ -175,7 +175,10 @@ def graph_to_dot(
|
|
|
175
175
|
)
|
|
176
176
|
col_str = color(data["effect"], max_val, palette=edge_palette)
|
|
177
177
|
penwidth = color(data["effect"], max_val, palette=pen_width_palette)
|
|
178
|
-
dot_str +=
|
|
178
|
+
dot_str += (
|
|
179
|
+
f' "{from_node}" -> "{to_node}" [label="{eff_str}" color="{col_str}" penwidth="{penwidth}", '
|
|
180
|
+
f"arrowsize=0.5]\n"
|
|
181
|
+
)
|
|
179
182
|
|
|
180
183
|
for from_node, to_node in invisible_edges:
|
|
181
184
|
dot_str += f' "{from_node}" -> "{to_node}" [style = "invisible", arrowhead="none"]\n'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
|
|
2
3
|
from dataclasses import dataclass, field
|
|
3
4
|
from typing import Iterable, Callable
|
|
4
5
|
from functools import cached_property
|
|
@@ -82,8 +83,18 @@ class Model:
|
|
|
82
83
|
eq_inputs[:, fixed_from_ind] = fixed_vals
|
|
83
84
|
|
|
84
85
|
try:
|
|
86
|
+
# print(f"Comuting variable: {self.yvars[i]}")
|
|
87
|
+
# yhat[i] = np.array(
|
|
88
|
+
# [eq(*eq_in, *parameters.values()) for eq_in in eq_inputs],
|
|
89
|
+
# dtype=np.float64,
|
|
90
|
+
# )
|
|
91
|
+
computed_yvars = []
|
|
92
|
+
for eq_in in eq_inputs:
|
|
93
|
+
eq_in = [np.float128(value) for value in eq_in]
|
|
94
|
+
computed_yvars.append(eq(*eq_in, *parameters.values()))
|
|
95
|
+
|
|
85
96
|
yhat[i] = np.array(
|
|
86
|
-
|
|
97
|
+
computed_yvars,
|
|
87
98
|
dtype=np.float64,
|
|
88
99
|
)
|
|
89
100
|
except Exception as e:
|
|
@@ -11,7 +11,7 @@ def round_sig(x, sig=2) -> float:
|
|
|
11
11
|
"""Round x to the given number of significant figures"""
|
|
12
12
|
if x == 0 or not np.isfinite(x):
|
|
13
13
|
return x
|
|
14
|
-
return round(x, sig - int(floor(log10(abs(x))))
|
|
14
|
+
return round(x, sig - int(floor(log10(abs(x)))) + 1)
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
def round_sig_recursive(x, sig=2):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: causing
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.2
|
|
4
4
|
Summary: Causing: CAUSal INterpretation using Graphs
|
|
5
5
|
Home-page: https://github.com/realrate/Causing
|
|
6
6
|
Author: Dr. Holger Bartel
|
|
@@ -11,6 +11,12 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE.md
|
|
14
|
+
Requires-Dist: numpy~=1.23
|
|
15
|
+
Requires-Dist: pandas~=1.3
|
|
16
|
+
Requires-Dist: scipy~=1.9
|
|
17
|
+
Requires-Dist: sympy~=1.5
|
|
18
|
+
Requires-Dist: networkx~=2.7
|
|
19
|
+
Requires-Dist: pre-commit
|
|
14
20
|
|
|
15
21
|
# Causing: CAUSal INterpretation using Graphs
|
|
16
22
|
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="causing",
|
|
8
|
-
version="2.4.
|
|
8
|
+
version="2.4.2",
|
|
9
9
|
author="Dr. Holger Bartel",
|
|
10
10
|
author_email="holger.bartel@realrate.ai",
|
|
11
11
|
description="Causing: CAUSal INterpretation using Graphs",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|