本文整理汇总了Python中hftools.dataset.DataBlock.freq方法的典型用法代码示例。如果您正苦于以下问题:Python DataBlock.freq方法的具体用法?Python DataBlock.freq怎么用?Python DataBlock.freq使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hftools.dataset.DataBlock
的用法示例。
在下文中一共展示了DataBlock.freq方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_4
# 需要导入模块: from hftools.dataset import DataBlock [as 别名]
# 或者: from hftools.dataset.DataBlock import freq [as 别名]
def test_4(self):
d = DataBlock()
d.comments = Comments(["Hej=10", "Svejs=11"])
dim = DimSweep("f", 3, outputformat="%.1f")
d.freq = dim
fname = testpath / "testdata/hdf5/v02/savetest/res_4.hdf5"
self.savefun[0](d, fname)
fname.unlink()
示例2: test_5
# 需要导入模块: from hftools.dataset import DataBlock [as 别名]
# 或者: from hftools.dataset.DataBlock import freq [as 别名]
def test_5(self):
d = DataBlock()
d.comments = Comments(["Hej=10", "Svejs=11"])
dim = DimSweep("f", 3, outputformat="%.1f")
d.freq = dim
d.date = hfarray("2012-08-13 08:03:01", dtype="datetime64[us]")
fname = testpath / "testdata/hdf5/v02/savetest/res_5.hdf5"
self.savefun[0](d, fname)
d2 = readfun(fname)
fname.unlink()
self.assertEqual(d2.date, d.date)
示例3: test_4
# 需要导入模块: from hftools.dataset import DataBlock [as 别名]
# 或者: from hftools.dataset.DataBlock import freq [as 别名]
def test_4(self):
d = DataBlock()
d.comments = Comments(["Hej=10", "Svejs=11"])
dim = DimSweep("f", 3, outputformat="%.1f")
d.freq = dim
fname = testpath / "testdata/sp-data/savetest/res_4.txt"
facitfname = testpath / "testdata/sp-data/savetest/facit_4.txt"
hftools.file_formats.spdata.save_spdata(d, fname)
with open(fname) as resfil:
with open(facitfname) as facitfil:
for idx, (rad1, rad2) in enumerate(zip(resfil, facitfil)):
msg = "\nFailed on line %d\n result: %r\n facit: %r"
args = (idx + 1, rad1, rad2)
self.assertEqual(rad1, rad2, msg=msg % args)