From e058faa4ef0cabece7e3c8ac05fbfec298b8e254 Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Wed, 20 Nov 2024 10:14:44 -0700 Subject: [PATCH] Bugfix #475 main_v3.0 - make default configs available in package (#477) * fix version number for rc1 * get version number from verison file * per #475, add default config files to python package * prevent GPU failure running in containers by running kaleido with single process option --- docs/conf.py | 5 ++++- metplotpy/_version.py | 2 +- metplotpy/plots/base_plot.py | 5 ++++- pyproject.toml | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 76e0b211..d90a9f22 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,8 +13,11 @@ import os import sys sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), + os.pardir))) print(sys.path) +from metplotpy import __version__ as version # -- Project information ----------------------------------------------------- @@ -22,7 +25,7 @@ copyright = '2024, NSF NCAR' author = 'UCAR/NSF NCAR, NOAA, CSU/CIRA, and CU/CIRES' author_list = 'Fisher, H., D. Adriaansen, C. Kalb, D. Fillmore, T. Jensen, L. Goodrich, M. Win-Gildenmeister and T. Burek' -version = 'v3.1.0-beta1-dev' + verinfo = version release = f'{version}' release_year = '2024' diff --git a/metplotpy/_version.py b/metplotpy/_version.py index 16bcea84..dd57ed06 100644 --- a/metplotpy/_version.py +++ b/metplotpy/_version.py @@ -1 +1 @@ -__version__ = "3.0.0-beta6-dev" +__version__ = "3.0.0-rc1" diff --git a/metplotpy/plots/base_plot.py b/metplotpy/plots/base_plot.py index de0458a2..4897c0f0 100644 --- a/metplotpy/plots/base_plot.py +++ b/metplotpy/plots/base_plot.py @@ -21,11 +21,14 @@ import yaml from typing import Union +import plotly.io as pio + import metplotpy.plots.util 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",) class BasePlot: """A class that provides methods for building Plotly plot's common features diff --git a/pyproject.toml b/pyproject.toml index f8bf649d..70d86836 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,11 @@ version = {attr = "metplotpy.__version__"} [tool.setuptools.packages] find = {include = ["metplotpy*"]} +[tool.setuptools.package-data] +metplotpy = [ + "plots/config/**", +] + [tool.pytest.ini_options] testpaths = ["test"]