diff --git a/Billiards.html b/Billiards.html index 2c2109e22..e84b22156 100644 --- a/Billiards.html +++ b/Billiards.html @@ -15203,61 +15203,35 @@
---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[3], line 8 - 5 coords.append(vec(x=i * 2 * radius + 0.5, y=j * 2 * radius + 0.5 - i * radius * 0.7)) - 6 return Sphere(stack(coords, instance('balls')), radius=radius) -----> 8 plot(billiards_triangle()) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'Tensor']+ + +
---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[7], line 3 - 1 x0 = vec(x=.1, y=.5) - 2 v0 = lambda alpha: vec(x=0.3 * math.cos(alpha), y=0.3 * math.sin(alpha)) -----> 3 plot(CenteredGrid(lambda alpha: loss_function(x0, v0(alpha))[0], alpha=1000, bounds=Box(alpha=(-PI/4, PI/4)))) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool', 'str', 'Tensor']+ + +
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_functional.py:628: RuntimeWarning: Using torch for gradient computation because numpy does not support jacobian() +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_functional.py:628: RuntimeWarning: Using torch for gradient computation because numpy does not support jacobian() warnings.warn(f"Using {math.default_backend()} for gradient computation because {key.backend} does not support jacobian()", RuntimeWarning)@@ -15734,14 +15682,14 @@Billiards in ΦFlow 7 print(f"Iter={iter} loss={loss:.3f} x0={x0} ∇={dx0} v0={v0} ∇={dv0}") 8 x0 -= learning_rate * dx0 -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_functional.py:636, in GradientFunction.__call__(self, *args, **kwargs) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_functional.py:636, in GradientFunction.__call__(self, *args, **kwargs) 634 if key not in self.traces: 635 self.traces[key] = self._trace_grad(key, wrt_natives) --> 636 native_result = self.traces[key](*natives) 637 output_key = match_output_signature(key, self.recorded_mappings, self) 638 jac_shape = output_key.shapes[0].non_batch # ToDo prepend this to all wrt shapes -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/torch/_torch_backend.py:944, in TorchBackend.jacobian.<locals>.eval_grad(*args) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/backend/torch/_torch_backend.py:944, in TorchBackend.jacobian.<locals>.eval_grad(*args) 941 @wraps(f) 942 def eval_grad(*args): 943 args, wrt_args = self._prepare_graph_inputs(args, wrt) @@ -15749,7 +15697,7 @@
Billiards in ΦFlow 945 if np.prod(self.staticshape(loss)) == 1: 946 assert loss.requires_grad, f"Failed to compute gradient because function output does not depend on any input. Inputs: {args}" -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_functional.py:615, in GradientFunction._trace_grad.<locals>.f_native(*natives) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_functional.py:615, in GradientFunction._trace_grad.<locals>.f_native(*natives) 612 assert len( 613 loss_shape) == 0, f"Only scalar losses are allowed when returning a native tensor but {f_name(self.f)} returned {type(loss_native).__name__} of shape {loss_shape}. For higher-dimensional values, use Φ-ML tensors instead." 614 nest, out_tensors = disassemble_tree(result, cache=True, attr_type=value_attributes) @@ -15757,19 +15705,19 @@
Billiards in ΦFlow 616 self.recorded_mappings[in_key] = SignatureKey(f_native, nest, result_shapes, specs, in_key.backend, in_key.tracing) 617 return loss_native, result_natives -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_tensors.py:1845, in disassemble_tensors(tensors, expand) - 1834 """ - 1835 Args: - 1836 tensors: Tuple or list of Tensors. +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_tensors.py:1846, in disassemble_tensors(tensors, expand) + 1835 """ + 1836 Args: + 1837 tensors: Tuple or list of Tensors. (...) - 1842 One per tensor. - 1843 """ - 1844 tensors = [cached(t) if isinstance(t, TensorStack) or expand else t for t in tensors] --> 1845 natives = sum([t._natives() for t in tensors], ()) - 1846 shapes = tuple([t.shape for t in tensors]) - 1847 specs = tuple([t._spec_dict() for t in tensors]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_tensors.py:852, in Tensor._natives(self) + 1843 One per tensor. + 1844 """ + 1845 tensors = [cached(t) if isinstance(t, TensorStack) or expand else t for t in tensors] +-> 1846 natives = sum([t._natives() for t in tensors], ()) + 1847 shapes = tuple([t.shape for t in tensors]) + 1848 specs = tuple([t._spec_dict() for t in tensors]) + +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_tensors.py:852, in Tensor._natives(self) 851 def _natives(self) -> tuple: --> 852 raise NotImplementedError(self.__class__) diff --git a/Cookbook.html b/Cookbook.html index 4a8c1be69..11eef7717 100644 --- a/Cookbook.html +++ b/Cookbook.html @@ -15157,12 +15157,12 @@
Import for NumPy, TensorFlow
-@@ -15251,7 +15251,7 @@2024-10-07 13:21:35.849615: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered -2024-10-07 13:21:35.865105: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:8454] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered -2024-10-07 13:21:35.869499: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered -2024-10-07 13:21:35.881632: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. +2024-10-12 13:25:41.624818: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:485] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered +2024-10-12 13:25:41.639255: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:8454] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered +2024-10-12 13:25:41.643590: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1452] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered +2024-10-12 13:25:41.655095: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. -2024-10-07 13:21:36.955179: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT +2024-10-12 13:25:42.700942: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRTSelect GPU or CPU -
[torch device 'CPU' (CPU 'cpu') | 15990 MB | 4 processors | ]+[torch device 'CPU' (CPU 'cpu') | 15981 MB | 4 processors | ]@@ -15350,7 +15350,7 @@Sample Random Values -
(examplesᵇ=10, vectorᶜ=x,y) 0.441 ± 0.310 (3e-02...9e-01)+(examplesᵇ=10, vectorᶜ=x,y) 0.591 ± 0.338 (1e-02...1e+00)@@ -15400,7 +15400,7 @@Slice a Tensor -
(x=0.060, y=0.887)
+(x=0.915, y=0.717)
@@ -15449,18 +15449,18 @@Print a
Tensor
-(examplesᵇ=10, vectorᶜ=x,y) 0.441 ± 0.310 (3e-02...9e-01) +(examplesᵇ=10, vectorᶜ=x,y) 0.591 ± 0.338 (1e-02...1e+00) (examplesᵇ=10, vectorᶜ=x,y) -[[0.1, 0.9], - [0.1, 0.0], - [0.5, 0.1], - [0.6, 0.4], - [0.9, 0.5], - [0.7, 0.4], - [0.9, 0.9], - [0.0, 0.1], - [0.7, 0.5], - [0.4, 0.1]] +[[0.9, 0.7], + [0.3, 0.1], + [0.3, 0.3], + [0.9, 0.2], + [0.9, 1.0], + [0.9, 0.1], + [0.5, 1.0], + [0.0, 0.7], + [0.5, 0.9], + [0.8, 0.8]]@@ -15509,54 +15509,40 @@Plot a
Tensor
----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[9], line 2 - 1 data = math.random_uniform(spatial(x=8, y=6)) -----> 2 vis.plot(data) # or vis.show(data) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation ++ + ++ ++Out[9]:+ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['Tensor', 'str', 'Tensor'] +@@ -15604,22 +15590,22 @@++Convert a
Tensor
to NumPy -array([[4.70470846e-01, 9.20384109e-01, 9.62274969e-01, 3.22779536e-01, - 3.30583692e-01, 5.49813330e-01], - [8.29283714e-01, 1.65878475e-01, 6.11229360e-01, 2.12907791e-04, - 3.80763173e-01, 5.88124216e-01], - [6.20536268e-01, 2.38151789e-01, 9.02212977e-01, 8.16517115e-01, - 3.35690439e-01, 2.94101655e-01], - [4.63237643e-01, 9.09590542e-01, 1.80232704e-01, 7.97231436e-01, - 7.20673084e-01, 5.42150021e-01], - [3.80976796e-02, 4.47712064e-01, 1.33004129e-01, 2.09360063e-01, - 4.31701779e-01, 1.87618196e-01], - [5.73881269e-01, 6.57267570e-02, 3.06678116e-01, 1.07592165e-01, - 1.50276303e-01, 7.97904670e-01], - [6.59991264e-01, 8.46080661e-01, 1.22367024e-01, 8.98710072e-01, - 9.09133673e-01, 4.49350476e-02], - [6.41172469e-01, 6.98916316e-01, 2.48942852e-01, 3.20672989e-05, - 1.38096631e-01, 3.76250207e-01]], dtype=float32)+array([[0.6269923 , 0.24147642, 0.84205616, 0.05654687, 0.18886083, + 0.95200735], + [0.02276599, 0.5492889 , 0.20169419, 0.6896821 , 0.2897966 , + 0.69454116], + [0.61117727, 0.5437188 , 0.46552128, 0.74256456, 0.70438313, + 0.58541423], + [0.14688563, 0.620815 , 0.6786676 , 0.23005074, 0.10368842, + 0.8768273 ], + [0.90997726, 0.35989237, 0.32298422, 0.29530865, 0.7959888 , + 0.7936943 ], + [0.3635878 , 0.54489064, 0.07534063, 0.07049078, 0.6729215 , + 0.23042661], + [0.0129444 , 0.4264359 , 0.13693482, 0.6378186 , 0.39114302, + 0.6967121 ], + [0.50886637, 0.9726459 , 0.3166542 , 0.89804494, 0.4746917 , + 0.722566 ]], dtype=float32)@@ -15658,19 +15644,16 @@Convert a
Tensor
to NumPy -array([[4.70470846e-01, 9.20384109e-01, 9.62274969e-01, 3.22779536e-01, - 3.30583692e-01, 5.49813330e-01, 8.29283714e-01, 1.65878475e-01, - 6.11229360e-01, 2.12907791e-04, 3.80763173e-01, 5.88124216e-01, - 6.20536268e-01, 2.38151789e-01, 9.02212977e-01, 8.16517115e-01, - 3.35690439e-01, 2.94101655e-01, 4.63237643e-01, 9.09590542e-01, - 1.80232704e-01, 7.97231436e-01, 7.20673084e-01, 5.42150021e-01, - 3.80976796e-02, 4.47712064e-01, 1.33004129e-01, 2.09360063e-01, - 4.31701779e-01, 1.87618196e-01, 5.73881269e-01, 6.57267570e-02, - 3.06678116e-01, 1.07592165e-01, 1.50276303e-01, 7.97904670e-01, - 6.59991264e-01, 8.46080661e-01, 1.22367024e-01, 8.98710072e-01, - 9.09133673e-01, 4.49350476e-02, 6.41172469e-01, 6.98916316e-01, - 2.48942852e-01, 3.20672989e-05, 1.38096631e-01, 3.76250207e-01]], - dtype=float32)+array([[0.6269923 , 0.24147642, 0.84205616, 0.05654687, 0.18886083, + 0.95200735, 0.02276599, 0.5492889 , 0.20169419, 0.6896821 , + 0.2897966 , 0.69454116, 0.61117727, 0.5437188 , 0.46552128, + 0.74256456, 0.70438313, 0.58541423, 0.14688563, 0.620815 , + 0.6786676 , 0.23005074, 0.10368842, 0.8768273 , 0.90997726, + 0.35989237, 0.32298422, 0.29530865, 0.7959888 , 0.7936943 , + 0.3635878 , 0.54489064, 0.07534063, 0.07049078, 0.6729215 , + 0.23042661, 0.0129444 , 0.4264359 , 0.13693482, 0.6378186 , + 0.39114302, 0.6967121 , 0.50886637, 0.9726459 , 0.3166542 , + 0.89804494, 0.4746917 , 0.722566 ]], dtype=float32)@@ -15769,61 +15752,35 @@Construct a
CenteredGrid
-+-- +@@ -15874,66 +15831,40 @@Out[13]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[13], line 6 - 3 noise_grid = CenteredGrid(Noise(), extrapolation.PERIODIC, x=32, y=32) - 4 sin_curve = CenteredGrid(lambda x: math.sin(x), extrapolation.PERIODIC, x=100, bounds=Box(x=2 * PI)) -----> 6 vis.plot(zero_grid, y_grid, noise_grid, sin_curve, size=(12, 3)) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['Tensor', 'str', 'Tensor'] +++Construct a
StaggeredGrid
-/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_shape.py:2144: RuntimeWarning: Stacking shapes with incompatible item names will result in item names being lost. For vector Got ('x', 'y') and ('x',) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_shape.py:2144: RuntimeWarning: Stacking shapes with incompatible item names will result in item names being lost. For vector Got ('x', 'y') and ('x',) warnings.warn(f"Stacking shapes with incompatible item names will result in item names being lost. For {name} Got {item_names[index]} and {items}", RuntimeWarning)++- +@@ -16201,61 +16132,35 @@Out[14]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[14], line 6 - 3 noise_grid = StaggeredGrid(Noise(), extrapolation.PERIODIC, x=32, y=32) - 4 sin_curve = StaggeredGrid(lambda x: math.sin(x), extrapolation.PERIODIC, x=100, bounds=Box(x=2 * PI)) -----> 6 vis.plot(zero_grid, y_grid, noise_grid, sin_curve, size=(12, 3)) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['Tensor', 'str', 'Tensor'] +++Sampling a Function -
++- +@@ -16311,66 +16216,795 @@Out[19]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[19], line 5 - 2 return math.l2_loss(math.sin(x)) - 4 f_grid = CenteredGrid(f, x=100, y=100, bounds=Box(x=2*PI, y=2*PI)) -----> 5 vis.plot(f_grid) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['Tensor', 'str', 'Tensor'] +++Plot Optimization Trajectories -
/tmp/ipykernel_2115/1489350838.py:9: UserWarning: bounds argument is deprecated since 2.5 and will be ignored. +/tmp/ipykernel_2117/1489350838.py:9: UserWarning: bounds argument is deprecated since 2.5 and will be ignored. segments.append(PointCloud(start, end - start, bounds=Box(x=2*PI, y=2*PI)))+ +Out[20]:+ + + ++ ++-@@ -16428,8 +17062,8 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[20], line 11 - 9 segments.append(PointCloud(start, end - start, bounds=Box(x=2*PI, y=2*PI))) - 10 anim_segments = field.stack(segments, batch('time')) ----> 11 vis.plot(f_grid, anim_segments, overlay='args', animate='time', color='#FFFFFF', frame_time=500) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['Tensor', 'str', 'Tensor']+++<Figure size 640x480 with 0 Axes>Neural Network Training -
Initial loss: (batchᵇ=100) 0.199 ± 0.171 (2e-04...6e-01) -Final loss: (batchᵇ=100) 0.081 ± 0.090 (4e-05...3e-01) +Initial loss: (batchᵇ=100) 0.194 ± 0.140 (4e-05...4e-01) +Final loss: (batchᵇ=100) 0.027 ± 0.030 (5e-09...9e-02)diff --git a/FLIP.html b/FLIP.html index 25f638163..885c1521a 100644 --- a/FLIP.html +++ b/FLIP.html @@ -15210,55 +15210,40 @@Fluid-Implicit-Particle (FLI
-+ +---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[2], line 5 - 3 accessible_cells = CenteredGrid(~ground, 0, domain, x=64, y=64) - 4 particles = distribute_points(union(Box(x=(30, 55), y=(40, 62))), x=64, y=64, bounds=domain) * (0, 0) -----> 5 plot(accessible_cells, particles, overlay='args') - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['ArrayImpl', 'str', 'ArrayImpl']+/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation ++ ++Out[2]:+ + + + ++ ++ ++ + + + + + +@@ -15349,12 +15334,12 @@+ ++Fluid-Implicit-Particle (FLI -
++ ++Out[1]:+ + + + ++ ++ ++ + + + + + +@@ -15295,68 +15280,44 @@++Operator Splitting -
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). warnings.warn("Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...).") -/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). warnings.warn("Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...).") +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation+ ++ +Out[2]:+ + + + ++ ++-@@ -15400,66 +15361,42 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[2], line 10 - 8 velocity0, pressure0 = fluid.make_incompressible(velocity) - 9 velocity1, pressure1 = operator_split_step(velocity0, None, dt=1.) ----> 10 plot({'initial vorticity': field.curl(velocity0), 'after step': field.curl(velocity1)}) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['ArrayImpl', 'str', 'ArrayImpl']+ + +++Operator Splitting -
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). warnings.warn("Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...).") +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation+ ++ +Out[3]:+ + + + ++ ++-@@ -15511,12 +15448,12 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[3], line 10 - 8 velocity0, pressure0 = fluid.make_incompressible(velocity) - 9 velocity1, pressure1 = operator_split_step(velocity0, None, dt=1.) ----> 10 plot({'initial vorticity': field.curl(velocity0), 'after step': field.curl(velocity1)}) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['ArrayImpl', 'str', 'ArrayImpl']+ + +++Operator Splitting +
@@ -15527,7 +15464,7 @@Operator Splitting -
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_optimize.py:631: UserWarning: Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...). warnings.warn("Possible rank deficiency detected. Matrix might be singular which can lead to convergence problems. Please specify using Solve(rank_deficiency=...).")@@ -15572,59 +15509,3499 @@Operator Splitting +
+ +Out[5]:+ + + ++ ++ +-@@ -15715,12 +19092,12 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[5], line 1 -----> 1 plot(field.curl(velocity_trj), animate='time', same_scale=False) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['ArrayImpl', 'str', 'ArrayImpl']+ + +++<Figure size 640x480 with 0 Axes>Higher-Order Simulations +
@@ -15741,14 +19118,14 @@Higher-Order Simulations----> 5 velocity_trj, pressure_trj = iterate(rk4_step, batch(time=200), velocity0, pressure0, dt=.5, range=trange) 6 plot(field.curl(velocity_trj.time[::2]), animate='time', same_scale=False) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_functional.py:1300, in iterate(map_function, iterations, f_kwargs, range, measure, substeps, *x0, **f_kwargs_) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_functional.py:1300, in iterate(map_function, iterations, f_kwargs, range, measure, substeps, *x0, **f_kwargs_) 1298 for _i in range(iterations.size): 1299 for _sub_i in builtin_range(substeps): -> 1300 x = map_function(*x[:len(x0)], **f_kwargs) 1301 x = x if isinstance(x, tuple) else (x,) 1302 if len(x) < len(x0): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_functional.py:308, in JitFunction.__call__(self, *args, **kwargs) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_functional.py:308, in JitFunction.__call__(self, *args, **kwargs) 303 if len(self.traces) >= 10: 304 warnings.warn(f"""Φ-ML: The jit-compiled function '{f_name(self.f)}' was traced {len(self.traces)} times. 305 Performing many traces may be slow and cause memory leaks. @@ -15758,13 +19135,13 @@
Higher-Order Simulations 309 out_key = self.recorded_mappings[key][-1] 310 buffer_config = out_key.buffer_config -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/jax/_jax_backend.py:252, in JaxBackend.jit_compile.<locals>.run_jit_f(*args) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/backend/jax/_jax_backend.py:252, in JaxBackend.jit_compile.<locals>.run_jit_f(*args) 249 def run_jit_f(*args): 250 # print(jax.make_jaxpr(f)(*args)) 251 ML_LOGGER.debug(f"JaxBackend: running jit-compiled '{f.__name__}' with shapes {[self.shape(arg) for arg in args]} and dtypes {[self.dtype(arg) for arg in args]}") --> 252 return self.as_registered.call(jit_f, *args, name=f"run jit-compiled '{f.__name__}'") -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:415, in Backend.call(self, f, name, *args) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:415, in Backend.call(self, f, name, *args) 406 def call(self, f: Callable, *args, name=None): 407 """ 408 Calls `f(*args)` and returns the result. @@ -15776,7 +19153,7 @@
Higher-Order Simulations[... skipping hidden 11 frame] -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_functional.py:254, in JitFunction._jit_compile.<locals>.jit_f_native(*natives) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_functional.py:254, in JitFunction._jit_compile.<locals>.jit_f_native(*natives) 252 aux_tensors = assemble_tensors(aux_natives, aux_specs) 253 attached_aux_args_ = assemble_tree(aux_tree, aux_tensors) --> 254 f_output = self.f(**kwargs, **attached_aux_args_) # Tensor or tuple/list of Tensors @@ -15788,19 +19165,19 @@
Higher-Order Simulations 2 def rk4_step(v, p, dt): ----> 3 return fluid.incompressible_rk4(momentum_equation, v, p, dt, pressure_order=4) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/physics/fluid.py:335, in incompressible_rk4(pde, velocity, pressure, dt, pressure_order, pressure_solve, **pde_aux_kwargs) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/physics/fluid.py:335, in incompressible_rk4(pde, velocity, pressure, dt, pressure_order, pressure_solve, **pde_aux_kwargs) 333 v1, p1 = velocity, pressure 334 # PDE at current point --> 335 rhs1 = pde(v1, **pde_aux_kwargs) - p1.gradient(at=v1.sampled_at, order=pressure_order) 336 v2_old = velocity + (dt / 2) * rhs1 337 v2, delta_p = make_incompressible(v2_old, solve=pressure_solve, order=pressure_order) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/field/_field.py:547, in Field.gradient(self, boundary, at, dims, stack_dim, order, implicit, scheme, upwind, gradient_extrapolation) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/field/_field.py:547, in Field.gradient(self, boundary, at, dims, stack_dim, order, implicit, scheme, upwind, gradient_extrapolation) 545 """Alias for `phi.field.spatial_gradient`""" 546 from ._field_math import spatial_gradient --> 547 return spatial_gradient(self, boundary=boundary, at=at, dims=dims, stack_dim=stack_dim, order=order, implicit=implicit, scheme=scheme, upwind=upwind, gradient_extrapolation=gradient_extrapolation) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/field/_field_math.py:244, in spatial_gradient(field, boundary, at, dims, stack_dim, order, implicit, implicitness, scheme, upwind, gradient_extrapolation) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/field/_field_math.py:244, in spatial_gradient(field, boundary, at, dims, stack_dim, order, implicit, implicitness, scheme, upwind, gradient_extrapolation) 240 assert stack_dim.name == 'vector' 241 return stagger(field, lambda lower, upper: (upper - lower) / field.dx.vector.as_dual(), gradient_extrapolation) 243 result_components = [ @@ -15810,7 +19187,7 @@
Higher-Order Simulations 248 if at == 'center': 249 result = field.with_values(math.stack(result_components, stack_dim)) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/field/_field_math.py:409, in perform_finite_difference_operation(field, dim, differentiation_order, dx, ext, output_ext, at, order, implicit, implicitness) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/field/_field_math.py:409, in perform_finite_difference_operation(field, dim, differentiation_order, dx, ext, output_ext, at, order, implicit, implicitness) 407 standard_mask = CenteredGrid(0, resolution=field.shape.non_batch) # ToDo ed is this okay with batch dimensions? 408 else: --> 409 standard_mask = CenteredGrid(0, resolution=field.shape.non_batch + spatial( @@ -15851,7 +19228,7 @@
Further Reading -{"state": {"09c2c3d8623040f6a521b7ea75f27eb0": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "1ac502711e054a2b8606a2ba2c0b1275": {"model_name": "ProgressStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "bar_color": null, "description_width": ""}}, "4e94238ba24846e8bfc54b6a19328c5c": {"model_name": "FloatProgressModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_09c2c3d8623040f6a521b7ea75f27eb0", "max": 100.0, "min": 0.0, "orientation": "horizontal", "style": "IPY_MODEL_1ac502711e054a2b8606a2ba2c0b1275", "tabbable": null, "tooltip": null, "value": 100.0}}, "7c73c8bb77e04c15ad3dfbc70270f6ac": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "bc700d69121b4d6e8508ca0c5556e7be": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "d6e5064aacdb4c949548c5b338168929": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_7c73c8bb77e04c15ad3dfbc70270f6ac", "placeholder": "\u200b", "style": "IPY_MODEL_bc700d69121b4d6e8508ca0c5556e7be", "tabbable": null, "tooltip": null, "value": "100%"}}, "263d1169b5a34cdabdc0d33fb5913f1c": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "db4e7554a38f40b7abe54a3f56adc907": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "d49973cfcc324c41ae1b5f749278d866": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_263d1169b5a34cdabdc0d33fb5913f1c", "placeholder": "\u200b", "style": "IPY_MODEL_db4e7554a38f40b7abe54a3f56adc907", "tabbable": null, "tooltip": null, "value": "\u2007100/100\u2007[00:27<00:00,\u2007\u20073.48it/s]"}}, "18476258fb634715abc8eaccb8805748": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "9333afdebd8541158d118fa2aa917a3e": {"model_name": "HBoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HBoxView", "box_style": "", "children": ["IPY_MODEL_d6e5064aacdb4c949548c5b338168929", "IPY_MODEL_4e94238ba24846e8bfc54b6a19328c5c", "IPY_MODEL_d49973cfcc324c41ae1b5f749278d866"], "layout": "IPY_MODEL_18476258fb634715abc8eaccb8805748", "tabbable": null, "tooltip": null}}, "c04049ffba3e4be88477e33ebee3797e": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "bbb1ad1de0574c7f8bd73fb3c816670f": {"model_name": "ProgressStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "bar_color": null, "description_width": ""}}, "7994c0a347a14c729d02cdf1e2517258": {"model_name": "FloatProgressModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "ProgressView", "bar_style": "danger", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_c04049ffba3e4be88477e33ebee3797e", "max": 200.0, "min": 0.0, "orientation": "horizontal", "style": "IPY_MODEL_bbb1ad1de0574c7f8bd73fb3c816670f", "tabbable": null, "tooltip": null, "value": 0.0}}, "a9a7e2f657ca4dabb4159cf5d70f244e": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "882654481efd430880f2cba50080235a": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "5355d311d9f74956bfe15b0fc14bd075": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_a9a7e2f657ca4dabb4159cf5d70f244e", "placeholder": "\u200b", "style": "IPY_MODEL_882654481efd430880f2cba50080235a", "tabbable": null, "tooltip": null, "value": "\u2007\u20070%"}}, "78867c107aca432793c56f83121cf7dd": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "4d7992337e3240bc8569d5c99c34d84e": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "ba54a1483cee4a9e879ab7d9f6c8068e": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_78867c107aca432793c56f83121cf7dd", "placeholder": "\u200b", "style": "IPY_MODEL_4d7992337e3240bc8569d5c99c34d84e", "tabbable": null, "tooltip": null, "value": "\u20070/200\u2007[00:05<?,\u2007?it/s]"}}, "0e078eecb9b340729bb9829bfb298f43": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "75d75d176dbd42caa2f542c8fc05ceaf": {"model_name": "HBoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HBoxView", "box_style": "", "children": ["IPY_MODEL_5355d311d9f74956bfe15b0fc14bd075", "IPY_MODEL_7994c0a347a14c729d02cdf1e2517258", "IPY_MODEL_ba54a1483cee4a9e879ab7d9f6c8068e"], "layout": "IPY_MODEL_0e078eecb9b340729bb9829bfb298f43", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} +{"state": {"f1b67d35460a4d469da452f146ede277": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "6d141872cb8f409bb777f69cc2e204f7": {"model_name": "ProgressStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "bar_color": null, "description_width": ""}}, "7b49e8f9ba544f1d94f0c5b769743e83": {"model_name": "FloatProgressModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_f1b67d35460a4d469da452f146ede277", "max": 100.0, "min": 0.0, "orientation": "horizontal", "style": "IPY_MODEL_6d141872cb8f409bb777f69cc2e204f7", "tabbable": null, "tooltip": null, "value": 100.0}}, "bddfba1b9ca54ea6afa0ab51ac605035": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "7318900e55324b0cae2dc7112a8c27ab": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "2a212f72b35243f099cffe1cf6841a29": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_bddfba1b9ca54ea6afa0ab51ac605035", "placeholder": "\u200b", "style": "IPY_MODEL_7318900e55324b0cae2dc7112a8c27ab", "tabbable": null, "tooltip": null, "value": "100%"}}, "d6948468a22e437391cb8744a692037e": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "48e21fa8c99148019eadba4fefda60e2": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "3242dac83f514224986ba19c192f4fce": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_d6948468a22e437391cb8744a692037e", "placeholder": "\u200b", "style": "IPY_MODEL_48e21fa8c99148019eadba4fefda60e2", "tabbable": null, "tooltip": null, "value": "\u2007100/100\u2007[00:27<00:00,\u2007\u20073.51it/s]"}}, "cc2c644bfae84a598daa94cce2ba2dbe": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "4234234b8f654ca19ea57b21851132ac": {"model_name": "HBoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HBoxView", "box_style": "", "children": ["IPY_MODEL_2a212f72b35243f099cffe1cf6841a29", "IPY_MODEL_7b49e8f9ba544f1d94f0c5b769743e83", "IPY_MODEL_3242dac83f514224986ba19c192f4fce"], "layout": "IPY_MODEL_cc2c644bfae84a598daa94cce2ba2dbe", "tabbable": null, "tooltip": null}}, "b4c9448d9aee48c1a231d8515149b141": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "ec21a8e2272d4c27a9a8686a440d847e": {"model_name": "ProgressStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "ProgressStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "bar_color": null, "description_width": ""}}, "a99e8340ff644b93b284e949d03b398b": {"model_name": "FloatProgressModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "ProgressView", "bar_style": "danger", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_b4c9448d9aee48c1a231d8515149b141", "max": 200.0, "min": 0.0, "orientation": "horizontal", "style": "IPY_MODEL_ec21a8e2272d4c27a9a8686a440d847e", "tabbable": null, "tooltip": null, "value": 0.0}}, "4910bb235c07407585f170aa41e4f01d": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "8a04ccae89164f8788ae7447a7ed611e": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "5d85b7a9b33748da94fc6bc093466dde": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_4910bb235c07407585f170aa41e4f01d", "placeholder": "\u200b", "style": "IPY_MODEL_8a04ccae89164f8788ae7447a7ed611e", "tabbable": null, "tooltip": null, "value": "\u2007\u20070%"}}, "f6abb7e1a022421e8f761f2b317cde7b": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "e8d5a4a6b7dc4666b7ddaf6871d2d7ca": {"model_name": "HTMLStyleModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLStyleModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "StyleView", "background": null, "description_width": "", "font_size": null, "text_color": null}}, "965dc1c038604859ac1e33e76a59e441": {"model_name": "HTMLModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HTMLView", "description": "", "description_allow_html": false, "layout": "IPY_MODEL_f6abb7e1a022421e8f761f2b317cde7b", "placeholder": "\u200b", "style": "IPY_MODEL_e8d5a4a6b7dc4666b7ddaf6871d2d7ca", "tabbable": null, "tooltip": null, "value": "\u20070/200\u2007[00:05<?,\u2007?it/s]"}}, "26c98f4cc4394a918a01f17844037955": {"model_name": "LayoutModel", "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "state": {"_model_module": "@jupyter-widgets/base", "_model_module_version": "2.0.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "2.0.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border_bottom": null, "border_left": null, "border_right": null, "border_top": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null}}, "c00700f9a0624c0e97422e4e47b00c8e": {"model_name": "HBoxModel", "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "state": {"_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "2.0.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "2.0.0", "_view_name": "HBoxView", "box_style": "", "children": ["IPY_MODEL_5d85b7a9b33748da94fc6bc093466dde", "IPY_MODEL_a99e8340ff644b93b284e949d03b398b", "IPY_MODEL_965dc1c038604859ac1e33e76a59e441"], "layout": "IPY_MODEL_26c98f4cc4394a918a01f17844037955", "tabbable": null, "tooltip": null}}}, "version_major": 2, "version_minor": 0} diff --git a/Fluids_Tutorial.html b/Fluids_Tutorial.html index 2d199cdbe..d00b6272b 100644 --- a/Fluids_Tutorial.html +++ b/Fluids_Tutorial.html @@ -15372,55 +15372,40 @@
Running the Simulation -
---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[6], line 6 - 3 velocity += buoyancy_force - 4 velocity, _ = fluid.make_incompressible(velocity) -----> 6 vis.plot(smoke) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation ++ + ++ ++Out[6]:-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] + + +@@ -15481,62 +15466,922 @@++Running the Simulation
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19+ ++ +Out[7]:+ + + ++ ++-@@ -15795,65 +16640,40 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[7], line 10 - 8 trajectory.append(smoke) - 9 trajectory = field.stack(trajectory, batch('time')) ----> 10 vis.plot(trajectory, animate='time') - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+++<Figure size 640x480 with 0 Axes>Obtaining Gradients -
/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/torch/_torch_backend.py:800: UserWarning: Sparse CSR tensor support is in beta state. If you miss a functionality in the sparse tensor support, please submit a feature request to https://github.com/pytorch/pytorch/issues. (Triggered internally at ../aten/src/ATen/SparseCsrTensorImpl.cpp:53.) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/backend/torch/_torch_backend.py:800: UserWarning: Sparse CSR tensor support is in beta state. If you miss a functionality in the sparse tensor support, please submit a feature request to https://github.com/pytorch/pytorch/issues. (Triggered internally at ../aten/src/ATen/SparseCsrTensorImpl.cpp:53.) return torch.sparse_csr_tensor(row_pointers, column_indices, values, shape, device=values.device)+ ++ +Out[14]:+ + + + ++ ++-diff --git a/Heightmaps.html b/Heightmaps.html index 3a8ccfcee..fe16dfe1a 100644 --- a/Heightmaps.html +++ b/Heightmaps.html @@ -15171,61 +15171,35 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[14], line 3 - 1 velocity_grad = sim_grad(initial_smoke, initial_velocity) -----> 3 vis.plot(velocity_grad) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['Tensor', 'str', 'Tensor']+ + +++Heightmaps¶
-@@ -15367,60 +15327,35 @@++- +@@ -15274,54 +15248,40 @@Out[2]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[2], line 4 - 2 bounds = Box(x=2, y=1) - 3 heightmap = geom.Heightmap(height, bounds, max_dist=.1) -----> 4 plot(heightmap) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Heightmaps¶
-+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[3], line 2 - 1 is_inside = CenteredGrid(lambda loc: heightmap.lies_inside(loc), x=100, y=100, bounds=Box(x=2, y=2)) -----> 2 plot(is_inside) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation +++ ++Out[3]:+ -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] + +++Heightmaps¶
-@@ -16029,35 +15873,35 @@+@@ -15909,60 +15771,42 @@- +@@ -15475,61 +15410,35 @@Out[4]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[4], line 2 - 1 distance = CenteredGrid(lambda loc: heightmap.approximate_signed_distance(loc), x=100, y=100, bounds=Box(x=2, y=2)) -----> 2 plot(distance, heightmap, overlay='args') -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Heightmaps¶
-@@ -15686,61 +15592,35 @@++- +@@ -15595,54 +15504,51 @@Out[5]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[5], line 3 - 1 heightmap = geom.Heightmap(height, bounds, max_dist=1) - 2 distance = CenteredGrid(lambda loc: heightmap.approximate_signed_distance(loc), x=100, y=100, bounds=Box(x=2, y=2)) -----> 3 plot(distance, heightmap, overlay='args') -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Heightmaps¶
+--------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) +AttributeError Traceback (most recent call last) Cell In[6], line 3 1 points = Box(x=3, y=(-1, 1)).sample_uniform(instance(points=200)) 2 sgn_dist, delta, normal, _, face_index = heightmap.approximate_closest_surface(points) ----> 3 plot({'closest': [heightmap, PointCloud(points, .1 * math.vec_normalize(delta))], 4 'normal': [heightmap, PointCloud(points, .2 * normal)]}, overlay='list', color=[0, heightmap.lies_inside(points)*2+1]) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:322, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) + 320 for i, f in enumerate(fields): + 321 idx = indices[pos][i] +--> 322 plots.plot(f, figure, axes[pos], subplots[pos], min_val, max_val, show_color_bar, color[pos][i], alpha[idx], err[idx]) + 323 plots.finalize(figure) + 324 LAST_FIGURE[0] = figure -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis_base.py:382, in PlottingLibrary.plot(self, data, figure, subplot, space, *args, **kwargs) + 380 for recipe in self.recipes: + 381 if recipe.can_plot(data, space): +--> 382 recipe.plot(data, figure, subplot, space, *args, **kwargs) + 383 return + 384 raise NotImplementedError(f"No {self.name} recipe found for {data}. Recipes: {self.recipes}") -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:458, in VectorCloud2D.plot(self, data, figure, subplot, space, min_val, max_val, show_color_bar, color, alpha, err) + 456 u, v = reshaped_numpy(c_data.values.vector[dims], [vector, c_data.shape.without('vector')]) + 457 color_i = color[idx] +--> 458 if (color[idx] == 'cmap').all: + 459 col = _next_line_color(subplot, kind='collections') # ToDo + 460 elif color[idx].shape: -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): +AttributeError: 'bool' object has no attribute 'all'++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] + +++Vertical Heightmaps -
+- +@@ -15793,59 +15673,41 @@Out[7]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[7], line 3 - 1 height = wrap([.1, .02, 0, 0, 1, .95, .8, .5, 0], spatial('y')) - 2 bounds = Box(x=1, y=2) -----> 3 plot(geom.Heightmap(height, bounds, max_dist=.1)) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++2D Heightmaps
--------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) +AssertionError Traceback (most recent call last) Cell In[8], line 4 2 height = CenteredGrid(lambda pos: math.exp(-math.vec_squared(pos-1) * 3), 0, bounds['x,y'], x=10, y=10).values 3 heightmap = geom.Heightmap(height, bounds, max_dist=.1) ----> 4 show(heightmap) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:58, in show(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:58, in show(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) 56 kwargs = locals() 57 del kwargs['fields'] ---> 58 fig = plot(*fields, **kwargs) 59 plots = get_plots_by_figure(fig) 60 if isinstance(fig, Tensor): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:322, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) + 320 for i, f in enumerate(fields): + 321 idx = indices[pos][i] +--> 322 plots.plot(f, figure, axes[pos], subplots[pos], min_val, max_val, show_color_bar, color[pos][i], alpha[idx], err[idx]) + 323 plots.finalize(figure) + 324 LAST_FIGURE[0] = figure -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis_base.py:382, in PlottingLibrary.plot(self, data, figure, subplot, space, *args, **kwargs) + 380 for recipe in self.recipes: + 381 if recipe.can_plot(data, space): +--> 382 recipe.plot(data, figure, subplot, space, *args, **kwargs) + 383 return + 384 raise NotImplementedError(f"No {self.name} recipe found for {data}. Recipes: {self.recipes}") -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_dash/_plotly_plots.py:494, in Scatter3D.plot(self, data, figure, subplot, space, min_val, max_val, show_color_bar, color, alpha, err) + 492 color_i = plotly_color(color[idx].native()) + 493 if spatial(data.geometry): +--> 494 assert spatial(data.geometry).rank == 1 + 495 xyz = math.reshaped_numpy(data[idx].points.vector[dims], [vector, data.shape.non_channel.non_spatial, spatial]) + 496 xyz_padded = [[i.tolist() + [None] for i in c] for c in xyz] -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+AssertionError:2D Heightmaps
--------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) +AssertionError Traceback (most recent call last) Cell In[9], line 3 1 points = bounds.sample_uniform(instance(points=200)) 2 sgn_dist, delta, normal, _, face_index = heightmap.approximate_closest_surface(points) ----> 3 show({'closest': [heightmap, PointCloud(points, .1 * math.vec_normalize(delta))], 4 'normal': [heightmap, PointCloud(points, .2 * normal)]}, overlay='list', color=[0, heightmap.lies_inside(points)*2+1]) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:58, in show(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:58, in show(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) 56 kwargs = locals() 57 del kwargs['fields'] ---> 58 fig = plot(*fields, **kwargs) 59 plots = get_plots_by_figure(fig) 60 if isinstance(fig, Tensor): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:322, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) + 320 for i, f in enumerate(fields): + 321 idx = indices[pos][i] +--> 322 plots.plot(f, figure, axes[pos], subplots[pos], min_val, max_val, show_color_bar, color[pos][i], alpha[idx], err[idx]) + 323 plots.finalize(figure) + 324 LAST_FIGURE[0] = figure -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis_base.py:382, in PlottingLibrary.plot(self, data, figure, subplot, space, *args, **kwargs) + 380 for recipe in self.recipes: + 381 if recipe.can_plot(data, space): +--> 382 recipe.plot(data, figure, subplot, space, *args, **kwargs) + 383 return + 384 raise NotImplementedError(f"No {self.name} recipe found for {data}. Recipes: {self.recipes}") -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_dash/_plotly_plots.py:494, in Scatter3D.plot(self, data, figure, subplot, space, min_val, max_val, show_color_bar, color, alpha, err) + 492 color_i = plotly_color(color[idx].native()) + 493 if spatial(data.geometry): +--> 494 assert spatial(data.geometry).rank == 1 + 495 xyz = math.reshaped_numpy(data[idx].points.vector[dims], [vector, data.shape.non_channel.non_spatial, spatial]) + 496 xyz_padded = [[i.tolist() + [None] for i in c] for c in xyz] -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+AssertionError:Combining Heightmaps----> 8 show({'closest': [heightmap, PointCloud(points, .1 * math.vec_normalize(delta))], 9 'normal': [heightmap, PointCloud(points, .2 * normal)]}, overlay='list', color=[0, heightmap.lies_inside(points)*2+1]) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:58, in show(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:58, in show(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) 56 kwargs = locals() 57 del kwargs['fields'] ---> 58 fig = plot(*fields, **kwargs) 59 plots = get_plots_by_figure(fig) 60 if isinstance(fig, Tensor): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:252, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:252, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) 250 ncols = uniform_bound(col_dims).volume 251 assert nrows * ncols <= max_subfigures, f"Too many subfigures ({nrows * ncols}) for max_subfigures={max_subfigures}. If you want to plot this many subfigures, increase the limit." --> 252 positioning, indices = layout_sub_figures(data, row_dims, col_dims, animate, overlay, 0, 0) 253 # --- Process arguments --- 254 plots = default_plots(positioning) if lib is None else get_plots(lib) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:375, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:375, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) 373 offset += shape(e).only(row_dims).volume 374 elif dim0.only(col_dims): --> 375 layout_sub_figures(e, row_dims, col_dims, animate, overlay, offset_row, offset_col + offset, positioning, indices, index) 376 offset += shape(e).only(col_dims).volume 377 else: -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:375, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:375, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) 373 offset += shape(e).only(row_dims).volume 374 elif dim0.only(col_dims): --> 375 layout_sub_figures(e, row_dims, col_dims, animate, overlay, offset_row, offset_col + offset, positioning, indices, index) 376 offset += shape(e).only(col_dims).volume 377 else: -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:362, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:362, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) 359 if dim0.only(overlay): 360 for overlay_index in dim0.only(overlay).meshgrid(names=True): # overlay these fields 361 # ToDo expand constants along rows/cols @@ -16065,24 +15909,24 @@
Combining Heightmaps 363 return positioning, indices 364 elif dim0.only(animate): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:382, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_vis.py:382, in layout_sub_figures(data, row_dims, col_dims, animate, overlay, offset_row, offset_col, positioning, indices, base_index) 380 # --- data must be a plottable object --- 381 data = to_field(data) --> 382 overlay = data.shape.only(overlay) 383 animate = data.shape.only(animate).without(overlay) 384 row_shape = data.shape.only(row_dims).without(animate).without(overlay) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/field/_field.py:211, in Field.shape(self) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/field/_field.py:211, in Field.shape(self) 209 return batch(self._geometry) & self.resolution & non_dual(self._values).without(self.resolution) & self._geometry.shape['vector'] 210 set_shape = self._geometry.sets[self.sampled_at] --> 211 return batch(self._geometry) & (channel(self._geometry) - 'vector') & set_shape & self._values -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_shape.py:735, in Shape.__and__(self, other) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_shape.py:735, in Shape.__and__(self, other) 733 if other is dual: 734 return concat_shapes(self, self.primal.as_dual()) --> 735 return merge_shapes(self, other) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_shape.py:1926, in merge_shapes(order, allow_varying_sizes, *objs) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/math/_shape.py:1926, in merge_shapes(order, allow_varying_sizes, *objs) 1924 else: 1925 if not sizes_match: -> 1926 raise IncompatibleShapes(f"Cannot merge shapes {shapes} because dimension '{dim.name}' exists with different sizes.", *shapes) diff --git a/IO_with_Scenes.html b/IO_with_Scenes.html index 2e05edb4d..4c88e86dd 100644 --- a/IO_with_Scenes.html +++ b/IO_with_Scenes.html @@ -15174,7 +15174,7 @@
Writing Data
-@@ -15290,55 +15290,40 @@/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/field/_scene.py:150: RuntimeWarning: Failed to copy calling script to scene during Scene.create(): [Errno 2] No such file or directory: '/tmp/ipykernel_2615/2238997793.py' +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/field/_scene.py:150: RuntimeWarning: Failed to copy calling script to scene during Scene.create(): [Errno 2] No such file or directory: '/tmp/ipykernel_2706/2238997793.py' warnings.warn(f"Failed to copy calling script to scene during Scene.create(): {err}", RuntimeWarning)Writing Data
-+ +---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[4], line 3 - 1 smoothness = math.random_uniform() - 2 data = CenteredGrid(Noise(smoothness=smoothness + 0.5), x=32, y=16) -----> 3 plot(data) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation +++ ++Out[4]:+ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +@@ -15445,7 +15430,7 @@++Reading Data
-@@ -15488,59 +15473,35 @@{'smoothness': 0.5167388319969177}+{'smoothness': 0.27965331077575684}Reading Data
-@@ -15759,7 +15722,7 @@+@@ -15720,7 +15683,7 @@- +@@ -15595,61 +15556,35 @@Out[8]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[8], line 1 -----> 1 plot(scene.read('noise_data', frame=0)) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Batched Data
-@@ -15669,7 +15632,7 @@+@@ -15618,7 +15581,7 @@- +@@ -15696,60 +15631,35 @@Out[9]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[9], line 3 - 1 batched_smoothness = math.random_uniform(batch(batch=4)) - 2 batched_data = CenteredGrid(Noise(smoothness=batched_smoothness + 0.5), x=32, y=16) -----> 3 plot(batched_data, show_color_bar=False) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Batched Data
-@@ -15951,59 +15861,35 @@+@@ -15838,7 +15748,7 @@- +@@ -15786,7 +15696,7 @@Out[11]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[11], line 2 - 1 scene = Scene.at('./data', 0) -----> 2 plot(scene.read('batched_noise_data'), show_color_bar=False) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Batched Data
-(0.106, 0.372, 0.401, 0.953) along batchᵇ float64+(0.127, 0.651, 0.710, 0.496) along batchᵇ float64Batched Data
-@@ -15920,7 +15830,7 @@/opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/field/_scene.py:150: RuntimeWarning: Failed to copy calling script to scene during Scene.create(): [Errno 2] No such file or directory: '/tmp/ipykernel_2615/3852168639.py' +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/field/_scene.py:150: RuntimeWarning: Failed to copy calling script to scene during Scene.create(): [Errno 2] No such file or directory: '/tmp/ipykernel_2706/3852168639.py' warnings.warn(f"Failed to copy calling script to scene during Scene.create(): {err}", RuntimeWarning)Batched Data
-0.1056535467505455+0.1267237514257431Batched Data
+@@ -15567,7 +15530,7 @@+ +Out[16]:+ + + + ++ ++ +-diff --git a/Math_Introduction.html b/Math_Introduction.html index c1da73dcd..b4d83c8bf 100644 --- a/Math_Introduction.html +++ b/Math_Introduction.html @@ -15279,59 +15279,35 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[16], line 1 -----> 1 plot(scene.read('batched_noise_data')) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+ + +++Introduction to Tensors in Φ
-++@@ -15471,53 +15447,40 @@- +@@ -15434,7 +15410,7 @@Out[4]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[4], line 1 -----> 1 plot(point) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Introduction to Tensors in Φ
-(x=1.147, y=-0.901); (x=-0.872, y=0.929); (x=-0.716, y=0.467) (pointsⁱ=3, vectorᶜ=x,y)+(x=0.048, y=0.274); (x=0.468, y=-1.413); (x=-1.909, y=-0.638) (pointsⁱ=3, vectorᶜ=x,y)Introduction to Tensors in Φ
-+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[7], line 1 -----> 1 plot(points) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1675: RuntimeWarning: invalid value encountered in power + return base ** exp +++ ++Out[7]:-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): ++ ++ ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] + +++Introduction to Tensors in Φ
-(x=1.147, y=-0.901)
+(x=0.048, y=0.274)
Introduction to Tensors in Φ
-(1.147, -0.872, -0.716) along pointsⁱ+(0.048, 0.468, -1.909) along pointsⁱIntroduction to Tensors in Φ
-(1.147, -0.872, -0.716) along pointsⁱ+(0.048, 0.468, -1.909) along pointsⁱIntroduction to Tensors in Φ
-1.1467746
+0.048285987
Introduction to Tensors in Φ
-@@ -15813,7 +15776,7 @@1.1467746
+0.048285987
Introduction to Tensors in Φ
-@@ -15844,59 +15807,35 @@(xˢ=10) 0.509 ± 0.315 (5e-02...9e-01)+(xˢ=10) 0.622 ± 0.318 (9e-02...1e+00)Introduction to Tensors in Φ
-@@ -16031,59 +15957,35 @@++- +@@ -15943,53 +15882,40 @@Out[14]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[14], line 1 -----> 1 plot(grid) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool', 'str', 'int32'] +++Introduction to Tensors in Φ
-+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[15], line 1 -----> 1 plot(math.random_uniform(spatial(x=10, y=8))) +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation +++ ++Out[15]:-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): ++ ++ ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] + +++Introduction to Tensors in Φ
-@@ -15331,61 +15318,35 @@++- +@@ -16126,59 +16028,35 @@Out[16]:--+---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[16], line 1 -----> 1 plot(math.random_uniform(spatial(x=10)) * math.random_uniform(spatial(y=8))) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result ++ +-File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) ++ + -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32'] +++Introduction to Tensors in Φ
+++ +Out[17]:+ + + + ++ ++ +-diff --git a/SDF.html b/SDF.html index d6946d0e5..e976432c5 100644 --- a/SDF.html +++ b/SDF.html @@ -15239,55 +15239,42 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[17], line 1 -----> 1 plot(math.random_uniform(batch(examples=4), spatial(x=10, y=8)), show_color_bar=False) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+ + +++Custom SDF Construction -
---------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[3], line 6 - 4 sdf_tensor = tensor(sdf_np, spatial('x,y')) - 5 sdf = geom.SDFGrid(sdf_tensor, bounds) -----> 6 plot(sdf_tensor, sdf) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1675: RuntimeWarning: invalid value encountered in power + return base ** exp +/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:167: UserWarning: This figure includes Axes that are not compatible with tight_layout, so results might be incorrect. + plt.tight_layout() # because subplot titles can be added after figure creation +++ ++Out[3]:+ + + + ++ ++ ++ + + + + + +++Sampling¶
++ +Out[4]:+ + + + ++ ++ +-@@ -15467,61 +15428,35 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[4], line 3 - 1 to_grid = CenteredGrid(sdf, 0, bounds, x=40, y=40) - 2 soft = resample(sdf, to_grid, soft=True) -----> 3 plot(to_grid, soft) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+ + +++Querying the Surface +
+ +Out[6]:+ + + + ++ ++ +-diff --git a/Unstructured.html b/Unstructured.html index f489e55f7..75c8d3b06 100644 --- a/Unstructured.html +++ b/Unstructured.html @@ -15198,7 +15198,7 @@----------------------------------------------------------------------------- -NoBackendFound Traceback (most recent call last) -Cell In[6], line 3 - 1 loc = geom.UniformGrid(sdf.resolution.with_sizes(10), sdf.bounds).center - 2 sgn_dist, delta, normal, *_ = sdf.approximate_closest_surface(loc) -----> 3 plot(PointCloud(loc, delta)) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:266, in plot(lib, row_dims, col_dims, animate, overlay, title, size, same_scale, log_dims, show_color_bar, color, alpha, err, frame_time, repeat, plt_params, max_subfigures, *fields) - 264 log_dims = parse_dim_order(log_dims) or () - 265 color = layout_pytree_node(color, wrap_leaf=True) ---> 266 color = layout_color(positioning, indices, color) - 267 alpha = layout_pytree_node(alpha, wrap_leaf=True) - 268 alpha = tree_map(lambda x: 1 if x is None else x, alpha) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/vis/_vis.py:441, in layout_color(content, indices, color) - 439 channels = channel(f).without('vector') - 440 channel_colors = counter + math.range_tensor(channels) ---> 441 result_pos.append(math.where(cmap, wrap('cmap'), channel_colors)) - 442 counter += channels.volume * math.any(~cmap, shape) - 443 return result - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1151, in where(condition, value_true, value_false) - 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) --> 1151 return broadcast_op(inner_where, [condition, value_true, value_false]) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1069, in broadcast_op(operation, tensors, iter_dims, no_return) - 1067 iter_dims = broadcast_dims(*tensors) if iter_dims is None else iter_dims - 1068 if len(iter_dims) == 0: --> 1069 return operation(*tensors) - 1070 else: - 1071 if isinstance(iter_dims, Shape): - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/math/_ops.py:1148, in where.<locals>.inner_where(c, vt, vf) - 1146 return c._with_values(where(c_values, vt_values, vf_values)) - 1147 shape, (c, vt, vf) = broadcastable_native_tensors(c, vt, vf) --> 1148 result = choose_backend(c, vt, vf).where(c, vt, vf) - 1149 return NativeTensor(result, shape) - -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phiml/backend/_backend.py:1746, in choose_backend(prefer_default, *values) - 1744 raise NoBackendFound(f"Not a native tensor {[type(v).__name__ for v in unknown_values]}") - 1745 else: --> 1746 raise NoBackendFound(f"Could not resolve backend for native types {[type(v).__name__ for v in values]}") - 1747 # --- Native tensors? --- - 1748 for backend in backends: - -NoBackendFound: Could not resolve backend for native types ['bool_', 'str', 'int32']+ + +++Loading an Unstructured MeshIn[3], line 1 ----> 1 mesh = geom.load_su2("mesh_wedge_inv.su2", face_format='csc') -File /opt/hostedtoolcache/Python/3.12.6/x64/lib/python3.12/site-packages/phi/geom/_mesh.py:478, in load_su2(file_or_mesh, cell_dim, face_format) +File /opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/phi/geom/_mesh.py:478, in load_su2(file_or_mesh, cell_dim, face_format) 464 """ 465 Load an unstructured mesh from a `.su2` file. 466 diff --git a/data/sim_000000/batched_noise_data_000000.npz b/data/sim_000000/batched_noise_data_000000.npz index 598de0272..3c5cdaab7 100644 Binary files a/data/sim_000000/batched_noise_data_000000.npz and b/data/sim_000000/batched_noise_data_000000.npz differ diff --git a/data/sim_000000/description.json b/data/sim_000000/description.json index 1f589eb67..6403ff790 100644 --- a/data/sim_000000/description.json +++ b/data/sim_000000/description.json @@ -10,10 +10,10 @@ null ], "data": [ - 0.1056535467505455, - 0.3720528483390808, - 0.40077075362205505, - 0.9527272582054138 + 0.1267237514257431, + 0.651422381401062, + 0.710021436214447, + 0.49623769521713257 ] }, "__tensors__": [ diff --git a/data/sim_000000/noise_data_000000.npz b/data/sim_000000/noise_data_000000.npz index db0f03251..069a62bd3 100644 Binary files a/data/sim_000000/noise_data_000000.npz and b/data/sim_000000/noise_data_000000.npz differ diff --git a/data/sim_000001/batched_noise_data_000000.npz b/data/sim_000001/batched_noise_data_000000.npz index 59e2cf903..94dd44b52 100644 Binary files a/data/sim_000001/batched_noise_data_000000.npz and b/data/sim_000001/batched_noise_data_000000.npz differ diff --git a/data/sim_000001/description.json b/data/sim_000001/description.json index ab580aa23..ae9fe6de5 100644 --- a/data/sim_000001/description.json +++ b/data/sim_000001/description.json @@ -1,3 +1,3 @@ { - "smoothness": 0.1056535467505455 + "smoothness": 0.1267237514257431 } \ No newline at end of file diff --git a/data/sim_000002/batched_noise_data_000000.npz b/data/sim_000002/batched_noise_data_000000.npz index e155b4564..616c5fa87 100644 Binary files a/data/sim_000002/batched_noise_data_000000.npz and b/data/sim_000002/batched_noise_data_000000.npz differ diff --git a/data/sim_000002/description.json b/data/sim_000002/description.json index 5a242b4fe..aded1e259 100644 --- a/data/sim_000002/description.json +++ b/data/sim_000002/description.json @@ -1,3 +1,3 @@ { - "smoothness": 0.3720528483390808 + "smoothness": 0.651422381401062 } \ No newline at end of file diff --git a/data/sim_000003/batched_noise_data_000000.npz b/data/sim_000003/batched_noise_data_000000.npz index 025dafa02..a106151c0 100644 Binary files a/data/sim_000003/batched_noise_data_000000.npz and b/data/sim_000003/batched_noise_data_000000.npz differ diff --git a/data/sim_000003/description.json b/data/sim_000003/description.json index 8728e9561..8baa0d9b1 100644 --- a/data/sim_000003/description.json +++ b/data/sim_000003/description.json @@ -1,3 +1,3 @@ { - "smoothness": 0.40077075362205505 + "smoothness": 0.710021436214447 } \ No newline at end of file diff --git a/data/sim_000004/batched_noise_data_000000.npz b/data/sim_000004/batched_noise_data_000000.npz index ba19bb735..758c4544e 100644 Binary files a/data/sim_000004/batched_noise_data_000000.npz and b/data/sim_000004/batched_noise_data_000000.npz differ diff --git a/data/sim_000004/description.json b/data/sim_000004/description.json index d98468de6..a48808552 100644 --- a/data/sim_000004/description.json +++ b/data/sim_000004/description.json @@ -1,3 +1,3 @@ { - "smoothness": 0.9527272582054138 + "smoothness": 0.49623769521713257 } \ No newline at end of file diff --git a/phi/field/index.html b/phi/field/index.html index 6ab471afc..7e62ee7fb 100644 --- a/phi/field/index.html +++ b/phi/field/index.html @@ -325,7 +325,7 @@
at 0x7fd5880a2ca0>Args
at 0x7fc069b6eca0> +def divergence(field: phi.field._field.Field, order=2, implicit: phiml.math._optimize.Solve = None, upwind: phi.field._field.Field = None, implicitness: int = None) ‑> -def divergence(field: phi.field._field.Field, order=2, implicit: phiml.math._optimize.Solve = None, upwind: phi.field._field.Field = None, implicitness: int = None) ‑>
CenteredGrid() CenteredGrid() Computes the divergence of a grid using finite differences.
diff --git a/phi/physics/fluid.html b/phi/physics/fluid.html index c75aa7ce4..ff18cb7d0 100644 --- a/phi/physics/fluid.html +++ b/phi/physics/fluid.html @@ -52,7 +52,7 @@Returns
Velocity of same type as
velocity
-def boundary_push(particles:
, obstacles: tuple, separation: float = 0.5) ‑> +def boundary_push(particles:, obstacles: tuple, separation: float = 0.5) ‑> Enforces boundary conditions by correcting possible errors of the advection step and shifting particles out of @@ -104,7 +104,7 @@
Returns
-def make_incompressible(velocity: phi.field._field.Field, obstacles: Obstacle = (), solve: phiml.math._optimize.Solve = auto with tolerance None (rel), None (abs), max_iterations=1000, active:
= None, order: int = 2, correct_skew=False, wide_stencil: bool = None) ‑> Tuple[phi.field._field.Field, phi.field._field.Field] +def make_incompressible(velocity: phi.field._field.Field, obstacles: Obstacle = (), solve: phiml.math._optimize.Solve = auto with tolerance None (rel), None (abs), max_iterations=1000, active:= None, order: int = 2, correct_skew=False, wide_stencil: bool = None) ‑> Tuple[phi.field._field.Field, phi.field._field.Field] Projects the given velocity field by solving for the pressure and subtracting its spatial_gradient.