blob: 2747fc4c8ac2536e7d39edf51d59fecf863c3cb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# coding: utf-8
from __future__ import print_function, absolute_import, division, unicode_literals
try:
import numpy
except: # NOQA
numpy = None
def Xtest_numpy():
import ruamel.yaml
if numpy is None:
return
data = numpy.arange(10)
print('data', type(data), data)
yaml_str = ruamel.yaml.dump(data)
datb = ruamel.yaml.load(yaml_str)
print('datb', type(datb), datb)
print('\nYAML', yaml_str)
assert data == datb
|