ai-content-maker/.venv/Lib/site-packages/srsly/tests/ruamel_yaml/test_numpy.py

25 lines
488 B
Python
Raw Normal View History

2024-05-03 04:18:51 +03:00
# coding: utf-8
from __future__ import print_function, absolute_import, division, unicode_literals
try:
import numpy
except: # NOQA
numpy = None
def Xtest_numpy():
import srsly.ruamel_yaml
if numpy is None:
return
data = numpy.arange(10)
print("data", type(data), data)
yaml_str = srsly.ruamel_yaml.dump(data)
datb = srsly.ruamel_yaml.load(yaml_str)
print("datb", type(datb), datb)
print("\nYAML", yaml_str)
assert data == datb