diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 514f051a6..1e82d18a7 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,18 @@ 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/internal/scripts/installation/modulefiles/3.1.0_ursa b/internal/scripts/installation/modulefiles/3.1.0_ursa new file mode 100644 index 000000000..9ffb356e9 --- /dev/null +++ b/internal/scripts/installation/modulefiles/3.1.0_ursa @@ -0,0 +1,25 @@ +#%Module###################################################################### +## +## METplotpy +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the METplotpy-3.1.0. + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +prereq intel-oneapi-compilers/2025.1.1 + +setenv METPLOTPY_SOURCE /contrib/METplotpy/METplotpy-3.1.0 +setenv METPLOTPY_BASE /contrib/METplotpy/METplotpy-3.1.0 + +prepend-path PATH /scratch3/BMC/dtc/METplus/miniconda/miniconda3/envs/metplus_v6.1_py3.12/bin +prepend-path PATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy/contributed +prepend-path PATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy/plots/performance_diagram +prepend-path PATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy/plots +prepend-path PATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy +prepend-path PATH /contrib/METplotpy/METplotpy-3.1.0 +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy/contributed +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy/plots/performance_diagram +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy/plots +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.1.0/metplotpy +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.1.0 diff --git a/internal/scripts/installation/modulefiles/3.2.0_ursa b/internal/scripts/installation/modulefiles/3.2.0_ursa new file mode 100644 index 000000000..1ef5d6e56 --- /dev/null +++ b/internal/scripts/installation/modulefiles/3.2.0_ursa @@ -0,0 +1,25 @@ +#%Module###################################################################### +## +## METplotpy +## +proc ModulesHelp { } { + puts stderr "Sets up the paths and environment variables to use the METplotpy-3.2.0. + *** For help see the official MET webpage at http://www.dtcenter.org/met/users ***" +} + +prereq intel-oneapi-compilers/2025.1.1 + +setenv METPLOTPY_SOURCE /contrib/METplotpy/METplotpy-3.2.0 +setenv METPLOTPY_BASE /contrib/METplotpy/METplotpy-3.2.0 + +prepend-path PATH /scratch3/BMC/dtc/METplus/miniconda/miniconda3/envs/metplus_v6.1_py3.12/bin +prepend-path PATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy/contributed +prepend-path PATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy/plots/performance_diagram +prepend-path PATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy/plots +prepend-path PATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy +prepend-path PATH /contrib/METplotpy/METplotpy-3.2.0 +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy/contributed +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy/plots/performance_diagram +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy/plots +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.2.0/metplotpy +prepend-path PYTHONPATH /contrib/METplotpy/METplotpy-3.2.0 diff --git a/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py b/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py index 753c2c060..8fa23f0d0 100644 --- a/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py +++ b/metplotpy/contributed/stratosphere_diagnostics/stratosphere_plots.py @@ -109,6 +109,7 @@ 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) diff --git a/metplotpy/plots/base_plot.py b/metplotpy/plots/base_plot.py index 27d68a74b..6e7ef3000 100644 --- a/metplotpy/plots/base_plot.py +++ b/metplotpy/plots/base_plot.py @@ -27,8 +27,12 @@ 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