diff --git a/scoringrules/core/crps/__init__.py b/scoringrules/core/crps/__init__.py index a8c6e7f..0e360d8 100644 --- a/scoringrules/core/crps/__init__.py +++ b/scoringrules/core/crps/__init__.py @@ -23,7 +23,12 @@ t, uniform, ) -from ._gufuncs import estimator_gufuncs, quantile_pinball_gufunc + +try: + from ._gufuncs import estimator_gufuncs, quantile_pinball_gufunc +except ImportError: + estimator_gufuncs = None + quantile_pinball_gufunc = None __all__ = [ "ensemble", diff --git a/scoringrules/core/energy/__init__.py b/scoringrules/core/energy/__init__.py index af64592..4fad1be 100644 --- a/scoringrules/core/energy/__init__.py +++ b/scoringrules/core/energy/__init__.py @@ -1,8 +1,14 @@ -from ._gufuncs import ( - _energy_score_gufunc, - _owenergy_score_gufunc, - _vrenergy_score_gufunc, -) +try: + from ._gufuncs import ( + _energy_score_gufunc, + _owenergy_score_gufunc, + _vrenergy_score_gufunc, + ) +except ImportError: + _energy_score_gufunc = None + _owenergy_score_gufunc = None + _vrenergy_score_gufunc = None + from ._score import energy_score as nrg from ._score import owenergy_score as ownrg from ._score import vrenergy_score as vrnrg diff --git a/scoringrules/core/error_spread/__init__.py b/scoringrules/core/error_spread/__init__.py index 7c59df2..7e0fab9 100644 --- a/scoringrules/core/error_spread/__init__.py +++ b/scoringrules/core/error_spread/__init__.py @@ -1,4 +1,8 @@ -from ._gufunc import _error_spread_score_gufunc as _ess_gufunc +try: + from ._gufunc import _error_spread_score_gufunc as _ess_gufunc +except ImportError: + _ess_gufunc = None + from ._score import error_spread_score as ess __all__ = ["ess", "_ess_gufunc"] diff --git a/scoringrules/core/interval/__init__.py b/scoringrules/core/interval/__init__.py index 8788b61..3382b26 100644 --- a/scoringrules/core/interval/__init__.py +++ b/scoringrules/core/interval/__init__.py @@ -1,4 +1,9 @@ -from ._gufunc import _interval_score_gufunc, _weighted_interval_score_gufunc +try: + from ._gufunc import _interval_score_gufunc, _weighted_interval_score_gufunc +except ImportError: + _interval_score_gufunc = None + _weighted_interval_score_gufunc = None + from ._score import _interval_score, _weighted_interval_score __all__ = [ diff --git a/scoringrules/core/variogram/__init__.py b/scoringrules/core/variogram/__init__.py index de9d607..2006d13 100644 --- a/scoringrules/core/variogram/__init__.py +++ b/scoringrules/core/variogram/__init__.py @@ -1,8 +1,14 @@ -from ._gufuncs import ( - _owvariogram_score_gufunc, - _variogram_score_gufunc, - _vrvariogram_score_gufunc, -) +try: + from ._gufuncs import ( + _owvariogram_score_gufunc, + _variogram_score_gufunc, + _vrvariogram_score_gufunc, + ) +except ImportError: + _owvariogram_score_gufunc = None + _variogram_score_gufunc = None + _vrvariogram_score_gufunc = None + from ._score import owvariogram_score as owvs from ._score import variogram_score as vs from ._score import vrvariogram_score as vrvs