23
23
24
24
class init_tools (abc .ABC ):
25
25
26
- def init_output_infrastructure (self ):
26
+ def init_output_infrastructure (self ) -> None :
27
27
"""Initialize the output infrastructure (folder and save lists).
28
28
29
29
This method is the first called in the initialization of the
@@ -42,7 +42,7 @@ def init_output_infrastructure(self):
42
42
self ._save_var_list = dict () # dict of variables to save
43
43
self ._save_var_list ['meta' ] = dict () # set up meta dict
44
44
45
- def init_logger (self ):
45
+ def init_logger (self ) -> None :
46
46
"""Initialize a logger.
47
47
48
48
The logger is initialized regardless of the value of ``self.verbose``.
@@ -73,7 +73,7 @@ def init_logger(self):
73
73
self .log_info ('Platform: {}' .format (platform .platform ()),
74
74
verbosity = 0 ) # log the os
75
75
76
- def import_files (self , kwargs_dict = {}):
76
+ def import_files (self , kwargs_dict = {}) -> None :
77
77
"""Import the input files.
78
78
79
79
This method handles the parsing and validation of any options supplied
@@ -181,7 +181,7 @@ def import_files(self, kwargs_dict={}):
181
181
else :
182
182
self ._netcdf_coords = ('time' , 'x' , 'y' )
183
183
184
- def process_input_to_model (self ):
184
+ def process_input_to_model (self ) -> None :
185
185
"""Process input file to model variables.
186
186
187
187
Loop through the items specified in the model configuration and apply
@@ -210,7 +210,7 @@ def process_input_to_model(self):
210
210
var = k , val = v )
211
211
self .log_info (_msg , verbosity = 0 )
212
212
213
- def determine_random_seed (self ):
213
+ def determine_random_seed (self ) -> None :
214
214
"""Set the random seed if given.
215
215
216
216
If a random seed is specified, set the seed to this value.
@@ -227,7 +227,7 @@ def determine_random_seed(self):
227
227
_msg = 'Random seed is: %s ' % str (self ._seed )
228
228
self .log_info (_msg , verbosity = 0 )
229
229
230
- def create_other_variables (self ):
230
+ def create_other_variables (self ) -> None :
231
231
"""Model implementation variables.
232
232
233
233
Creates variables for model implementation, from specified boundary
@@ -282,7 +282,7 @@ def create_other_variables(self):
282
282
283
283
self ._is_finalized = False
284
284
285
- def set_constants (self ):
285
+ def set_constants (self ) -> None :
286
286
"""Set the model constants.
287
287
288
288
Configure constants, including coordinates and distances, as well as
@@ -342,7 +342,7 @@ def set_constants(self):
342
342
[1 , 0 , 1 ],
343
343
[1 , 1 , 1 ]]).astype (np .int64 )
344
344
345
- def create_boundary_conditions (self ):
345
+ def create_boundary_conditions (self ) -> None :
346
346
"""Create model boundary conditions
347
347
348
348
This method is run during model initialization to determine the
@@ -415,7 +415,7 @@ def create_boundary_conditions(self):
415
415
self .diffusion_multiplier = (self ._dt / self .N_crossdiff * self ._alpha
416
416
* 0.5 / self ._dx ** 2 )
417
417
418
- def create_domain (self ):
418
+ def create_domain (self ) -> None :
419
419
"""Create the model domain.
420
420
421
421
This method initializes the model domain, including coordinate arrays,
@@ -521,7 +521,7 @@ def create_domain(self):
521
521
self .inlet = np .array (np .unique (np .where (self .cell_type == 1 )[1 ]))
522
522
self .eta [:] = self .stage - self .depth
523
523
524
- def init_sediment_routers (self ):
524
+ def init_sediment_routers (self ) -> None :
525
525
"""Initialize the sediment router object here.
526
526
527
527
These are preinitialized because the "boxing" for jitted functions is
@@ -555,7 +555,7 @@ def init_sediment_routers(self):
555
555
self ._beta , self .stepmax ,
556
556
self .theta_sand )
557
557
558
- def init_output_file (self ):
558
+ def init_output_file (self ) -> None :
559
559
"""Creates a netCDF file to store output grids.
560
560
561
561
Fills with default variables.
@@ -679,7 +679,7 @@ def _create_meta_variable(varname, varvalue, varunits,
679
679
_msg = 'Output netCDF file created'
680
680
self .log_info (_msg , verbosity = 2 )
681
681
682
- def init_subsidence (self ):
682
+ def init_subsidence (self ) -> None :
683
683
"""Initialize subsidence pattern.
684
684
685
685
Initializes patterns of subsidence if toggle_subsidence is True
@@ -702,7 +702,7 @@ def init_subsidence(self):
702
702
703
703
self .sigma = self .subsidence_mask * self ._subsidence_rate * self .dt
704
704
705
- def init_metadata_list (self ):
705
+ def init_metadata_list (self ) -> None :
706
706
"""Populate the list of metadata information.
707
707
708
708
Sets up the dictionary object for the standard metadata.
0 commit comments