@@ -32,7 +32,7 @@ def memfile_with_ids(memfile, factory):
32
32
IDS2NC (ids , memfile ).run ()
33
33
# This one is valid:
34
34
ids = factory .core_profiles ()
35
- NC2IDS (memfile , ids , ids .metadata , None ).run ()
35
+ NC2IDS (memfile , ids , ids .metadata , None ).run (lazy = False )
36
36
return memfile
37
37
38
38
@@ -65,61 +65,61 @@ def test_invalid_units(memfile_with_ids, factory):
65
65
memfile_with_ids ["time" ].units = "hours"
66
66
ids = factory .core_profiles ()
67
67
with pytest .raises (InvalidNetCDFEntry ):
68
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
68
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
69
69
70
70
71
71
def test_invalid_documentation (memfile_with_ids , factory , caplog ):
72
72
ids = factory .core_profiles ()
73
73
with caplog .at_level ("WARNING" ):
74
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
74
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
75
75
assert not caplog .records
76
76
# Invalid docstring logs a warning
77
77
memfile_with_ids ["time" ].documentation = "https://en.wikipedia.org/wiki/Time"
78
78
with caplog .at_level ("WARNING" ):
79
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
79
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
80
80
assert len (caplog .records ) == 1
81
81
82
82
83
83
def test_invalid_dimension_name (memfile_with_ids , factory ):
84
84
memfile_with_ids .renameDimension ("time" , "T" )
85
85
ids = factory .core_profiles ()
86
86
with pytest .raises (InvalidNetCDFEntry ):
87
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
87
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
88
88
89
89
90
90
def test_invalid_coordinates (memfile_with_ids , factory ):
91
91
memfile_with_ids ["profiles_1d.grid.rho_tor_norm" ].coordinates = "xyz"
92
92
ids = factory .core_profiles ()
93
93
with pytest .raises (InvalidNetCDFEntry ):
94
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
94
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
95
95
96
96
97
97
def test_invalid_ancillary_variables (memfile_with_ids , factory ):
98
98
memfile_with_ids ["time" ].ancillary_variables = "xyz"
99
99
ids = factory .core_profiles ()
100
100
with pytest .raises (InvalidNetCDFEntry ):
101
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
101
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
102
102
103
103
104
104
def test_extra_attributes (memfile_with_ids , factory ):
105
105
memfile_with_ids ["time" ].new_attribute = [1 , 2 , 3 ]
106
106
ids = factory .core_profiles ()
107
107
with pytest .raises (InvalidNetCDFEntry ):
108
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
108
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
109
109
110
110
111
111
def test_shape_array_without_data (memfile_with_ids , factory ):
112
112
memfile_with_ids .createVariable ("profiles_1d.t_i_average:shape" , int , ())
113
113
ids = factory .core_profiles ()
114
114
with pytest .raises (InvalidNetCDFEntry ):
115
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
115
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
116
116
117
117
118
118
def test_shape_array_without_sparse_data (memfile_with_ids , factory ):
119
119
memfile_with_ids .createVariable ("profiles_1d.grid.rho_tor_norm:shape" , int , ())
120
120
ids = factory .core_profiles ()
121
121
with pytest .raises (InvalidNetCDFEntry ):
122
- NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run ()
122
+ NC2IDS (memfile_with_ids , ids , ids .metadata , None ).run (lazy = False )
123
123
124
124
125
125
def test_shape_array_with_invalid_dimensions (memfile_with_ids , factory ):
@@ -137,7 +137,7 @@ def test_shape_array_with_invalid_dimensions(memfile_with_ids, factory):
137
137
("time" , "profiles_1d.grid.rho_tor_norm:i" ),
138
138
)
139
139
with pytest .raises (InvalidNetCDFEntry ):
140
- NC2IDS (memfile_with_ids , cp , cp .metadata , None ).run ()
140
+ NC2IDS (memfile_with_ids , cp , cp .metadata , None ).run (lazy = False )
141
141
142
142
143
143
def test_shape_array_with_invalid_dtype (memfile_with_ids , factory ):
@@ -153,7 +153,7 @@ def test_shape_array_with_invalid_dtype(memfile_with_ids, factory):
153
153
"profiles_1d.t_i_average:shape" , float , ("time" , "1D" )
154
154
)
155
155
with pytest .raises (InvalidNetCDFEntry ):
156
- NC2IDS (memfile_with_ids , cp , cp .metadata , None ).run ()
156
+ NC2IDS (memfile_with_ids , cp , cp .metadata , None ).run (lazy = False )
157
157
158
158
159
159
def test_validate_nc (tmpdir ):
0 commit comments