@@ -50,7 +50,9 @@ def get_absolute_path(self, partial_path):
50
50
51
51
@property
52
52
def tardis_config_verysimple (self ):
53
- filename = self .get_absolute_path ("tardis/io/configuration/tests/data/tardis_configv1_verysimple.yml" )
53
+ filename = self .get_absolute_path (
54
+ "tardis/io/configuration/tests/data/tardis_configv1_verysimple.yml"
55
+ )
54
56
return yaml_load_file (
55
57
filename ,
56
58
YAMLLoader ,
@@ -60,7 +62,7 @@ def tardis_config_verysimple(self):
60
62
def tardis_ref_path (self ):
61
63
# TODO: This route is fixed but needs to get from the arguments given in the command line.
62
64
# /app/tardis-refdata
63
- return ' /app/tardis-refdata'
65
+ return " /app/tardis-refdata"
64
66
65
67
@property
66
68
def atomic_dataset (self ) -> AtomData :
@@ -74,10 +76,15 @@ def atomic_dataset(self) -> AtomData:
74
76
75
77
@property
76
78
def atomic_data_fname (self ):
77
- atomic_data_fname = f"{ self .tardis_ref_path } /atom_data/kurucz_cd23_chianti_H_He.h5"
79
+ atomic_data_fname = (
80
+ f"{ self .tardis_ref_path } /atom_data/kurucz_cd23_chianti_H_He.h5"
81
+ )
78
82
79
83
if not Path (atomic_data_fname ).exists ():
80
- atom_data_missing_str = f"{ atomic_data_fname } atomic datafiles " f"does not seem to exist"
84
+ atom_data_missing_str = (
85
+ f"{ atomic_data_fname } atomic datafiles "
86
+ f"does not seem to exist"
87
+ )
81
88
raise Exception (atom_data_missing_str )
82
89
83
90
return atomic_data_fname
@@ -92,22 +99,24 @@ def hdf_file_path(self):
92
99
# ASV create a temporal directory in runtime per test: `tmpiuxngvlv`.
93
100
# The ASV and ASV_Runner, not has some way to get this temporal directory.
94
101
# The idea is use this temporal folders to storage this created temporal file.
95
- _ , path = mkstemp (' -tardis-benchmark-hdf_buffer-test.hdf' )
102
+ _ , path = mkstemp (" -tardis-benchmark-hdf_buffer-test.hdf" )
96
103
return path
97
104
98
105
def create_temporal_file (self , suffix = None ):
99
106
# TODO: Delete this files after ASV runs the benchmarks.
100
107
# ASV create a temporal directory in runtime per test: `tmpiuxngvlv`.
101
108
# The ASV and ASV_Runner, not has some way to get this temporal directory.
102
109
# The idea is use this temporal folders to storage this created temporal file.
103
- suffix_str = '' if suffix is None else f' -{ suffix } '
110
+ suffix_str = "" if suffix is None else f" -{ suffix } "
104
111
_ , path = mkstemp (suffix_str )
105
112
return path
106
113
107
114
@property
108
115
def gamma_ray_simulation_state (self ):
109
116
self .gamma_ray_config .model .structure .velocity .start = 1.0 * u .km / u .s
110
- self .gamma_ray_config .model .structure .density .rho_0 = 5.0e2 * u .g / u .cm ** 3
117
+ self .gamma_ray_config .model .structure .density .rho_0 = (
118
+ 5.0e2 * u .g / u .cm ** 3
119
+ )
111
120
self .gamma_ray_config .supernova .time_explosion = 150 * u .d
112
121
113
122
return SimulationState .from_config (
@@ -116,9 +125,7 @@ def gamma_ray_simulation_state(self):
116
125
117
126
@property
118
127
def gamma_ray_config (self ):
119
- yml_path = (
120
- f"{ self .example_configuration_dir } /tardis_configv1_density_exponential_nebular_multi_isotope.yml"
121
- )
128
+ yml_path = f"{ self .example_configuration_dir } /tardis_configv1_density_exponential_nebular_multi_isotope.yml"
122
129
123
130
return config_reader .Configuration .from_yaml (yml_path )
124
131
@@ -137,7 +144,9 @@ def example_csvy_file_dir(self):
137
144
@property
138
145
def simulation_verysimple (self ):
139
146
atomic_data = deepcopy (self .atomic_dataset )
140
- sim = Simulation .from_config (self .config_verysimple , atom_data = atomic_data )
147
+ sim = Simulation .from_config (
148
+ self .config_verysimple , atom_data = atomic_data
149
+ )
141
150
sim .iterate (4000 )
142
151
return sim
143
152
@@ -149,11 +158,11 @@ def config_verysimple(self):
149
158
150
159
class CustomPyTestRequest :
151
160
def __init__ (
152
- self ,
153
- tardis_regression_data_path : str ,
154
- node_name : str ,
155
- node_module_name : str ,
156
- regression_data_dir : str ,
161
+ self ,
162
+ tardis_regression_data_path : str ,
163
+ node_name : str ,
164
+ node_module_name : str ,
165
+ regression_data_dir : str ,
157
166
):
158
167
self .tardis_regression_data_path = tardis_regression_data_path
159
168
self .node_name = node_name
@@ -165,7 +174,7 @@ def config(self):
165
174
class SubClass :
166
175
@staticmethod
167
176
def getoption (option ):
168
- if option == ' --tardis-regression-data' :
177
+ if option == " --tardis-regression-data" :
169
178
return self .tardis_regression_data_path
170
179
return None
171
180
@@ -190,6 +199,7 @@ def __init__(self, parent):
190
199
@property
191
200
def __name__ (self ):
192
201
return self .parent .node_module_name
202
+
193
203
return SubSubClass (self .parent )
194
204
195
205
return SubClass (self )
@@ -219,12 +229,16 @@ def packet(self):
219
229
220
230
@property
221
231
def verysimple_packet_collection (self ):
222
- return self .nb_simulation_verysimple .transport .transport_state .packet_collection
232
+ return (
233
+ self .nb_simulation_verysimple .transport .transport_state .packet_collection
234
+ )
223
235
224
236
@property
225
237
def nb_simulation_verysimple (self ):
226
238
atomic_data = deepcopy (self .atomic_dataset )
227
- sim = Simulation .from_config (self .config_verysimple , atom_data = atomic_data )
239
+ sim = Simulation .from_config (
240
+ self .config_verysimple , atom_data = atomic_data
241
+ )
228
242
sim .iterate (10 )
229
243
return sim
230
244
@@ -238,7 +252,8 @@ def verysimple_numba_model(self):
238
252
@property
239
253
def verysimple_opacity_state (self ):
240
254
return opacity_state_initialize (
241
- self .nb_simulation_verysimple .plasma , line_interaction_type = "macroatom"
255
+ self .nb_simulation_verysimple .plasma ,
256
+ line_interaction_type = "macroatom" ,
242
257
)
243
258
244
259
@property
@@ -275,13 +290,17 @@ def verysimple_3vpacket_collection(self):
275
290
276
291
@property
277
292
def verysimple_numba_radial_1d_geometry (self ):
278
- return self .nb_simulation_verysimple .simulation_state .geometry .to_numba ()
293
+ return (
294
+ self .nb_simulation_verysimple .simulation_state .geometry .to_numba ()
295
+ )
279
296
280
297
@property
281
298
def simulation_verysimple_vpacket_tracking (self ):
282
299
atomic_data = deepcopy (self .atomic_dataset )
283
300
sim = Simulation .from_config (
284
- self .config_verysimple , atom_data = atomic_data , virtual_packet_logging = True
301
+ self .config_verysimple ,
302
+ atom_data = atomic_data ,
303
+ virtual_packet_logging = True ,
285
304
)
286
305
sim .last_no_of_packets = 4000
287
306
sim .run_final ()
@@ -304,5 +323,7 @@ def tardis_ref_data(self):
304
323
mode = "w"
305
324
else :
306
325
mode = "r"
307
- with pd .HDFStore (f"{ self .tardis_ref_path } /unit_test_data.h5" , mode = mode ) as store :
326
+ with pd .HDFStore (
327
+ f"{ self .tardis_ref_path } /unit_test_data.h5" , mode = mode
328
+ ) as store :
308
329
yield store
0 commit comments