Coverage for sparkle/CLI/status.py: 0%

25 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-27 09:10 +0000

1#!/usr/bin/env python3 

2"""Command to display the status of the platform.""" 

3 

4import sys 

5import argparse 

6 

7from sparkle.CLI.initialise import check_for_initialise 

8from sparkle.CLI.help import global_variables as gv 

9from sparkle.CLI.help import system_status as sssh 

10from sparkle.CLI.help import logging as sl 

11from sparkle.CLI.help import argparse_custom as ac 

12 

13 

14def parser_function() -> argparse.ArgumentParser: 

15 """Define the command line arguments.""" 

16 parser = argparse.ArgumentParser() 

17 parser.add_argument(*ac.VerboseArgument.names, 

18 **ac.VerboseArgument.kwargs) 

19 return parser 

20 

21 

22if __name__ == "__main__": 

23 # Log command call 

24 sl.log_command(sys.argv) 

25 

26 # Define command line arguments 

27 parser = parser_function() 

28 

29 # Process command line arguments 

30 args = parser.parse_args() 

31 

32 check_for_initialise() 

33 

34 print("Reporting current system status of Sparkle ...") 

35 sssh.print_sparkle_list([s for s in gv.settings().DEFAULT_solver_dir.iterdir()], 

36 "Solver", args.verbose) 

37 sssh.print_sparkle_list([e for e in gv.settings().DEFAULT_extractor_dir.iterdir()], 

38 "Extractor", args.verbose) 

39 sssh.print_sparkle_list([i for i in gv.settings().DEFAULT_instance_dir.iterdir()], 

40 "Instance Set", args.verbose) 

41 

42 sssh.print_feature_computation_jobs( 

43 gv.settings().DEFAULT_feature_data_path, args.verbose 

44 ) 

45 sssh.print_performance_computation_jobs( 

46 gv.settings().DEFAULT_performance_data_path, args.verbose 

47 ) 

48 

49 # scan configurator log files for warnings 

50 configurator = gv.settings().get_general_sparkle_configurator() 

51 configurator.get_status_from_logs() 

52 

53 print("\nCurrent system status of Sparkle reported!")