|
@@ 173-189 (lines=17) @@
|
| 170 |
|
_assert_class_equal(l2_o, l2_t) |
| 171 |
|
|
| 172 |
|
|
| 173 |
|
@pytest.mark.parametrize( |
| 174 |
|
"version", |
| 175 |
|
["0.8", "0.9"], |
| 176 |
|
) |
| 177 |
|
def test_oldver_round_trip_nc(tmpdir, version): |
| 178 |
|
from sciapy.level2.density import scia_densities |
| 179 |
|
odir = os.path.join(tmpdir, "level2_v{0}".format(version)) |
| 180 |
|
if not os.path.exists(odir): |
| 181 |
|
os.makedirs(odir) |
| 182 |
|
obase = os.path.join(odir, os.path.basename(IFILE)) |
| 183 |
|
ofnc = obase + ".nc" |
| 184 |
|
l2_o = scia_densities(data_ver=version) |
| 185 |
|
l2_o.read_from_file(IFILE[:-4] + "_v{0}.txt".format(version)) |
| 186 |
|
l2_o.write_to_netcdf(ofnc) |
| 187 |
|
l2_t = scia_densities() |
| 188 |
|
l2_t.read_from_netcdf(ofnc) |
| 189 |
|
_assert_class_equal(l2_o, l2_t) |
| 190 |
|
|
|
@@ 154-170 (lines=17) @@
|
| 151 |
|
_assert_class_equal(l2_o, l2_t) |
| 152 |
|
|
| 153 |
|
|
| 154 |
|
@pytest.mark.parametrize( |
| 155 |
|
"version", |
| 156 |
|
["0.8", "0.9"], |
| 157 |
|
) |
| 158 |
|
def test_oldver_round_trip_txt(tmpdir, version): |
| 159 |
|
from sciapy.level2.density import scia_densities |
| 160 |
|
odir = os.path.join(tmpdir, "level2_v{0}".format(version)) |
| 161 |
|
if not os.path.exists(odir): |
| 162 |
|
os.makedirs(odir) |
| 163 |
|
obase = os.path.join(odir, os.path.basename(IFILE)) |
| 164 |
|
oftxt = obase + ".txt" |
| 165 |
|
l2_o = scia_densities(data_ver=version) |
| 166 |
|
l2_o.read_from_file(IFILE[:-4] + "_v{0}.txt".format(version)) |
| 167 |
|
l2_o.write_to_textfile(oftxt) |
| 168 |
|
l2_t = scia_densities() |
| 169 |
|
l2_t.read_from_textfile(oftxt) |
| 170 |
|
_assert_class_equal(l2_o, l2_t) |
| 171 |
|
|
| 172 |
|
|
| 173 |
|
@pytest.mark.parametrize( |