The implementation could not be done using np.integer and np.floating to check the instance of the objects because pyyaml works by identifying the first element of type(data).__mro__[0]. This corresponds to the bottom level of class (e.g. np.int64) and not to its higher levels (e.g. np.integer or np.generic).
The PR #48 fixed the problem with numpy arrays, however there was still a problem with numpy scalars, which is solved in this PR.
The implementation could not be done using
np.integer
andnp.floating
to check the instance of the objects becausepyyaml
works by identifying the first element oftype(data).__mro__[0]
. This corresponds to the bottom level of class (e.g.np.int64
) and not to its higher levels (e.g.np.integer
ornp.generic
).