<commit_before>#!/usr/bin/env python
"""
Self-test file, registration case
for OBS RINEX reader
"""
from pandas.io.pytables import read_hdf
from numpy.testing import assert_allclose
#
from pyrinex.readRinexObs import rinexobs
from pyrinex.readRinexNav import readRinexNav

#%% do registration case
truth = read_hdf('test/demo.h5',key='OBS')

blocks = rinexobs('test/demo.10o',False,None)

assert_allclose(blocks,truth)

#%%
truthnav = read_hdf('test/demo.h5',key='NAV')
testnav = readRinexNav('test/demo.10n',False)

assert_allclose(testnav,truthnav)
<commit_msg>functionalize self test<commit_after>#!/usr/bin/env python
"""
Self-test file, registration case
for OBS RINEX reader
"""
from pandas.io.pytables import read_hdf
from numpy.testing import assert_allclose,run_module_suite
#
from pyrinex.readRinexObs import rinexobs
from pyrinex.readRinexNav import readRinexNav

def test_obs():
    truth = read_hdf('test/demo.h5',key='OBS')
    blocks = rinexobs('test/demo.10o')
    
    assert_allclose(blocks,truth)
    
def test_nav():
    truthnav = read_hdf('test/demo.h5',key='NAV')
    testnav = readRinexNav('test/demo.10n')
    
    assert_allclose(testnav,truthnav)

if __name__ == '__main__':
    run_module_suite()
{'fraction_non_alphanumeric': 0.12336601307189543, 'fraction_numerical': 0.00980392156862745, 'mean_word_length': 5.586021505376344, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '708139', 'n_tokens_mistral': 475, 'n_tokens_neox': 455, 'n_words': 85}