1QB-Information-Technologies / ccvm

Solve continuous non-convex optimization problems with Coherent Continous-Variable Machine (CCVM) architectures and solvers
GNU Affero General Public License v3.0
9 stars 0 forks source link

LaTeX runtime error #52

Closed KyleM4t1qbit closed 1 year ago

KyleM4t1qbit commented 1 year ago

When running examples/ccvm_boxqp_plot.py:

RuntimeError: latex was not able to process the following string:
b'lp' 

Here's the full traceback:

Successfully saved metadata to metadata_file_path: ./metadata/metadata.json
/opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axes/_base.py:2953: RuntimeWarning: overflow encountered in scalar add
  x0, x1 = inverse_trans.transform([x0t - delta, x1t + delta])
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[4], line 52
     49 # Save metadata to file
     50 metadata_filepath = metadata_list.save_metadata_to_file(METADATA_DIR)
---> 52 plot_fig = ccvmplotlib.plot_TTS(
     53     solution_filepath=metadata_filepath,
     54     problem="BoxQP",
     55     TTS_type="wallclock",
     56     show_plot=True,
     57 )
     59 # If PLOT_OUTPUT_DIR not exists, create the path
     60 if not os.path.isdir(PLOT_OUTPUT_DIR):

File ~/ccvm/ccvm/ccvm/ccvmplotlib/ccvmplotlib.py:154, in ccvmplotlib.plot_TTS(solution_filepath, problem, TTS_type, **kwargs)
    152 plt.xticks(fontsize=fonts["xticks"])
    153 plt.yticks(fontsize=fonts["yticks"])
--> 154 plt.tight_layout()
    156 if "show_plot" in kwargs and kwargs["show_plot"]:
    157     plt.show()

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/pyplot.py:2285, in tight_layout(pad, h_pad, w_pad, rect)
   2283 @_copy_docstring_and_deprecators(Figure.tight_layout)
   2284 def tight_layout(*, pad=1.08, h_pad=None, w_pad=None, rect=None):
-> 2285     return gcf().tight_layout(pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/figure.py:3450, in Figure.tight_layout(self, pad, h_pad, w_pad, rect)
   3448 try:
   3449     self.set_layout_engine(engine)
-> 3450     engine.execute(self)
   3451 finally:
   3452     self.set_layout_engine(None)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/layout_engine.py:175, in TightLayoutEngine.execute(self, fig)
    173 renderer = fig._get_renderer()
    174 with getattr(renderer, "_draw_disabled", nullcontext)():
--> 175     kwargs = get_tight_layout_figure(
    176         fig, fig.axes, get_subplotspec_list(fig.axes), renderer,
    177         pad=info['pad'], h_pad=info['h_pad'], w_pad=info['w_pad'],
    178         rect=info['rect'])
    179 if kwargs:
    180     fig.subplots_adjust(**kwargs)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/_tight_layout.py:308, in get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer, pad, h_pad, w_pad, rect)
    303         return {}
    304     span_pairs.append((
    305         slice(ss.rowspan.start * div_row, ss.rowspan.stop * div_row),
    306         slice(ss.colspan.start * div_col, ss.colspan.stop * div_col)))
--> 308 kwargs = _auto_adjust_subplotpars(fig, renderer,
    309                                   shape=(max_nrows, max_ncols),
    310                                   span_pairs=span_pairs,
    311                                   subplot_list=subplot_list,
    312                                   ax_bbox_list=ax_bbox_list,
    313                                   pad=pad, h_pad=h_pad, w_pad=w_pad)
    315 # kwargs can be none if tight_layout fails...
    316 if rect is not None and kwargs is not None:
    317     # if rect is given, the whole subplots area (including
    318     # labels) will fit into the rect instead of the
   (...)
    322     # auto_adjust_subplotpars twice, where the second run
    323     # with adjusted rect parameters.

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/_tight_layout.py:82, in _auto_adjust_subplotpars(fig, renderer, shape, span_pairs, subplot_list, ax_bbox_list, pad, h_pad, w_pad, rect)
     80 for ax in subplots:
     81     if ax.get_visible():
---> 82         bb += [martist._get_tightbbox_for_layout_only(ax, renderer)]
     84 tight_bbox_raw = Bbox.union(bb)
     85 tight_bbox = fig.transFigure.inverted().transform_bbox(tight_bbox_raw)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:1378, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
   1372 """
   1373 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
   1374 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
   1375 when encountering third-party subclasses that do not support it.
   1376 """
   1377 try:
-> 1378     return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
   1379 except TypeError:
   1380     return obj.get_tightbbox(*args, **kwargs)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axes/_base.py:4421, in _AxesBase.get_tightbbox(self, renderer, call_axes_locator, bbox_extra_artists, for_layout_only)
   4419 for axis in self._axis_map.values():
   4420     if self.axison and axis.get_visible():
-> 4421         ba = martist._get_tightbbox_for_layout_only(axis, renderer)
   4422         if ba:
   4423             bb.append(ba)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:1378, in _get_tightbbox_for_layout_only(obj, *args, **kwargs)
   1372 """
   1373 Matplotlib's `.Axes.get_tightbbox` and `.Axis.get_tightbbox` support a
   1374 *for_layout_only* kwarg; this helper tries to use the kwarg but skips it
   1375 when encountering third-party subclasses that do not support it.
   1376 """
   1377 try:
-> 1378     return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
   1379 except TypeError:
   1380     return obj.get_tightbbox(*args, **kwargs)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1253, in Axis.get_tightbbox(self, renderer, for_layout_only)
   1250     renderer = self.figure._get_renderer()
   1251 ticks_to_draw = self._update_ticks()
-> 1253 self._update_label_position(renderer)
   1255 # go back to just this axis's tick labels
   1256 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:2252, in XAxis._update_label_position(self, renderer)
   2248     return
   2250 # get bounding boxes for this axis and any siblings
   2251 # that have been set by `fig.align_xlabels()`
-> 2252 bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
   2254 x, y = self.label.get_position()
   2255 if self.label_position == 'bottom':

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:2056, in Axis._get_tick_boxes_siblings(self, renderer)
   2054 axis = getattr(ax, f"{axis_name}axis")
   2055 ticks_to_draw = axis._update_ticks()
-> 2056 tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
   2057 bboxes.extend(tlb)
   2058 bboxes2.extend(tlb2)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1232, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
   1230 if renderer is None:
   1231     renderer = self.figure._get_renderer()
-> 1232 return ([tick.label1.get_window_extent(renderer)
   1233          for tick in ticks if tick.label1.get_visible()],
   1234         [tick.label2.get_window_extent(renderer)
   1235          for tick in ticks if tick.label2.get_visible()])

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1232, in <listcomp>(.0)
   1230 if renderer is None:
   1231     renderer = self.figure._get_renderer()
-> 1232 return ([tick.label1.get_window_extent(renderer)
   1233          for tick in ticks if tick.label1.get_visible()],
   1234         [tick.label2.get_window_extent(renderer)
   1235          for tick in ticks if tick.label2.get_visible()])

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:915, in Text.get_window_extent(self, renderer, dpi)
    910     raise RuntimeError(
    911         "Cannot get window extent of text w/o renderer. You likely "
    912         "want to call 'figure.draw_without_rendering()' first.")
    914 with cbook._setattr_cm(self.figure, dpi=dpi):
--> 915     bbox, info, descent = self._get_layout(self._renderer)
    916     x, y = self.get_unitless_position()
    917     x, y = self.get_transform().transform((x, y))

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:313, in Text._get_layout(self, renderer)
    310 ys = []
    312 # Full vertical extent of font, including ascenders and descenders:
--> 313 _, lp_h, lp_d = _get_text_metrics_with_cache(
    314     renderer, "lp", self._fontproperties,
    315     ismath="TeX" if self.get_usetex() else False, dpi=self.figure.dpi)
    316 min_dy = (lp_h - lp_d) * self._linespacing
    318 for i, line in enumerate(lines):

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:97, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
     94 """Call ``renderer.get_text_width_height_descent``, caching the results."""
     95 # Cached based on a copy of fontprop so that later in-place mutations of
     96 # the passed-in argument do not mess up the cache.
---> 97 return _get_text_metrics_with_cache_impl(
     98     weakref.ref(renderer), text, fontprop.copy(), ismath, dpi)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:105, in _get_text_metrics_with_cache_impl(renderer_ref, text, fontprop, ismath, dpi)
    101 @functools.lru_cache(4096)
    102 def _get_text_metrics_with_cache_impl(
    103         renderer_ref, text, fontprop, ismath, dpi):
    104     # dpi is unused, but participates in cache invalidation (via the renderer).
--> 105     return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py:229, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
    227     texmanager = self.get_texmanager()
    228     fontsize = prop.get_size_in_points()
--> 229     w, h, d = texmanager.get_text_width_height_descent(
    230         s, fontsize, renderer=self)
    231     return w, h, d
    233 if ismath:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:362, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
    360 if tex.strip() == '':
    361     return 0, 0, 0
--> 362 dvifile = cls.make_dvi(tex, fontsize)
    363 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
    364 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:295, in TexManager.make_dvi(cls, tex, fontsize)
    286     # Generate the dvi in a temporary directory to avoid race
    287     # conditions e.g. if multiple processes try to process the same tex
    288     # string at the same time.  Having tmpdir be a subdirectory of the
   (...)
    292     # the absolute path may contain characters (e.g. ~) that TeX does
    293     # not support.)
    294     with TemporaryDirectory(dir=Path(dvifile).parent) as tmpdir:
--> 295         cls._run_checked_subprocess(
    296             ["latex", "-interaction=nonstopmode", "--halt-on-error",
    297              f"../{texfile.name}"], tex, cwd=tmpdir)
    298         (Path(tmpdir) / Path(dvifile).name).replace(dvifile)
    299 return dvifile

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:261, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
    257     raise RuntimeError(
    258         'Failed to process string with tex because {} could not be '
    259         'found'.format(command[0])) from exc
    260 except subprocess.CalledProcessError as exc:
--> 261     raise RuntimeError(
    262         '{prog} was not able to process the following string:\n'
    263         '{tex!r}\n\n'
    264         'Here is the full command invocation and its output:\n\n'
    265         '{format_command}\n\n'
    266         '{exc}\n\n'.format(
    267             prog=command[0],
    268             format_command=cbook._pformat_subprocess(command),
    269             tex=tex.encode('unicode_escape'),
    270             exc=exc.output.decode('utf-8', 'backslashreplace'))
    271         ) from None
    272 _log.debug(report)
    273 return report

RuntimeError: latex was not able to process the following string:
b'lp'

Here is the full command invocation and its output:

latex -interaction=nonstopmode --halt-on-error ../e21e9c9d5ad796bad99def6a92952b7d.tex

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(../e21e9c9d5ad796bad99def6a92952b7d.tex
LaTeX2e <2018-12-01>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/type1cm/type1cm.sty)

! LaTeX Error: File `type1ec.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.8 \usepackage
               [utf8]{inputenc}^^M
No pages of output.
Transcript written on e21e9c9d5ad796bad99def6a92952b7d.log.

Error in callback <function _draw_all_if_interactive at 0x7fa9d591f130> (for post_execute):
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/pyplot.py:119, in _draw_all_if_interactive()
    117 def _draw_all_if_interactive():
    118     if matplotlib.is_interactive():
--> 119         draw_all()

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/_pylab_helpers.py:132, in Gcf.draw_all(cls, force)
    130 for manager in cls.get_all_fig_managers():
    131     if force or manager.canvas.figure.stale:
--> 132         manager.canvas.draw_idle()

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/backend_bases.py:2054, in FigureCanvasBase.draw_idle(self, *args, **kwargs)
   2052 if not self._is_idle_drawing:
   2053     with self._idle_draw_cntx():
-> 2054         self.draw(*args, **kwargs)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py:405, in FigureCanvasAgg.draw(self)
    401 # Acquire a lock on the shared font cache.
    402 with RendererAgg.lock, \
    403      (self.toolbar._wait_cursor_for_draw_cm() if self.toolbar
    404       else nullcontext()):
--> 405     self.figure.draw(self.renderer)
    406     # A GUI class may be need to update a window using this draw, so
    407     # don't forget to call the superclass.
    408     super().draw()

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:74, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
     72 @wraps(draw)
     73 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 74     result = draw(artist, renderer, *args, **kwargs)
     75     if renderer._rasterizing:
     76         renderer.stop_rasterizing()

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:51, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     48     if artist.get_agg_filter() is not None:
     49         renderer.start_filter()
---> 51     return draw(artist, renderer)
     52 finally:
     53     if artist.get_agg_filter() is not None:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/figure.py:3082, in Figure.draw(self, renderer)
   3079         # ValueError can occur when resizing a window.
   3081 self.patch.draw(renderer)
-> 3082 mimage._draw_list_compositing_images(
   3083     renderer, self, artists, self.suppressComposite)
   3085 for sfig in self.subfigs:
   3086     sfig.draw(renderer)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/image.py:131, in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    129 if not_composite or not has_images:
    130     for a in artists:
--> 131         a.draw(renderer)
    132 else:
    133     # Composite any adjacent images together
    134     image_group = []

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:51, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     48     if artist.get_agg_filter() is not None:
     49         renderer.start_filter()
---> 51     return draw(artist, renderer)
     52 finally:
     53     if artist.get_agg_filter() is not None:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axes/_base.py:3100, in _AxesBase.draw(self, renderer)
   3097         a.draw(renderer)
   3098     renderer.stop_rasterizing()
-> 3100 mimage._draw_list_compositing_images(
   3101     renderer, self, artists, self.figure.suppressComposite)
   3103 renderer.close_group('axes')
   3104 self.stale = False

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/image.py:131, in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    129 if not_composite or not has_images:
    130     for a in artists:
--> 131         a.draw(renderer)
    132 else:
    133     # Composite any adjacent images together
    134     image_group = []

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:51, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     48     if artist.get_agg_filter() is not None:
     49         renderer.start_filter()
---> 51     return draw(artist, renderer)
     52 finally:
     53     if artist.get_agg_filter() is not None:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1305, in Axis.draw(self, renderer, *args, **kwargs)
   1302 renderer.open_group(__name__, gid=self.get_gid())
   1304 ticks_to_draw = self._update_ticks()
-> 1305 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
   1307 for tick in ticks_to_draw:
   1308     tick.draw(renderer)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1232, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
   1230 if renderer is None:
   1231     renderer = self.figure._get_renderer()
-> 1232 return ([tick.label1.get_window_extent(renderer)
   1233          for tick in ticks if tick.label1.get_visible()],
   1234         [tick.label2.get_window_extent(renderer)
   1235          for tick in ticks if tick.label2.get_visible()])

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1232, in <listcomp>(.0)
   1230 if renderer is None:
   1231     renderer = self.figure._get_renderer()
-> 1232 return ([tick.label1.get_window_extent(renderer)
   1233          for tick in ticks if tick.label1.get_visible()],
   1234         [tick.label2.get_window_extent(renderer)
   1235          for tick in ticks if tick.label2.get_visible()])

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:915, in Text.get_window_extent(self, renderer, dpi)
    910     raise RuntimeError(
    911         "Cannot get window extent of text w/o renderer. You likely "
    912         "want to call 'figure.draw_without_rendering()' first.")
    914 with cbook._setattr_cm(self.figure, dpi=dpi):
--> 915     bbox, info, descent = self._get_layout(self._renderer)
    916     x, y = self.get_unitless_position()
    917     x, y = self.get_transform().transform((x, y))

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:313, in Text._get_layout(self, renderer)
    310 ys = []
    312 # Full vertical extent of font, including ascenders and descenders:
--> 313 _, lp_h, lp_d = _get_text_metrics_with_cache(
    314     renderer, "lp", self._fontproperties,
    315     ismath="TeX" if self.get_usetex() else False, dpi=self.figure.dpi)
    316 min_dy = (lp_h - lp_d) * self._linespacing
    318 for i, line in enumerate(lines):

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:97, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
     94 """Call ``renderer.get_text_width_height_descent``, caching the results."""
     95 # Cached based on a copy of fontprop so that later in-place mutations of
     96 # the passed-in argument do not mess up the cache.
---> 97 return _get_text_metrics_with_cache_impl(
     98     weakref.ref(renderer), text, fontprop.copy(), ismath, dpi)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:105, in _get_text_metrics_with_cache_impl(renderer_ref, text, fontprop, ismath, dpi)
    101 @functools.lru_cache(4096)
    102 def _get_text_metrics_with_cache_impl(
    103         renderer_ref, text, fontprop, ismath, dpi):
    104     # dpi is unused, but participates in cache invalidation (via the renderer).
--> 105     return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py:229, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
    227     texmanager = self.get_texmanager()
    228     fontsize = prop.get_size_in_points()
--> 229     w, h, d = texmanager.get_text_width_height_descent(
    230         s, fontsize, renderer=self)
    231     return w, h, d
    233 if ismath:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:362, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
    360 if tex.strip() == '':
    361     return 0, 0, 0
--> 362 dvifile = cls.make_dvi(tex, fontsize)
    363 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
    364 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:295, in TexManager.make_dvi(cls, tex, fontsize)
    286     # Generate the dvi in a temporary directory to avoid race
    287     # conditions e.g. if multiple processes try to process the same tex
    288     # string at the same time.  Having tmpdir be a subdirectory of the
   (...)
    292     # the absolute path may contain characters (e.g. ~) that TeX does
    293     # not support.)
    294     with TemporaryDirectory(dir=Path(dvifile).parent) as tmpdir:
--> 295         cls._run_checked_subprocess(
    296             ["latex", "-interaction=nonstopmode", "--halt-on-error",
    297              f"../{texfile.name}"], tex, cwd=tmpdir)
    298         (Path(tmpdir) / Path(dvifile).name).replace(dvifile)
    299 return dvifile

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:261, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
    257     raise RuntimeError(
    258         'Failed to process string with tex because {} could not be '
    259         'found'.format(command[0])) from exc
    260 except subprocess.CalledProcessError as exc:
--> 261     raise RuntimeError(
    262         '{prog} was not able to process the following string:\n'
    263         '{tex!r}\n\n'
    264         'Here is the full command invocation and its output:\n\n'
    265         '{format_command}\n\n'
    266         '{exc}\n\n'.format(
    267             prog=command[0],
    268             format_command=cbook._pformat_subprocess(command),
    269             tex=tex.encode('unicode_escape'),
    270             exc=exc.output.decode('utf-8', 'backslashreplace'))
    271         ) from None
    272 _log.debug(report)
    273 return report

RuntimeError: latex was not able to process the following string:
b'lp'

Here is the full command invocation and its output:

latex -interaction=nonstopmode --halt-on-error ../e21e9c9d5ad796bad99def6a92952b7d.tex

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(../e21e9c9d5ad796bad99def6a92952b7d.tex
LaTeX2e <2018-12-01>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/type1cm/type1cm.sty)

! LaTeX Error: File `type1ec.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.8 \usepackage
               [utf8]{inputenc}^^M
No pages of output.
Transcript written on e21e9c9d5ad796bad99def6a92952b7d.log.

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
File /opt/conda/envs/ccvm/lib/python3.10/site-packages/IPython/core/formatters.py:338, in BaseFormatter.__call__(self, obj)
    336     pass
    337 else:
--> 338     return printer(obj)
    339 # Finally look for special method names
    340 method = get_real_method(obj, self.print_method)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/IPython/core/pylabtools.py:152, in print_figure(fig, fmt, bbox_inches, base64, **kwargs)
    149     from matplotlib.backend_bases import FigureCanvasBase
    150     FigureCanvasBase(fig)
--> 152 fig.canvas.print_figure(bytes_io, **kw)
    153 data = bytes_io.getvalue()
    154 if fmt == 'svg':

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/backend_bases.py:2314, in FigureCanvasBase.print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, bbox_inches, pad_inches, bbox_extra_artists, backend, **kwargs)
   2308     renderer = _get_renderer(
   2309         self.figure,
   2310         functools.partial(
   2311             print_method, orientation=orientation)
   2312     )
   2313     with getattr(renderer, "_draw_disabled", nullcontext)():
-> 2314         self.figure.draw(renderer)
   2316 if bbox_inches:
   2317     if bbox_inches == "tight":

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:74, in _finalize_rasterization.<locals>.draw_wrapper(artist, renderer, *args, **kwargs)
     72 @wraps(draw)
     73 def draw_wrapper(artist, renderer, *args, **kwargs):
---> 74     result = draw(artist, renderer, *args, **kwargs)
     75     if renderer._rasterizing:
     76         renderer.stop_rasterizing()

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:51, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     48     if artist.get_agg_filter() is not None:
     49         renderer.start_filter()
---> 51     return draw(artist, renderer)
     52 finally:
     53     if artist.get_agg_filter() is not None:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/figure.py:3082, in Figure.draw(self, renderer)
   3079         # ValueError can occur when resizing a window.
   3081 self.patch.draw(renderer)
-> 3082 mimage._draw_list_compositing_images(
   3083     renderer, self, artists, self.suppressComposite)
   3085 for sfig in self.subfigs:
   3086     sfig.draw(renderer)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/image.py:131, in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    129 if not_composite or not has_images:
    130     for a in artists:
--> 131         a.draw(renderer)
    132 else:
    133     # Composite any adjacent images together
    134     image_group = []

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:51, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     48     if artist.get_agg_filter() is not None:
     49         renderer.start_filter()
---> 51     return draw(artist, renderer)
     52 finally:
     53     if artist.get_agg_filter() is not None:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axes/_base.py:3100, in _AxesBase.draw(self, renderer)
   3097         a.draw(renderer)
   3098     renderer.stop_rasterizing()
-> 3100 mimage._draw_list_compositing_images(
   3101     renderer, self, artists, self.figure.suppressComposite)
   3103 renderer.close_group('axes')
   3104 self.stale = False

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/image.py:131, in _draw_list_compositing_images(renderer, parent, artists, suppress_composite)
    129 if not_composite or not has_images:
    130     for a in artists:
--> 131         a.draw(renderer)
    132 else:
    133     # Composite any adjacent images together
    134     image_group = []

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/artist.py:51, in allow_rasterization.<locals>.draw_wrapper(artist, renderer)
     48     if artist.get_agg_filter() is not None:
     49         renderer.start_filter()
---> 51     return draw(artist, renderer)
     52 finally:
     53     if artist.get_agg_filter() is not None:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1305, in Axis.draw(self, renderer, *args, **kwargs)
   1302 renderer.open_group(__name__, gid=self.get_gid())
   1304 ticks_to_draw = self._update_ticks()
-> 1305 tlb1, tlb2 = self._get_ticklabel_bboxes(ticks_to_draw, renderer)
   1307 for tick in ticks_to_draw:
   1308     tick.draw(renderer)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1232, in Axis._get_ticklabel_bboxes(self, ticks, renderer)
   1230 if renderer is None:
   1231     renderer = self.figure._get_renderer()
-> 1232 return ([tick.label1.get_window_extent(renderer)
   1233          for tick in ticks if tick.label1.get_visible()],
   1234         [tick.label2.get_window_extent(renderer)
   1235          for tick in ticks if tick.label2.get_visible()])

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/axis.py:1232, in <listcomp>(.0)
   1230 if renderer is None:
   1231     renderer = self.figure._get_renderer()
-> 1232 return ([tick.label1.get_window_extent(renderer)
   1233          for tick in ticks if tick.label1.get_visible()],
   1234         [tick.label2.get_window_extent(renderer)
   1235          for tick in ticks if tick.label2.get_visible()])

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:915, in Text.get_window_extent(self, renderer, dpi)
    910     raise RuntimeError(
    911         "Cannot get window extent of text w/o renderer. You likely "
    912         "want to call 'figure.draw_without_rendering()' first.")
    914 with cbook._setattr_cm(self.figure, dpi=dpi):
--> 915     bbox, info, descent = self._get_layout(self._renderer)
    916     x, y = self.get_unitless_position()
    917     x, y = self.get_transform().transform((x, y))

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:313, in Text._get_layout(self, renderer)
    310 ys = []
    312 # Full vertical extent of font, including ascenders and descenders:
--> 313 _, lp_h, lp_d = _get_text_metrics_with_cache(
    314     renderer, "lp", self._fontproperties,
    315     ismath="TeX" if self.get_usetex() else False, dpi=self.figure.dpi)
    316 min_dy = (lp_h - lp_d) * self._linespacing
    318 for i, line in enumerate(lines):

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:97, in _get_text_metrics_with_cache(renderer, text, fontprop, ismath, dpi)
     94 """Call ``renderer.get_text_width_height_descent``, caching the results."""
     95 # Cached based on a copy of fontprop so that later in-place mutations of
     96 # the passed-in argument do not mess up the cache.
---> 97 return _get_text_metrics_with_cache_impl(
     98     weakref.ref(renderer), text, fontprop.copy(), ismath, dpi)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/text.py:105, in _get_text_metrics_with_cache_impl(renderer_ref, text, fontprop, ismath, dpi)
    101 @functools.lru_cache(4096)
    102 def _get_text_metrics_with_cache_impl(
    103         renderer_ref, text, fontprop, ismath, dpi):
    104     # dpi is unused, but participates in cache invalidation (via the renderer).
--> 105     return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/backends/backend_agg.py:229, in RendererAgg.get_text_width_height_descent(self, s, prop, ismath)
    227     texmanager = self.get_texmanager()
    228     fontsize = prop.get_size_in_points()
--> 229     w, h, d = texmanager.get_text_width_height_descent(
    230         s, fontsize, renderer=self)
    231     return w, h, d
    233 if ismath:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:362, in TexManager.get_text_width_height_descent(cls, tex, fontsize, renderer)
    360 if tex.strip() == '':
    361     return 0, 0, 0
--> 362 dvifile = cls.make_dvi(tex, fontsize)
    363 dpi_fraction = renderer.points_to_pixels(1.) if renderer else 1
    364 with dviread.Dvi(dvifile, 72 * dpi_fraction) as dvi:

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:295, in TexManager.make_dvi(cls, tex, fontsize)
    286     # Generate the dvi in a temporary directory to avoid race
    287     # conditions e.g. if multiple processes try to process the same tex
    288     # string at the same time.  Having tmpdir be a subdirectory of the
   (...)
    292     # the absolute path may contain characters (e.g. ~) that TeX does
    293     # not support.)
    294     with TemporaryDirectory(dir=Path(dvifile).parent) as tmpdir:
--> 295         cls._run_checked_subprocess(
    296             ["latex", "-interaction=nonstopmode", "--halt-on-error",
    297              f"../{texfile.name}"], tex, cwd=tmpdir)
    298         (Path(tmpdir) / Path(dvifile).name).replace(dvifile)
    299 return dvifile

File /opt/conda/envs/ccvm/lib/python3.10/site-packages/matplotlib/texmanager.py:261, in TexManager._run_checked_subprocess(cls, command, tex, cwd)
    257     raise RuntimeError(
    258         'Failed to process string with tex because {} could not be '
    259         'found'.format(command[0])) from exc
    260 except subprocess.CalledProcessError as exc:
--> 261     raise RuntimeError(
    262         '{prog} was not able to process the following string:\n'
    263         '{tex!r}\n\n'
    264         'Here is the full command invocation and its output:\n\n'
    265         '{format_command}\n\n'
    266         '{exc}\n\n'.format(
    267             prog=command[0],
    268             format_command=cbook._pformat_subprocess(command),
    269             tex=tex.encode('unicode_escape'),
    270             exc=exc.output.decode('utf-8', 'backslashreplace'))
    271         ) from None
    272 _log.debug(report)
    273 return report

RuntimeError: latex was not able to process the following string:
b'lp'

Here is the full command invocation and its output:

latex -interaction=nonstopmode --halt-on-error ../e21e9c9d5ad796bad99def6a92952b7d.tex

This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2019/dev/Debian) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
(../e21e9c9d5ad796bad99def6a92952b7d.tex
LaTeX2e <2018-12-01>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/type1cm/type1cm.sty)

! LaTeX Error: File `type1ec.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.8 \usepackage
               [utf8]{inputenc}^^M
No pages of output.
Transcript written on e21e9c9d5ad796bad99def6a92952b7d.log.

<Figure size 770x700 with 1 Axes>
KyleM4t1qbit commented 1 year ago

Solution is to install cm-super system-wide:

sudo apt-get install cm-super

Or to switch to sans-serif fonts:

e.g.

plt.rc("font", family="sans-serif")

(in ccvm/ccvmplotlib/ccvmplotlib.py)