causing 2.4.0__py3-none-any.whl → 2.4.1__py3-none-any.whl
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/graph.py +2 -2
- causing/model.py +16 -1
- causing/utils.py +1 -1
- {causing-2.4.0.dist-info → causing-2.4.1.dist-info}/METADATA +6 -6
- causing-2.4.1.dist-info/RECORD +14 -0
- {causing-2.4.0.dist-info → causing-2.4.1.dist-info}/WHEEL +1 -1
- causing-2.4.0.dist-info/RECORD +0 -14
- {causing-2.4.0.dist-info → causing-2.4.1.dist-info}/LICENSE.md +0 -0
- {causing-2.4.0.dist-info → causing-2.4.1.dist-info}/top_level.txt +0 -0
causing/graph.py
CHANGED
|
@@ -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
|
|
causing/model.py
CHANGED
|
@@ -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,22 @@ 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
|
+
try:
|
|
94
|
+
computed_yvars.append(eq(*eq_in, *parameters.values()))
|
|
95
|
+
except FloatingPointError:
|
|
96
|
+
# Floating Point Error for self.yvars[i]
|
|
97
|
+
# Adding 0.0 to overcome this.
|
|
98
|
+
computed_yvars.append(0.0)
|
|
99
|
+
|
|
85
100
|
yhat[i] = np.array(
|
|
86
|
-
|
|
101
|
+
computed_yvars,
|
|
87
102
|
dtype=np.float64,
|
|
88
103
|
)
|
|
89
104
|
except Exception as e:
|
causing/utils.py
CHANGED
|
@@ -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.1
|
|
4
4
|
Summary: Causing: CAUSal INterpretation using Graphs
|
|
5
5
|
Home-page: https://github.com/realrate/Causing
|
|
6
6
|
Author: Dr. Holger Bartel
|
|
@@ -11,11 +11,11 @@ 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
|
|
15
|
-
Requires-Dist: pandas
|
|
16
|
-
Requires-Dist: scipy
|
|
17
|
-
Requires-Dist: sympy
|
|
18
|
-
Requires-Dist: networkx
|
|
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
19
|
Requires-Dist: pre-commit
|
|
20
20
|
|
|
21
21
|
# Causing: CAUSal INterpretation using Graphs
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
causing/__init__.py,sha256=O_9uV9aX3q-c6M3KhY7bQAXncAecwnSfXw7ulGmMvSw,714
|
|
2
|
+
causing/graph.py,sha256=5v3t7dhFtxcIjpeJEOVdKxzSleufmXECSKqlhykMbcE,8637
|
|
3
|
+
causing/model.py,sha256=jgIuuSxoYuel1ZGwl-nj7vVoBsAqXUFAW_nkDld_OkU,8589
|
|
4
|
+
causing/utils.py,sha256=qfiNAb-MxVFeZVan7I4X-q04LVJZ8ST2YdVdvWvnjOE,2461
|
|
5
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tests/test_estimate.py,sha256=xr9qUVzM9XO70agw_J3PE7oy3aiytUs4CMxvsegNZ6w,3120
|
|
7
|
+
tests/utils.py,sha256=OPEuaBQF3_Azu4bW5q-6J5mtzGrVw4KJUWHd8utK4AE,510
|
|
8
|
+
tests/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
tests/examples/models.py,sha256=lr7v4LArOi3MlcKRvjGAJ6pEHVz1IQKbmKctZ02Vcjc,3849
|
|
10
|
+
causing-2.4.1.dist-info/LICENSE.md,sha256=ypzox8OiFHlpmiHOnxpC6PSGuDCNwzn_Q0iPYPJtt2Q,1095
|
|
11
|
+
causing-2.4.1.dist-info/METADATA,sha256=G2gYzFvtJD55pQTfeLdlH13BNY6qrHMLl3LTKw96UJc,10026
|
|
12
|
+
causing-2.4.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
13
|
+
causing-2.4.1.dist-info/top_level.txt,sha256=AZ4fGg06-ThD38PJjnIg4Yd1x4v_4hgRtPetAcKMmug,14
|
|
14
|
+
causing-2.4.1.dist-info/RECORD,,
|
causing-2.4.0.dist-info/RECORD
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
causing/__init__.py,sha256=O_9uV9aX3q-c6M3KhY7bQAXncAecwnSfXw7ulGmMvSw,714
|
|
2
|
-
causing/graph.py,sha256=n4PI-fjcNJvXC2qHYFPj-TRDYKN6Vff4s_XwO5GfNu4,8633
|
|
3
|
-
causing/model.py,sha256=1nwo3W1o89KdBsNsG7V4MRknKyqwfBnrfUgx4t5pVPc,7937
|
|
4
|
-
causing/utils.py,sha256=_sbLwqZPbCrmq8aVm_e7I8irW8v9n8b2DFqBWaNFc0o,2461
|
|
5
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
-
tests/test_estimate.py,sha256=xr9qUVzM9XO70agw_J3PE7oy3aiytUs4CMxvsegNZ6w,3120
|
|
7
|
-
tests/utils.py,sha256=OPEuaBQF3_Azu4bW5q-6J5mtzGrVw4KJUWHd8utK4AE,510
|
|
8
|
-
tests/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
tests/examples/models.py,sha256=lr7v4LArOi3MlcKRvjGAJ6pEHVz1IQKbmKctZ02Vcjc,3849
|
|
10
|
-
causing-2.4.0.dist-info/LICENSE.md,sha256=ypzox8OiFHlpmiHOnxpC6PSGuDCNwzn_Q0iPYPJtt2Q,1095
|
|
11
|
-
causing-2.4.0.dist-info/METADATA,sha256=92MtdIQNv98u2BfHJwX6xRbPwMyY7ScyEI8YhY4TNxA,10041
|
|
12
|
-
causing-2.4.0.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
13
|
-
causing-2.4.0.dist-info/top_level.txt,sha256=AZ4fGg06-ThD38PJjnIg4Yd1x4v_4hgRtPetAcKMmug,14
|
|
14
|
-
causing-2.4.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|