diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 514f051a6..702a7ec89 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -1,6 +1,5 @@ # This workflow will install Python dependencies, run tests the specified Python version # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - name: Python 3.12 tests on: @@ -11,6 +10,7 @@ on: - feature_* - main_* - bugfix_* + - test_* paths-ignore: - 'docs/**' - '.github/pull_request_template.md' @@ -21,6 +21,8 @@ on: pull_request: types: [opened, reopened, synchronize] + + jobs: build: @@ -49,8 +51,17 @@ jobs: run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install --upgrade kaleido - + +# - uses: browser-actions/setup-chrome@v1 +# - name: Install Google Chrome for Plotly +# run: | +# chrome --version +# ${{ steps.setup-chrome.outputs.chrome-path }} + + + # Checking the branch name, not necessary but useful when setting things up. # - name: Extract branch name # shell: bash diff --git a/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py b/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py index 753c2c060..bf29db1d3 100644 --- a/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py +++ b/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py @@ -109,8 +109,10 @@ def plot_qbo_phase_circuits(inits,periods,rean_qbo_pcs,rfcst_qbo_pcs,outfile): def plot_qbo_phase_space(rean_qbo_pcs,eofs,ptitle,outfile): + from mpl_toolkits.axes_grid1.inset_locator import mark_inset + fig = plt.figure(4) ax = fig.add_subplot(1,1,1) diff --git a/metplotpy/plots/base_plot.py b/metplotpy/plots/base_plot.py index 27d68a74b..ac16e2759 100644 --- a/metplotpy/plots/base_plot.py +++ b/metplotpy/plots/base_plot.py @@ -27,8 +27,11 @@ from .config import Config from metplotpy.plots.context_filter import ContextFilter -# set kaleido to use single process to prevent GPU errors in containers -# pio.kaleido.scope.chromium_args += ("--single-process",) +# kaleido 0.x will be deprecated after September 2025 and Chrome will no longer +# be included with kaleido from version 1.0.0. Explicitly get Chrome via call to kaleido. +import kaleido +kaleido.get_chrome_sync() + class BasePlot: """A class that provides methods for building Plotly plot's common features diff --git a/requirements.txt b/requirements.txt index 3aafb80e6..eeb792d5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ + imageio>=2.37.0 imutils>=0.5.4 -kaleido>=0.2.1 +kaleido>=1.0.0 matplotlib>=3.10.0 metpy>=1.6.3 netcdf4>=1.7.2 @@ -8,7 +9,7 @@ numpy>=2.2.2 opencv-python>=4.10.0 pandas>=2.2.3 pint>=0.24.4 -plotly>=6.0.0 +plotly>=6.1.1 pytest>=8.3.4 pyyaml>=6.0.2 scikit-image>=0.25.1 @@ -18,4 +19,3 @@ eofs>=2.0.0 cartopy>=0.24.0 scikit-learn>=1.6.1 cmocean>=4.0.3 - diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 000000000..eeb792d5f --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1,21 @@ + +imageio>=2.37.0 +imutils>=0.5.4 +kaleido>=1.0.0 +matplotlib>=3.10.0 +metpy>=1.6.3 +netcdf4>=1.7.2 +numpy>=2.2.2 +opencv-python>=4.10.0 +pandas>=2.2.3 +pint>=0.24.4 +plotly>=6.1.1 +pytest>=8.3.4 +pyyaml>=6.0.2 +scikit-image>=0.25.1 +scipy>=1.15.1 +xarray>=2025.1.2 +eofs>=2.0.0 +cartopy>=0.24.0 +scikit-learn>=1.6.1 +cmocean>=4.0.3