Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_bad(tmp_path):
pat = '*o'
with pytest.raises(TypeError):
gr.batch_convert(tmp_path, pat)
def test_batch_convert_rinex2(tmp_path, filename):
pytest.importorskip('netCDF4')
outdir = tmp_path
gr.batch_convert(R, filename.name, outdir)
outfn = outdir / (filename.name + '.nc')
if outfn.name.startswith('blank'):
return # blank files do not convert
assert outfn.is_file(), f'{outfn}'
assert outfn.stat().st_size > 15000, f'{outfn}'
truth = gr.load(filename)
dat = gr.load(outfn)
assert dat.equals(truth), f'{outfn} {filename}'
p = ArgumentParser(description='example of reading RINEX 2/3 Navigation/Observation file')
p.add_argument('indir', help='path to RINEX 2 or RINEX 3 files to convert')
p.add_argument('glob', help='file glob pattern', nargs='?', default='*')
p.add_argument('-o', '--out', help='write data to path or file as NetCDF4')
p.add_argument('-v', '--verbose', action='store_true')
p.add_argument('-p', '--plot', help='display plots', action='store_true')
p.add_argument('-u', '--use', help='select which GNSS system(s) to use', nargs='+')
p.add_argument('-m', '--meas', help='select which GNSS measurement(s) to use', nargs='+')
p.add_argument('-t', '--tlim', help='specify time limits (process part of file)', nargs=2)
p.add_argument('-useindicators', help='use SSI, LLI indicators (signal, loss of lock)',
action='store_true')
p.add_argument('-strict', help='do not use speculative preallocation (slow) let us know if this is needed',
action='store_false')
P = p.parse_args()
gr.batch_convert(P.indir, P.glob, P.out, use=P.use, tlim=P.tlim,
useindicators=P.useindicators, meas=P.meas,
verbose=P.verbose, fast=P.strict)