already handled in NiceDumper class

This commit is contained in:
Martin Diehl 2021-08-18 08:50:28 +02:00
parent b13e7e174b
commit f76d64d355
1 changed files with 0 additions and 6 deletions

View File

@ -146,12 +146,6 @@ class Config(dict):
if 'sort_keys' not in kwargs:
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:
fhandle.write(yaml.dump(self,Dumper=NiceDumper,**kwargs))
except TypeError: # compatibility with old pyyaml