diffaaable 1.1.0__tar.gz → 1.1.1__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.
- {diffaaable-1.1.0 → diffaaable-1.1.1}/PKG-INFO +2 -2
- {diffaaable-1.1.0 → diffaaable-1.1.1}/README.md +1 -1
- {diffaaable-1.1.0 → diffaaable-1.1.1}/diffaaable/__init__.py +1 -1
- {diffaaable-1.1.0 → diffaaable-1.1.1}/diffaaable/selective.py +6 -21
- {diffaaable-1.1.0 → diffaaable-1.1.1}/pyproject.toml +2 -2
- {diffaaable-1.1.0 → diffaaable-1.1.1}/LICENSE +0 -0
- {diffaaable-1.1.0 → diffaaable-1.1.1}/diffaaable/adaptive.py +0 -0
- {diffaaable-1.1.0 → diffaaable-1.1.1}/diffaaable/core.py +0 -0
- {diffaaable-1.1.0 → diffaaable-1.1.1}/diffaaable/lorentz.py +0 -0
- {diffaaable-1.1.0 → diffaaable-1.1.1}/diffaaable/vectorial.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: diffaaable
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.1
|
|
4
4
|
Summary: JAX-differentiable AAA algorithm
|
|
5
5
|
Keywords: python
|
|
6
6
|
Author-email: Jan David Fischbach <fischbach@kit.edu>
|
|
@@ -30,7 +30,7 @@ Requires-Dist: sphinx_math_dollar ; extra == "docs"
|
|
|
30
30
|
Provides-Extra: dev
|
|
31
31
|
Provides-Extra: docs
|
|
32
32
|
|
|
33
|
-
# diffaaable 1.1.
|
|
33
|
+
# diffaaable 1.1.1
|
|
34
34
|
|
|
35
35
|

|
|
36
36
|
|
|
@@ -65,11 +65,6 @@ def subdomains(domain: Domain, divide_horizontal: bool, center: complex=None):
|
|
|
65
65
|
return [(subs[1][0], subs[0][1]), (subs[2][0], subs[3][1])]
|
|
66
66
|
return [(subs[2][0], subs[1][1]), (subs[3][0], subs[0][1])]
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
def cutoff_mask(z_k, f_k, f_k_dot, cutoff):
|
|
70
|
-
m = np.abs(f_k)<cutoff #filter out values, that have diverged too strongly
|
|
71
|
-
return z_k[m], f_k[m], f_k_dot[m]
|
|
72
|
-
|
|
73
68
|
def plot_domain(domain: Domain, size: float=1):
|
|
74
69
|
left_up = domain[0].real + 1j*domain[1].imag
|
|
75
70
|
right_down = domain[1].real + 1j*domain[0].imag
|
|
@@ -82,7 +77,6 @@ def plot_domain(domain: Domain, size: float=1):
|
|
|
82
77
|
def all_poles_known(poles, prev, tol):
|
|
83
78
|
if prev is None or len(prev)!=len(poles):
|
|
84
79
|
return False
|
|
85
|
-
#return True
|
|
86
80
|
|
|
87
81
|
dist = np.abs(poles[:, None] - prev[None, :])
|
|
88
82
|
check = np.all(np.any(dist < tol, axis=1))
|
|
@@ -110,12 +104,9 @@ def selective_refinement_aaa(f: callable,
|
|
|
110
104
|
TODO: allow access to samples slightly outside of domain
|
|
111
105
|
"""
|
|
112
106
|
|
|
113
|
-
print(f"start domain '{debug_name}', {Dmax=}")
|
|
107
|
+
# print(f"start domain '{debug_name}', {Dmax=}")
|
|
114
108
|
folder = f"debug_out/{debug_name:0<33}"
|
|
115
109
|
domain_size = np.abs(domain[1]-domain[0])/2
|
|
116
|
-
size = domain_size/2 # for plotting
|
|
117
|
-
#plot_rect = plot_domain(domain, size=30)
|
|
118
|
-
#color = plot_rect[0].get_color()
|
|
119
110
|
|
|
120
111
|
if cutoff is None:
|
|
121
112
|
cutoff = np.inf
|
|
@@ -135,11 +126,13 @@ def selective_refinement_aaa(f: callable,
|
|
|
135
126
|
z_k = np.append(z_k, z_k_new)
|
|
136
127
|
|
|
137
128
|
eval_count += len(z_k_new)
|
|
138
|
-
print(f"new eval: {eval_count}")
|
|
129
|
+
# print(f"new eval: {eval_count}")
|
|
139
130
|
eval_count -= len(z_k)
|
|
140
131
|
z_j, f_j, w_j, z_n, z_k, f_k = adaptive_aaa(
|
|
141
132
|
z_k, f, f_k_0=f_k, evolutions=N*16, tol=tol_aaa,
|
|
142
|
-
domain=reduced_domain(domain, 1.07), radius=4*domain_size/(N),
|
|
133
|
+
domain=reduced_domain(domain, 1.07), radius=4*domain_size/(N),
|
|
134
|
+
# NOTE: reduced domain with a factor larger than 1
|
|
135
|
+
# actually increases domain size
|
|
143
136
|
return_samples=True, sampling=sampling, cutoff=np.inf
|
|
144
137
|
)
|
|
145
138
|
# TODO pass down samples in buffer zone
|
|
@@ -156,18 +149,14 @@ def selective_refinement_aaa(f: callable,
|
|
|
156
149
|
except onp.linalg.LinAlgError as e:
|
|
157
150
|
z_n = z_j = f_j = w_j = np.empty((0,))
|
|
158
151
|
|
|
159
|
-
print(f"domain '{debug_name}' done: {domain} -> eval: {eval_count}")
|
|
152
|
+
# print(f"domain '{debug_name}' done: {domain} -> eval: {eval_count}")
|
|
160
153
|
poles = z_n[domain_mask(domain, z_n)]
|
|
161
154
|
|
|
162
155
|
if (Dmax == 0 or
|
|
163
156
|
(len(poles)<=max_poles and all_poles_known(poles, suggestions, tol_pol))):
|
|
164
157
|
|
|
165
|
-
#plt.scatter(poles.real, poles.imag, color = color, marker="x")#, s=size*3, linewidths=size/2)
|
|
166
|
-
print("I am done here")
|
|
167
|
-
|
|
168
158
|
res = residues(z_j, f_j, w_j, poles)
|
|
169
159
|
return poles, res, eval_count
|
|
170
|
-
#plt.scatter(poles.real, poles.imag, color = color, marker="+", s=0.2, zorder=3)#, s=size, linewidths=size/6)
|
|
171
160
|
|
|
172
161
|
subs = subdomains(domain, divide_horizontal)
|
|
173
162
|
|
|
@@ -190,8 +179,4 @@ def selective_refinement_aaa(f: callable,
|
|
|
190
179
|
pol = np.append(pol, p)
|
|
191
180
|
res = np.append(res, r)
|
|
192
181
|
eval_count += e
|
|
193
|
-
# if len(pol) > 0:
|
|
194
|
-
# plt.xlim(domain[0].real, domain[1].real)
|
|
195
|
-
# plt.ylim(domain[0].imag, domain[1].imag)
|
|
196
|
-
# plt.savefig(f"debug_out/{debug_name:0<33}.png")
|
|
197
182
|
return pol, res, eval_count
|
|
@@ -30,7 +30,7 @@ license = {file = "LICENSE"}
|
|
|
30
30
|
name = "diffaaable"
|
|
31
31
|
readme = "README.md"
|
|
32
32
|
requires-python = ">=3.9"
|
|
33
|
-
version = "1.1.
|
|
33
|
+
version = "1.1.1"
|
|
34
34
|
|
|
35
35
|
[project.optional-dependencies]
|
|
36
36
|
dev = [
|
|
@@ -137,7 +137,7 @@ message_template = "Bump to {new_version}"
|
|
|
137
137
|
tag_template = "v{new_version}"
|
|
138
138
|
|
|
139
139
|
[tool.tbump.version]
|
|
140
|
-
current = "1.1.
|
|
140
|
+
current = "1.1.1"
|
|
141
141
|
# Example of a semver regexp.
|
|
142
142
|
# Make sure this matches current_version before
|
|
143
143
|
# using tbump
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|