• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python tables.DatabaseEntry类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sunpy.database.tables.DatabaseEntry的典型用法代码示例。如果您正苦于以下问题:Python DatabaseEntry类的具体用法?Python DatabaseEntry怎么用?Python DatabaseEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DatabaseEntry类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_tags_unique

def test_tags_unique(database):
    entry = DatabaseEntry()
    entry.tags = [Tag('foo')]
    database.add(entry)
    database.commit()
    entry.tags.append(Tag('foo'))
    with pytest.raises(sqlalchemy.orm.exc.FlushError):
        database.commit()
开发者ID:mirca,项目名称:sunpy,代码行数:8,代码来源:test_database.py


示例2: test_unstar_undo

def test_unstar_undo(database):
    entry = DatabaseEntry()
    entry.starred = True
    database.unstar(entry)
    assert not entry.starred
    database.undo()
    assert entry.starred
    database.redo()
    assert not entry.starred
开发者ID:mirca,项目名称:sunpy,代码行数:9,代码来源:test_database.py


示例3: test_entry_from_qr_block_with_missing_physobs

def test_entry_from_qr_block_with_missing_physobs(qr_block_with_missing_physobs):
    entry = DatabaseEntry._from_query_result_block(qr_block_with_missing_physobs)
    expected_entry = DatabaseEntry(
        source='STEREO_A', provider='SSC',
        fileid='swaves/2013/swaves_average_20130805_a_hfr.dat',
        observation_time_start=datetime(2013, 8, 5),
        observation_time_end=datetime(2013, 8, 6), instrument='SWAVES',
        size=3601.08, wavemin=2398339664000.0, wavemax=18737028625.0)
    assert entry == expected_entry
开发者ID:ChrisIAm101,项目名称:sunpy,代码行数:9,代码来源:test_tables.py


示例4: test_entry_from_qr_block

def test_entry_from_qr_block(query_result):
    entry = DatabaseEntry._from_query_result_block(query_result[0])
    expected_entry = DatabaseEntry(
        source='SOHO', provider='SDAC', physobs='intensity',
        fileid='/archive/soho/private/data/processed/eit/lz/2001/01/efz20010101.010014',
        observation_time_start=datetime(2001, 1, 1, 1, 0, 14),
        observation_time_end=datetime(2001, 1, 1, 1, 0, 21),
        instrument='EIT', size=2059.0, wavemin=17.1, wavemax=17.1)
    assert entry == expected_entry
开发者ID:ChrisIAm101,项目名称:sunpy,代码行数:9,代码来源:test_tables.py


示例5: test_from_fido_search_result_block

def test_from_fido_search_result_block(fido_search_result):
    entry = DatabaseEntry._from_fido_search_result_block(
        fido_search_result[0, 0][0].get_response(0)[0])
    expected_entry = DatabaseEntry(
        source='Proba2', provider='esa', physobs='irradiance',
        fileid='http://proba2.oma.be/lyra/data/bsd/2012/01/01/lyra_20120101-000000_lev2_std.fits',
        observation_time_start=datetime(2012, 1, 1, 0, 0),
        observation_time_end=datetime(2012, 1, 2, 0, 0),
        wavemin=np.nan, wavemax=np.nan,
        instrument='lyra')
    assert entry == expected_entry
开发者ID:bwgref,项目名称:sunpy,代码行数:11,代码来源:test_tables.py


示例6: test_entry_from_qr_block_kev

def test_entry_from_qr_block_kev(qr_block_with_kev_unit):
    # See issue #766.
    entry = DatabaseEntry._from_query_result_block(qr_block_with_kev_unit)
    assert entry.source == 'RHESSI'
    assert entry.provider == 'LSSP'
    assert entry.fileid == '/hessidata/2011/09/20/hsi_20110920_010920'
    assert entry.observation_time_start == datetime(2011, 9, 20, 1, 9, 20)
    assert entry.observation_time_end == datetime(2011, 9, 20, 2, 27, 40)
    assert entry.instrument == 'RHESSI'
    assert entry.size == -1
    assert round(entry.wavemin, 3) == 0.413
    assert round(entry.wavemax, 7) == 0.0000729
开发者ID:ChrisIAm101,项目名称:sunpy,代码行数:12,代码来源:test_tables.py


示例7: test_entry_from_qr_block_kev

def test_entry_from_qr_block_kev(qr_block_with_kev_unit):
    # See issue #766.
    entry = DatabaseEntry._from_query_result_block(qr_block_with_kev_unit)
    assert entry.source == 'RHESSI'
    assert entry.provider == 'LSSP'
    # TODO: Flaky test that needs a fix
    assert entry.fileid in ['/hessidata/2011/09/19/hsi_20110919_233340',
                            '/hessidata/2011/09/20/hsi_20110920_010920']
    assert entry.observation_time_start in [datetime(2011, 9, 20, 1, 9, 20),
                                            datetime(2011, 9, 19, 23, 33, 40)]
    assert entry.observation_time_end in [datetime(2011, 9, 20, 2, 27, 40),
                                          datetime(2011, 9, 20, 1, 9, 20)]
    assert entry.instrument == 'RHESSI'
    assert round(entry.wavemin, 3) == 0.413
    assert round(entry.wavemax, 7) == 0.0000729
开发者ID:Cadair,项目名称:sunpy,代码行数:15,代码来源:test_tables.py



注:本文中的sunpy.database.tables.DatabaseEntry类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tables.Tag类代码示例发布时间:2022-05-27
下一篇:
Python tables.entries_from_query_result函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap