当前位置: 首页>>代码示例>>Python>>正文


Python Scraper.range方法代码示例

本文整理汇总了Python中sunpy.util.scraper.Scraper.range方法的典型用法代码示例。如果您正苦于以下问题:Python Scraper.range方法的具体用法?Python Scraper.range怎么用?Python Scraper.range使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sunpy.util.scraper.Scraper的用法示例。


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

示例1: testDirectoryRange_Month

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_Month():
    s = Scraper("%Y%m/%d/%j_%H.txt")
    startdate = datetime.datetime(2008, 2, 20, 10)
    enddate = datetime.datetime(2008, 3, 2, 5)
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 12
    startdate = datetime.datetime(2009, 2, 20, 10)
    enddate = datetime.datetime(2009, 3, 2, 5)
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 11
开发者ID:ZachWerginz,项目名称:sunpy,代码行数:12,代码来源:test_scraper.py

示例2: testDirectoryRange_Month

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_Month():
    s = Scraper('%Y%m/%d/%j_%H.txt')
    startdate = parse_time((2008, 2, 20, 10))
    enddate = parse_time((2008, 3, 2, 5))
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 12
    startdate = parse_time((2009, 2, 20, 10))
    enddate = parse_time((2009, 3, 2, 5))
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 11
开发者ID:Cadair,项目名称:sunpy,代码行数:12,代码来源:test_scraper.py

示例3: testNoDirectory

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testNoDirectory():
    s = Scraper('files/%Y%m%d_%H%M.dat')
    startdate = parse_time((2010, 1, 10, 20, 30))
    enddate = parse_time((2010, 1, 20, 20, 30))
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 1
开发者ID:Cadair,项目名称:sunpy,代码行数:8,代码来源:test_scraper.py

示例4: testDirectoryRange_single

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_single():
    s = Scraper('%Y%m%d/%H_%M.csv')
    startdate = parse_time((2010, 10, 10, 5, 0))
    enddate = parse_time((2010, 10, 10, 7, 0))
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 1
开发者ID:Cadair,项目名称:sunpy,代码行数:8,代码来源:test_scraper.py

示例5: testDirectoryRangeHours

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRangeHours():
    s = Scraper('%Y%m%d_%H/%H%M.csv')
    timerange = TimeRange('2009-12-31T23:40:00', '2010-01-01T01:15:00')
    assert len(s.range(timerange)) == 3  # 3 directories (1 per hour)
开发者ID:Cadair,项目名称:sunpy,代码行数:6,代码来源:test_scraper.py

示例6: testNoDateDirectory

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testNoDateDirectory():
    s = Scraper('mySpacecraft/myInstrument/xMinutes/aaa%y%b.ext')
    directory_list = ['mySpacecraft/myInstrument/xMinutes/']
    timerange = TimeRange('2009/11/20', '2010/01/03')
    assert s.range(timerange) == directory_list
开发者ID:Cadair,项目名称:sunpy,代码行数:7,代码来源:test_scraper.py

示例7: testDirectoryRangeFalse

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRangeFalse():
    s = Scraper('%Y%m%d/%Y%m%d_%H.fit.gz')
    directory_list = ['20091230/', '20091231/', '20100101/',
                      '20090102/', '20090103/']
    timerange = TimeRange('2009/12/30', '2010/01/03')
    assert s.range(timerange) != directory_list
开发者ID:Cadair,项目名称:sunpy,代码行数:8,代码来源:test_scraper.py

示例8: testDirectoryRange

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange():
    s = Scraper('%Y/%m/%d/%Y%m%d_%H.fit.gz')
    directory_list = ['2009/12/30/', '2009/12/31/', '2010/01/01/',
                      '2010/01/02/', '2010/01/03/']
    timerange = TimeRange('2009-12-30', '2010-01-03')
    assert s.range(timerange) == directory_list
开发者ID:Cadair,项目名称:sunpy,代码行数:8,代码来源:test_scraper.py

示例9: testNoDirectory

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testNoDirectory():
    s = Scraper("files/%Y%m%d_%H%M.dat")
    startdate = datetime.datetime(2010, 1, 10, 20, 30)
    enddate = datetime.datetime(2010, 1, 20, 20, 30)
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 1
开发者ID:ZachWerginz,项目名称:sunpy,代码行数:8,代码来源:test_scraper.py

示例10: testDirectoryRange_single

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange_single():
    s = Scraper("%Y%m%d/%H_%M.csv")
    startdate = datetime.datetime(2010, 10, 10, 5, 00)
    enddate = datetime.datetime(2010, 10, 10, 7, 00)
    timerange = TimeRange(startdate, enddate)
    assert len(s.range(timerange)) == 1
开发者ID:ZachWerginz,项目名称:sunpy,代码行数:8,代码来源:test_scraper.py

示例11: testDirectoryRangeFalse

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRangeFalse():
    s = Scraper("%Y%m%d/%Y%m%d_%H.fit.gz")
    directory_list = ["20091230/", "20091231/", "20100101/", "20090102/", "20090103/"]
    timerange = TimeRange("2009/12/30", "2010/01/03")
    assert s.range(timerange) != directory_list
开发者ID:ZachWerginz,项目名称:sunpy,代码行数:7,代码来源:test_scraper.py

示例12: testDirectoryRange

# 需要导入模块: from sunpy.util.scraper import Scraper [as 别名]
# 或者: from sunpy.util.scraper.Scraper import range [as 别名]
def testDirectoryRange():
    s = Scraper("%Y/%m/%d/%Y%m%d_%H.fit.gz")
    directory_list = ["2009/12/30/", "2009/12/31/", "2010/01/01/", "2010/01/02/", "2010/01/03/"]
    timerange = TimeRange("2009-12-30", "2010-01-03")
    assert s.range(timerange) == directory_list
开发者ID:ZachWerginz,项目名称:sunpy,代码行数:7,代码来源:test_scraper.py


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