@@ 207-223 (lines=17) @@ | ||
204 | _assert_class_equal(l2_o, l2_t) |
|
205 | ||
206 | ||
207 | @pytest.mark.parametrize( |
|
208 | "version", |
|
209 | ["0.1", "0.8", "0.9"], |
|
210 | ) |
|
211 | def test_oldver_round_trip_nc(tmpdir, version): |
|
212 | from sciapy.level2.density import scia_densities |
|
213 | odir = os.path.join(tmpdir, "level2_v{0}".format(version)) |
|
214 | if not os.path.exists(odir): |
|
215 | os.makedirs(odir) |
|
216 | obase = os.path.join(odir, os.path.basename(IFILE)) |
|
217 | ofnc = obase + ".nc" |
|
218 | l2_o = scia_densities(data_ver=version) |
|
219 | l2_o.read_from_file(IFILE[:-4] + "_v{0}.txt".format(version)) |
|
220 | l2_o.write_to_netcdf(ofnc) |
|
221 | l2_t = scia_densities() |
|
222 | l2_t.read_from_netcdf(ofnc) |
|
223 | _assert_class_equal(l2_o, l2_t) |
|
224 | ||
@@ 188-204 (lines=17) @@ | ||
185 | _assert_class_equal(l2_o, l2_t) |
|
186 | ||
187 | ||
188 | @pytest.mark.parametrize( |
|
189 | "version", |
|
190 | ["0.1", "0.8", "0.9"], |
|
191 | ) |
|
192 | def test_oldver_round_trip_txt(tmpdir, version): |
|
193 | from sciapy.level2.density import scia_densities |
|
194 | odir = os.path.join(tmpdir, "level2_v{0}".format(version)) |
|
195 | if not os.path.exists(odir): |
|
196 | os.makedirs(odir) |
|
197 | obase = os.path.join(odir, os.path.basename(IFILE)) |
|
198 | oftxt = obase + ".txt" |
|
199 | l2_o = scia_densities(data_ver=version) |
|
200 | l2_o.read_from_file(IFILE[:-4] + "_v{0}.txt".format(version)) |
|
201 | l2_o.write_to_textfile(oftxt) |
|
202 | l2_t = scia_densities() |
|
203 | l2_t.read_from_textfile(oftxt) |
|
204 | _assert_class_equal(l2_o, l2_t) |
|
205 | ||
206 | ||
207 | @pytest.mark.parametrize( |