Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turn off plotting test #995

Merged
merged 1 commit into from
Sep 20, 2023
Merged

Turn off plotting test #995

merged 1 commit into from
Sep 20, 2023

Conversation

avivajpeyi
Copy link
Collaborator

@avivajpeyi avivajpeyi commented Sep 20, 2023

There is still some irritating latex error, causing the CI to fail.

This turns the plotting test off until we can determine a long-term solution (#989)

=========================== short test summary info ============================
FAILED py_tests/test_plot_detailed_evolution.py::test_plotter - RuntimeError: Failed to process string with tex because latex could not be found
= 1 failed, 16 passed, 1 skipped, 1 deselected, 11 warnings in 80.17s (0:01:20) =
Full traceback

_________________________________ test_plotter _________________________________

cls = <class 'matplotlib.texmanager.TexManager'>
command = ['latex', '-interaction=nonstopmode', '--halt-on-error', '--output-directory=tmpluf4flq2', '574b56a74699b34bb0ed5083ffe19a26.tex']
tex = 'lp'

    @classmethod
    def _run_checked_subprocess(cls, command, tex, *, cwd=None):
        _log.debug(cbook._pformat_subprocess(command))
        try:
>           report = subprocess.check_output(
                command, cwd=cwd if cwd is not None else cls._texcache,
                stderr=subprocess.STDOUT)

/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/texmanager.py:250: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/subprocess.py:424: in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/subprocess.py:505: in run
    with Popen(*popenargs, **kwargs) as process:
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/subprocess.py:951: in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <Popen: returncode: 255 args: ['latex', '-interaction=nonstopmode', '--halt-...>
args = ['latex', '-interaction=nonstopmode', '--halt-on-error', '--output-directory=tmpluf4flq2', '574b56a74699b34bb0ed5083ffe19a26.tex']
executable = b'latex', preexec_fn = None, close_fds = True, pass_fds = ()
cwd = PosixPath('/home/runner/.cache/matplotlib/tex.cache/57/4b'), env = None
startupinfo = None, creationflags = 0, shell = False, p2cread = -1
p2cwrite = -1, c2pread = 16, c2pwrite = 17, errread = -1, errwrite = 17
restore_signals = True, gid = None, gids = None, uid = None, umask = -1
start_new_session = False

    def _execute_child(self, args, executable, preexec_fn, close_fds,
                       pass_fds, cwd, env,
                       startupinfo, creationflags, shell,
                       p2cread, p2cwrite,
                       c2pread, c2pwrite,
                       errread, errwrite,
                       restore_signals,
                       gid, gids, uid, umask,
                       start_new_session):
        """Execute program (POSIX version)"""
    
        if isinstance(args, (str, bytes)):
            args = [args]
        elif isinstance(args, os.PathLike):
            if shell:
                raise TypeError('path-like args is not allowed when '
                                'shell is true')
            args = [args]
        else:
            args = list(args)
    
        if shell:
            # On Android the default shell is at '/system/bin/sh'.
            unix_shell = ('/system/bin/sh' if
                      hasattr(sys, 'getandroidapilevel') else '/bin/sh')
            args = [unix_shell, "-c"] + args
            if executable:
                args[0] = executable
    
        if executable is None:
                    self.returncode = sys.maxsize
            except ChildProcessError:
                pass
    
            try:
                exception_name, hex_errno, err_msg = (
                        errpipe_data.split(b':', 2))
                # The encoding here should match the encoding
                # written in by the subprocess implementations
                # like _posixsubprocess
                err_msg = err_msg.decode()
            except ValueError:
                exception_name = b'SubprocessError'
                hex_errno = b'0'
                err_msg = 'Bad exception data from child: {!r}'.format(
                              bytes(errpipe_data))
            child_exception_type = getattr(
                    builtins, exception_name.decode('ascii'),
                    SubprocessError)
            if issubclass(child_exception_type, OSError) and hex_errno:
                errno_num = int(hex_errno, 16)
                child_exec_never_called = (err_msg == "noexec")
                if child_exec_never_called:
                    err_msg = ""
                    # The error must be from chdir(cwd).
                    err_filename = cwd
                else:
                    err_filename = orig_executable
                if errno_num != 0:
                    err_msg = os.strerror(errno_num)
>               raise child_exception_type(errno_num, err_msg, err_filename)
E               FileNotFoundError: [Errno 2] No such file or directory: 'latex'

/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/subprocess.py:1837: FileNotFoundError

The above exception was the direct cause of the following exception:

example_compas_output_path = '/home/runner/work/COMPAS/COMPAS/py_tests/../misc/examples/methods_paper_plots/detailed_evolution/COMPAS_Output/COMPAS_Output.h5'
capsys = <_pytest.capture.CaptureFixture object at 0x7f9109b0ca60>
test_archive_dir = '/home/runner/work/COMPAS/COMPAS/py_tests/test_artifacts'

    def test_plotter(example_compas_output_path, capsys, test_archive_dir):
        data_path = example_compas_output_path
        bse_detailed_out_path = os.path.join(
            os.path.dirname(data_path), "Detailed_Output/BSE_Detailed_Output_0.h5"
        )
        t0 = time.time()
>       plot_detailed_evolution.run_main_plotter(
            bse_detailed_out_path, outdir=test_archive_dir, show=False
        )

py_tests/test_plot_detailed_evolution.py:13: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
compas_python_utils/detailed_evolution_plotter/plot_detailed_evolution.py:40: in run_main_plotter
    makeDetailedPlots(Data, events, outdir=outdir)
compas_python_utils/detailed_evolution_plotter/plot_detailed_evolution.py:118: in makeDetailedPlots
    fig.tight_layout(h_pad=1, w_pad=1, rect=(0.08, 0.08, .98, .98), pad=0.)  # (left, bottom, right, top)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/figure.py:3540: in tight_layout
    engine.execute(self)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/layout_engine.py:183: in execute
    kwargs = get_tight_layout_figure(
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/_tight_layout.py:266: in get_tight_layout_figure
    kwargs = _auto_adjust_subplotpars(fig, renderer,
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/_tight_layout.py:82: in _auto_adjust_subplotpars
    bb += [martist._get_tightbbox_for_layout_only(ax, renderer)]
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/artist.py:1411: in _get_tightbbox_for_layout_only
    return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/_api/deprecation.py:454: in wrapper
    return func(*args, **kwargs)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/axes/_base.py:4[39](https://github.com/TeamCOMPAS/COMPAS/actions/runs/6216632980/job/16870706606#step:7:40)5: in get_tightbbox
    ba = martist._get_tightbbox_for_layout_only(axis, renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/artist.py:1411: in _get_tightbbox_for_layout_only
    return obj.get_tightbbox(*args, **{**kwargs, "for_layout_only": True})
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/axis.py:1336: in get_tightbbox
    self._update_label_position(renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/axis.py:2368: in _update_label_position
    bboxes, bboxes2 = self._get_tick_boxes_siblings(renderer=renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/axis.py:2161: in _get_tick_boxes_siblings
    tlb, tlb2 = axis._get_ticklabel_bboxes(ticks_to_draw, renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/axis.py:1315: in _get_ticklabel_bboxes
    return ([tick.label1.get_window_extent(renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/axis.py:1315: in <listcomp>
    return ([tick.label1.get_window_extent(renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/text.py:956: in get_window_extent
    bbox, info, descent = self._get_layout(self._renderer)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/text.py:373: in _get_layout
    _, lp_h, lp_d = _get_text_metrics_with_cache(
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/text.py:69: in _get_text_metrics_with_cache
    return _get_text_metrics_with_cache_impl(
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/text.py:77: in _get_text_metrics_with_cache_impl
    return renderer_ref().get_text_width_height_descent(text, fontprop, ismath)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/backends/backend_agg.py:213: in get_text_width_height_descent
    return super().get_text_width_height_descent(s, prop, ismath)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/backend_bases.py:652: in get_text_width_height_descent
    return self.get_texmanager().get_text_width_height_descent(
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/texmanager.py:363: in get_text_width_height_descent
    dvifile = cls.make_dvi(tex, fontsize)
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/texmanager.py:295: in make_dvi
    cls._run_checked_subprocess(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

cls = <class 'matplotlib.texmanager.TexManager'>
command = ['latex', '-interaction=nonstopmode', '--halt-on-error', '--output-directory=tmpluf4flq2', '574b56a74699b34bb0ed5083ffe19a26.tex']
tex = 'lp'

    @classmethod
    def _run_checked_subprocess(cls, command, tex, *, cwd=None):
        _log.debug(cbook._pformat_subprocess(command))
        try:
            report = subprocess.check_output(
                command, cwd=cwd if cwd is not None else cls._texcache,
                stderr=subprocess.STDOUT)
        except FileNotFoundError as exc:
>           raise RuntimeError(
                f'Failed to process string with tex because {command[0]} '
                'could not be found') from exc
E           RuntimeError: Failed to process string with tex because latex could not be found

/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/matplotlib/texmanager.py:2[54](https://github.com/TeamCOMPAS/COMPAS/actions/runs/6216632980/job/16870706606#step:7:55): RuntimeError

Copy link
Collaborator

@jeffriley jeffriley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me - thanks Avi.

@jeffriley jeffriley merged commit 7d1a6ce into dev Sep 20, 2023
@jeffriley jeffriley deleted the turn_off_plotting_test branch September 20, 2023 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants