使用traits的可序列化模式
traitschema的Python项目详细描述
traitschema
==
图片::https://travis-ci.org/mivade/traitschema.svg?branch=master
:目标:https://travis ci.org/mivade/traitschema
…图片::https://readthedocs.org/projects/traitschema/badge/?version=latest
:目标:http://traitschema.readthedocs.io/en/latest/?徽章=最新
:alt:文档状态
…图像::https://codecov.io/gh/mivade/traitschema/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/mivade/traitschema
…图片::https://img.shields.io/github/release/mivade/traitschema.svg
:目标:https://github.com/mivade/traitschema
典型的用法是保存几个不同形状和类型的numpy数组。_特征:http://docs.enthough.com/traits/
定义模式注意:
有关详细信息,请参见
its`documentation<;http://docs.enthough.com/traits/>;``文档。
为了能够正确序列化数据,应将非标量特征
声明为``traits.api.array``类型。示例:
…代码块::python
import numpy as np
from traits.api import array,string
from traitschema import schema
class namedmatrix(schema):
name=string()
data=array(dtype=np.float64)
matrix=namedmatrix(name=“name”,data=np.random.random((8,(8))
对于其他演示,请参阅“demos”目录。
`并加载
:func:`traitschema.load_bundle`.
==
图片::https://travis-ci.org/mivade/traitschema.svg?branch=master
:目标:https://travis ci.org/mivade/traitschema
…图片::https://readthedocs.org/projects/traitschema/badge/?version=latest
:目标:http://traitschema.readthedocs.io/en/latest/?徽章=最新
:alt:文档状态
…图像::https://codecov.io/gh/mivade/traitschema/branch/master/graph/badge.svg
:目标:https://codecov.io/gh/mivade/traitschema
…图片::https://img.shields.io/github/release/mivade/traitschema.svg
:目标:https://github.com/mivade/traitschema
典型的用法是保存几个不同形状和类型的numpy数组。_特征:http://docs.enthough.com/traits/
定义模式注意:
有关详细信息,请参见
its`documentation<;http://docs.enthough.com/traits/>;``文档。
为了能够正确序列化数据,应将非标量特征
声明为``traits.api.array``类型。示例:
…代码块::python
import numpy as np
from traits.api import array,string
from traitschema import schema
class namedmatrix(schema):
name=string()
data=array(dtype=np.float64)
matrix=namedmatrix(name=“name”,data=np.random.random((8,(8))
对于其他演示,请参阅“demos”目录。
`并加载
:func:`traitschema.load_bundle`.