mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-04 17:22:39 +02:00
Merge branch 'devel' into paramz
Conflicts: GPy/core/parameterization/parameter_core.py GPy/testing/pickle_tests.py
This commit is contained in:
commit
5d605277bc
9 changed files with 58 additions and 38 deletions
|
|
@ -39,18 +39,28 @@ def load(file_or_path):
|
|||
|
||||
:param file_name: path/to/file.pickle
|
||||
"""
|
||||
# This is the pickling pain when changing _src -> src
|
||||
try:
|
||||
import cPickle as pickle
|
||||
if isinstance(file_or_path, basestring):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
m = pickle.load(file_or_path)
|
||||
except:
|
||||
import pickle
|
||||
if isinstance(file_or_path, str):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
m = pickle.load(file_or_path)
|
||||
try:
|
||||
import cPickle as pickle
|
||||
if isinstance(file_or_path, basestring):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
m = pickle.load(file_or_path)
|
||||
except:
|
||||
import pickle
|
||||
if isinstance(file_or_path, str):
|
||||
with open(file_or_path, 'rb') as f:
|
||||
m = pickle.load(f)
|
||||
else:
|
||||
m = pickle.load(file_or_path)
|
||||
except ImportError:
|
||||
import sys
|
||||
import inspect
|
||||
sys.modules['GPy.kern._src'] = kern.src
|
||||
for name, module in inspect.getmembers(kern.src):
|
||||
if not name.startswith('_'):
|
||||
sys.modules['GPy.kern._src.{}'.format(name)] = module
|
||||
m = load(file_or_path)
|
||||
return m
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue