PhiFlow icon indicating copy to clipboard operation
PhiFlow copied to clipboard

FVM_Cylinder_GMsh.ipynb returns KeyError: ('cells', False)

Open StuvX opened this issue 4 months ago • 3 comments

When I try to run FVM_Cylinder_GMsh.ipynb I get the following error:


KeyError Traceback (most recent call last) File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/IPython/core/formatters.py:347, in BaseFormatter.call(self, obj) 345 method = get_real_method(obj, self.print_method) 346 if method is not None: --> 347 return method() 348 return None 349 else:

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/matplotlib/animation.py:1362, in Animation.repr_html(self) 1360 fmt = mpl.rcParams['animation.html'] 1361 if fmt == 'html5': -> 1362 return self.to_html5_video() 1363 elif fmt == 'jshtml': 1364 return self.to_jshtml()

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/matplotlib/animation.py:1289, in Animation.to_html5_video(self, embed_limit) 1285 Writer = writers[mpl.rcParams['animation.writer']] 1286 writer = Writer(codec='h264', 1287 bitrate=mpl.rcParams['animation.bitrate'], 1288 fps=1000. / self._interval) -> 1289 self.save(str(path), writer=writer) 1290 # Now open and base64 encode. 1291 vid64 = base64.encodebytes(path.read_bytes())

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/matplotlib/animation.py:1092, in Animation.save(self, filename, writer, fps, dpi, codec, bitrate, extra_args, metadata, extra_anim, savefig_kwargs, progress_callback) 1089 with writer.saving(self._fig, filename, dpi),
1090 cbook._setattr_cm(self._fig.canvas, _is_saving=True, manager=None): 1091 for anim in all_anim: -> 1092 anim._init_draw() # Clear the initial frame 1093 frame_number = 0 1094 # TODO: Currently only FuncAnimation has a save_count 1095 # attribute. Can we generalize this to all Animations?

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/matplotlib/animation.py:1749, in FuncAnimation._init_draw(self) 1741 warnings.warn( 1742 "Can not start iterating the frames for the initial draw. " 1743 "This can be caused by passing in a 0 length sequence " (...) 1746 "it may be exhausted due to a previous display or save." 1747 ) 1748 return -> 1749 self._draw_frame(frame_data) 1750 else: 1751 self._drawn_artists = self._init_func()

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/matplotlib/animation.py:1768, in FuncAnimation._draw_frame(self, framedata) 1764 self._save_seq = self._save_seq[-self._save_count:] 1766 # Call the func with framedata and args. If blitting is desired, 1767 # func needs to return a sequence of any artists that were modified. -> 1768 self._drawn_artists = self._func(framedata, *self._args) 1770 if self._blit: 1772 err = RuntimeError('The animation function must return a sequence ' 1773 'of Artist objects.')

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/phi/vis/_matplotlib/_matplotlib_plots.py:157, in MatplotlibPlots.animate..clear_and_plot(frame) 154 axis.set_subplotspec(specs[axis]) 155 # subplot.set_title(titles[subplot]) 156 # plt.tight_layout() --> 157 plot_frame_function(frame)

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/phi/vis/_vis.py:399, in plot..plot_frame(frame) 397 for i, f in enumerate(fields): 398 idx = indices[pos][i] --> 399 f = f[{animate.name: frame}] 400 plots.plot(f, figure, axes[pos], subplots[pos], min_val, max_val, show_color_bar, color[idx], alpha[idx], err[idx]) 401 plots.finalize(figure)

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/phi/field/_field.py:641, in Field.getitem(self, item) 639 if not item: 640 return self --> 641 boundary = domain_slice(self._boundary, item, self.resolution) 642 item_without_vec = {dim: selection for dim, selection in item.items() if dim != 'vector'} 643 geometry = self._geometry[item_without_vec]

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/phiml/math/extrapolation.py:1791, in domain_slice(ext, item, domain_dims) 1789 domain_dims = parse_dim_order(domain_dims) 1790 for dim in domain_dims: -> 1791 lo = ext._getitem_with_domain(item, dim, False, domain_dims) 1792 up = ext._getitem_with_domain(item, dim, True, domain_dims) 1793 if lo == up:

File ~/miniconda3/envs/grow2/lib/python3.10/site-packages/phiml/math/extrapolation.py:1343, in _MixedExtrapolation._getitem_with_domain(self, item, dim, upper_edge, all_dims) 1341 if b in [dim, dim+('+' if upper_edge else '-')]: 1342 return ext._getitem_with_domain(item, b[:-1], b.endswith('+'), all_dims) -> 1343 raise KeyError((dim, upper_edge))

KeyError: ('cells', False)

StuvX avatar Oct 03 '24 01:10 StuvX