@@ -1057,13 +1057,15 @@ PYBIND11_MODULE(pxr_qed, m) {
10571057 py::arg (" verbose" ) = py::bool_ (true ))
10581058 .def (" save_as" ,
10591059 [&](const bw_dndt_lookup_table &self, const std::string file_name){
1060- if (!self.is_init ())
1060+ if (!self.is_init ()){
10611061 throw_error (" Table must be initialized!" );
1062+ }
10621063 const auto raw = self.serialize ();
10631064 auto of = std::fstream (file_name,
10641065 std::ios::out | std::ios::binary);
1065- if ( !of )
1066+ if ( !of ){
10661067 throw_error (" Opening file failed!" );
1068+ }
10671069 of.write (raw.data (), raw.size ());
10681070 of.close ();
10691071 },
@@ -1127,13 +1129,15 @@ PYBIND11_MODULE(pxr_qed, m) {
11271129 py::arg (" verbose" ) = py::bool_ (true ))
11281130 .def (" save_as" ,
11291131 [&](const bw_pair_prod_lookup_table &self, const std::string file_name){
1130- if (!self.is_init ())
1132+ if (!self.is_init ()){
11311133 throw_error (" Table must be initialized!" );
1134+ }
11321135 const auto raw = self.serialize ();
11331136 auto of = std::fstream (file_name,
11341137 std::ios::out | std::ios::binary);
1135- if ( !of )
1138+ if ( !of ){
11361139 throw_error (" Opening file failed!" );
1140+ }
11371141 of.write (raw.data (), raw.size ());
11381142 of.close ();
11391143 },
@@ -1279,13 +1283,15 @@ PYBIND11_MODULE(pxr_qed, m) {
12791283 py::arg (" verbose" ) = py::bool_ (true ))
12801284 .def (" save_as" ,
12811285 [&](const qs_dndt_lookup_table &self, const std::string file_name){
1282- if (!self.is_init ())
1286+ if (!self.is_init ()){
12831287 throw_error (" Table must be initialized!" );
1288+ }
12841289 const auto raw = self.serialize ();
12851290 auto of = std::fstream (file_name,
12861291 std::ios::out | std::ios::binary);
1287- if ( !of )
1292+ if ( !of ){
12881293 throw_error (" Opening file failed!" );
1294+ }
12891295 of.write (raw.data (), raw.size ());
12901296 of.close ();
12911297 },
@@ -1349,13 +1355,15 @@ PYBIND11_MODULE(pxr_qed, m) {
13491355 py::arg (" verbose" ) = py::bool_ (true ))
13501356 .def (" save_as" ,
13511357 [&](const qs_photon_emission_lookup_table &self, const std::string file_name){
1352- if (!self.is_init ())
1358+ if (!self.is_init ()){
13531359 throw_error (" Table must be initialized!" );
1360+ }
13541361 const auto raw = self.serialize ();
13551362 auto of = std::fstream (file_name,
13561363 std::ios::out | std::ios::binary);
1357- if ( !of )
1364+ if ( !of ){
13581365 throw_error (" Opening file failed!" );
1366+ }
13591367 of.write (raw.data (), raw.size ());
13601368 of.close ();
13611369 },
@@ -1364,8 +1372,9 @@ PYBIND11_MODULE(pxr_qed, m) {
13641372 [&](qs_photon_emission_lookup_table &self, const std::string file_name){
13651373 auto input = std::ifstream (file_name,
13661374 std::ios::ate | std::ios::binary);
1367- if ( !input )
1375+ if ( !input ){
13681376 throw_error (" Opening file failed!" );
1377+ }
13691378 const auto pos = input.tellg ();
13701379 auto raw = rawVec (pos);
13711380
0 commit comments