already handled in NiceDumper class
This commit is contained in:
parent
b13e7e174b
commit
f76d64d355
|
@ -146,12 +146,6 @@ class Config(dict):
|
||||||
if 'sort_keys' not in kwargs:
|
if 'sort_keys' not in kwargs:
|
||||||
kwargs['sort_keys'] = False
|
kwargs['sort_keys'] = False
|
||||||
|
|
||||||
def array_representer(dumper, data):
|
|
||||||
"""Convert numpy array to list of native types."""
|
|
||||||
return dumper.represent_list([d.item() for d in data])
|
|
||||||
|
|
||||||
NiceDumper.add_representer(np.ndarray, array_representer)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fhandle.write(yaml.dump(self,Dumper=NiceDumper,**kwargs))
|
fhandle.write(yaml.dump(self,Dumper=NiceDumper,**kwargs))
|
||||||
except TypeError: # compatibility with old pyyaml
|
except TypeError: # compatibility with old pyyaml
|
||||||
|
|
Loading…
Reference in New Issue