From 3ecb1a865f21bef2313d7e5b13effa38938e6469 Mon Sep 17 00:00:00 2001 From: avi Date: Tue, 9 Apr 2024 13:21:48 +1200 Subject: [PATCH 1/2] add check for latex before setting rcParams --- .../detailed_evolution_plotter/plot_detailed_evolution.py | 3 ++- py_tests/test_plot_detailed_evolution.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compas_python_utils/detailed_evolution_plotter/plot_detailed_evolution.py b/compas_python_utils/detailed_evolution_plotter/plot_detailed_evolution.py index a197f8aa1..963ccd5c5 100644 --- a/compas_python_utils/detailed_evolution_plotter/plot_detailed_evolution.py +++ b/compas_python_utils/detailed_evolution_plotter/plot_detailed_evolution.py @@ -5,6 +5,7 @@ ################################################################### import os, sys +import shutil import numpy as np import h5py as h5 import matplotlib.pyplot as plt @@ -45,7 +46,7 @@ def run_main_plotter(data_path, outdir='.', show=True): fontparams = { "font.serif": "Times New Roman", - "text.usetex": "True", + "text.usetex": str(shutil.which("latex") is not None), "axes.grid": "True", "grid.color": "gray", "grid.linestyle": ":", diff --git a/py_tests/test_plot_detailed_evolution.py b/py_tests/test_plot_detailed_evolution.py index c6ebee8d5..a287cde91 100644 --- a/py_tests/test_plot_detailed_evolution.py +++ b/py_tests/test_plot_detailed_evolution.py @@ -5,7 +5,6 @@ from compas_python_utils.detailed_evolution_plotter import plot_detailed_evolution -@pytest.mark.skip(reason="RuntimeError: Failed to process string with tex because latex could not be found") def test_plotter(example_compas_output_path, capsys, test_archive_dir): data_path = example_compas_output_path bse_detailed_out_path = os.path.join( From ce1597e45fdff078e499f79a851169c75e30561e Mon Sep 17 00:00:00 2001 From: avi Date: Tue, 9 Apr 2024 13:30:27 +1200 Subject: [PATCH 2/2] add texlive --- .github/workflows/compas-compile-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/compas-compile-ci.yml b/.github/workflows/compas-compile-ci.yml index ca073754d..36bdf235b 100644 --- a/.github/workflows/compas-compile-ci.yml +++ b/.github/workflows/compas-compile-ci.yml @@ -26,6 +26,10 @@ jobs: python-version: '3.9' cache: 'pip' # caching pip dependencies + - name: Install TeXLive + uses: teatimeguest/setup-texlive-action@v3 + + - name: Install dependencies on ubuntu if: startsWith(matrix.os, 'ubuntu-20') run: |