@@ -1923,7 +1923,6 @@ def test_netcdf_export_with_mixed_timestamp_raw(
19231923 assert loaded_ds .completed_timestamp_raw is None
19241924
19251925
1926- @pytest .mark .skip (reason = "Disabled until we renable new export" )
19271926@given (data = hst .data ())
19281927@settings (
19291928 max_examples = 10 ,
@@ -2114,11 +2113,10 @@ def test_measurement_2d_with_inferred_setpoint(
21142113 with caplog .at_level (logging .INFO ):
21152114 xr_ds = ds .to_xarray_dataset ()
21162115
2117- # disabled until we renable new export
2118- # assert any(
2119- # "Exporting signal to xarray using direct method" in record.message
2120- # for record in caplog.records
2121- # )
2116+ assert any (
2117+ "Exporting signal to xarray using direct method" in record .message
2118+ for record in caplog .records
2119+ )
21222120
21232121 # Sizes and coords
21242122 assert xr_ds .sizes == {"x" : nx , "y" : ny }
@@ -2130,16 +2128,15 @@ def test_measurement_2d_with_inferred_setpoint(
21302128 expected_signal = x_vals [:, None ] + 3.0 * y_vals [None , :]
21312129 np .testing .assert_allclose (xr_ds ["signal" ].values , expected_signal )
21322130
2133- # disabled until we renable new export
2134- # # Inferred coords for y_b0 and y_b1 exist with dims only along y
2135- # for name, vals in ("y_b0", y_b0_vals), ("y_b1", y_b1_vals):
2136- # assert name in xr_ds.coords
2137- # assert xr_ds.coords[name].dims == ("y",)
2138- # np.testing.assert_allclose(xr_ds.coords[name].values, vals)
2139- # # Indexes of inferred coords should correspond to the y axis index
2140- # inf_idx = xr_ds.coords[name].indexes
2141- # assert set(inf_idx.keys()) == {"y"}
2142- # assert inf_idx["y"].equals(xr_ds.indexes["y"])
2131+ # Inferred coords for y_b0 and y_b1 exist with dims only along y
2132+ for name , vals in ("y_b0" , y_b0_vals ), ("y_b1" , y_b1_vals ):
2133+ assert name in xr_ds .coords
2134+ assert xr_ds .coords [name ].dims == ("y" ,)
2135+ np .testing .assert_allclose (xr_ds .coords [name ].values , vals )
2136+ # Indexes of inferred coords should correspond to the y axis index
2137+ inf_idx = xr_ds .coords [name ].indexes
2138+ assert set (inf_idx .keys ()) == {"y" }
2139+ assert inf_idx ["y" ].equals (xr_ds .indexes ["y" ])
21432140
21442141
21452142def test_measurement_2d_with_inferred_setpoint_from_setpoint (
@@ -2181,11 +2178,10 @@ def test_measurement_2d_with_inferred_setpoint_from_setpoint(
21812178 with caplog .at_level (logging .INFO ):
21822179 xr_ds = ds .to_xarray_dataset ()
21832180
2184- # disabled until we renable new export
2185- # assert any(
2186- # "Exporting signal to xarray using direct method" in record.message
2187- # for record in caplog.records
2188- # )
2181+ assert any (
2182+ "Exporting signal to xarray using direct method" in record .message
2183+ for record in caplog .records
2184+ )
21892185
21902186 # Sizes and coords
21912187 assert xr_ds .sizes == {"x" : nx , "y" : ny }
@@ -2240,24 +2236,22 @@ def test_measurement_2d_top_level_inferred_is_data_var(
22402236 xr_ds = ds .to_xarray_dataset ()
22412237
22422238 # Direct path log should be present
2243- # disabled until we renable new export
2244- # assert any(
2245- # "Exporting signal to xarray using direct method" in record.message
2246- # for record in caplog.records
2247- # )
2239+ assert any (
2240+ "Exporting signal to xarray using direct method" in record .message
2241+ for record in caplog .records
2242+ )
22482243
22492244 # The derived param should be a data variable with dims (x, y), not a coord
2250- # assert "derived" in xr_ds.data_vars
2251- # assert "derived" not in xr_ds.coords
2252- # assert xr_ds["derived"].dims == ("x", "y")
2245+ assert "derived" in xr_ds .data_vars
2246+ assert "derived" not in xr_ds .coords
2247+ assert xr_ds ["derived" ].dims == ("x" , "y" )
22532248
22542249 expected_signal = x_vals [:, None ] + y_vals [None , :]
2255- # expected_derived = 2.0 * expected_signal
2250+ expected_derived = 2.0 * expected_signal
22562251 np .testing .assert_allclose (xr_ds ["signal" ].values , expected_signal )
2257- # np.testing.assert_allclose(xr_ds["derived"].values, expected_derived)
2252+ np .testing .assert_allclose (xr_ds ["derived" ].values , expected_derived )
22582253
22592254
2260- @pytest .mark .skip (reason = "Disabled until we renable new export" )
22612255def test_with_without_shape_is_the_same (experiment : Experiment ) -> None :
22622256 nx , ny = 2 , 3
22632257 x_vals = np .linspace (0.0 , - 1.0 , nx )
0 commit comments