Coverage for mlair/run_script.py: 33%

7 statements  

« prev     ^ index     » next       coverage.py v6.4.2, created at 2023-12-18 17:51 +0000

1__author__ = "Lukas Leufen" 

2__date__ = '2020-06-29' 

3 

4from mlair.workflows import DefaultWorkflow 

5import inspect 

6 

7 

8def run(stations=None, 

9 train_model=None, create_new_model=None, 

10 window_history_size=None, 

11 experiment_date="testrun", 

12 variables=None, statistics_per_var=None, 

13 start=None, end=None, 

14 target_var=None, target_dim=None, 

15 window_lead_time=None, 

16 dimensions=None, 

17 interpolation_method=None, interpolation_dim=None, interpolation_limit=None, 

18 train_start=None, train_end=None, val_start=None, val_end=None, test_start=None, test_end=None, 

19 use_all_stations_on_all_data_sets=None, fraction_of_train=None, 

20 experiment_path=None, plot_path=None, forecast_path=None, bootstrap_path=None, overwrite_local_data=None, 

21 sampling=None, 

22 permute_data_on_training=None, extreme_values=None, extremes_on_right_tail_only=None, 

23 transformation=None, 

24 train_min_length=None, val_min_length=None, test_min_length=None, 

25 evaluate_bootstraps=None, number_of_bootstraps=None, create_new_bootstraps=None, 

26 plot_list=None, 

27 model=None, 

28 batch_size=None, 

29 epochs=None, 

30 data_handler=None, 

31 **kwargs): 

32 

33 params = inspect.getfullargspec(DefaultWorkflow).args 

34 kwargs_default = {k: v for k, v in locals().items() if k in params and v is not None} 

35 

36 workflow = DefaultWorkflow(**kwargs_default, **kwargs) 

37 workflow.run() 

38 

39 

40if __name__ == "__main__": 

41 from mlair.model_modules.model_class import MyBranchedModel 

42 run(statistics_per_var={'o3': 'dma8eu', "temp": "maximum"}, train_model=True, 

43 create_new_model=True, model=MyBranchedModel, station_type="background")