Fix MPL_AVAILABLE error.

This commit is contained in:
Neil Lawrence 2021-05-24 09:19:45 +01:00
parent b0e66c5cb5
commit b174b58b79
3 changed files with 9 additions and 2 deletions

View file

@ -3,6 +3,7 @@
""" """
Gaussian Processes classification examples Gaussian Processes classification examples
""" """
MPL_AVAILABLE = True
try: try:
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
except ImportError: except ImportError:

View file

@ -3,8 +3,8 @@
import GPy import GPy
import numpy as np import numpy as np
from GPy.util import datasets
MPL_AVAILABLE = True
try: try:
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
except ImportError: except ImportError:
@ -141,7 +141,12 @@ def boston_example(optimize=True, plot=True):
optimizer = "bfgs" optimizer = "bfgs"
messages = 0 messages = 0
data = datasets.boston_housing() try:
import pods
except ImportError:
print("pods unavailable, see https://github.com/sods/ods for example datasets")
return
data = pods.datasets.boston_housing()
degrees_freedoms = [3, 5, 8, 10] degrees_freedoms = [3, 5, 8, 10]
X = data["X"].copy() X = data["X"].copy()
Y = data["Y"].copy() Y = data["Y"].copy()

View file

@ -4,6 +4,7 @@
""" """
Gaussian Processes regression examples Gaussian Processes regression examples
""" """
MPL_AVAILABLE = True
try: try:
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
except ImportError: except ImportError: