Coverage for src/distopf/__init__.py: 100%

20 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-11-13 17:34 -0800

1# fmt: on 

2from distopf.dss_importer.dss_to_csv_converter import DSSToCSVConverter 

3from distopf.matrix_models.lindist_loads import LinDistModelL 

4from distopf.matrix_models.lindist_capacitor_mi import LinDistModelCapMI 

5 

6# from distopf.lindist_fast_base import LinDistBase 

7from distopf.matrix_models.lindist_capacitor_regulator_mi import ( 

8 LinDistModelCapacitorRegulatorMI, 

9) 

10from distopf.matrix_models.lindist import LinDistModel 

11from distopf.matrix_models.solvers import ( 

12 cvxpy_mi_solve, 

13 cvxpy_solve, 

14 lp_solve, 

15) 

16from distopf.matrix_models.objectives import ( 

17 gradient_load_min, 

18 gradient_curtail, 

19 cp_obj_loss, 

20 cp_obj_target_p_3ph, 

21 cp_obj_target_p_total, 

22 cp_obj_target_q_3ph, 

23 cp_obj_target_q_total, 

24 cp_obj_curtail, 

25 cp_obj_none, 

26) 

27from distopf.plot import ( 

28 plot_network, 

29 plot_voltages, 

30 plot_power_flows, 

31 plot_ders, 

32 compare_flows, 

33 compare_voltages, 

34 voltage_differences, 

35 plot_polar, 

36 plot_gens, 

37 plot_pq, 

38 plot_batteries, 

39) 

40 

41from distopf.cases import CASES_DIR 

42 

43from distopf.distOPF import DistOPFCase, create_model, auto_solve 

44 

45from distopf.utils import ( 

46 get, 

47 handle_bus_input, 

48 handle_branch_input, 

49 handle_gen_input, 

50 handle_cap_input, 

51 handle_bat_input, 

52 handle_reg_input, 

53 handle_schedules_input, 

54) 

55 

56# bus_type options 

57SWING_FREE = "IN" 

58PQ_FREE = "OUT" 

59SWING_BUS = "SWING" 

60PQ_BUS = "PQ" 

61# generator mode options 

62CONSTANT_PQ = "" 

63CONSTANT_P = "Q" 

64CONSTANT_Q = "P" 

65CONTROL_PQ = "PQ" 

66# fmt: on 

67 

68 

69__all__ = [ 

70 "DSSToCSVConverter", 

71 "LinDistModelL", 

72 "LinDistModelCapMI", 

73 "LinDistModelCapacitorRegulatorMI", 

74 "LinDistModel", 

75 "cvxpy_mi_solve", 

76 "cvxpy_solve", 

77 "lp_solve", 

78 "gradient_load_min", 

79 "gradient_curtail", 

80 "cp_obj_loss", 

81 "cp_obj_target_p_3ph", 

82 "cp_obj_target_p_total", 

83 "cp_obj_target_q_3ph", 

84 "cp_obj_target_q_total", 

85 "cp_obj_curtail", 

86 "cp_obj_none", 

87 "plot_network", 

88 "plot_voltages", 

89 "plot_power_flows", 

90 "plot_ders", 

91 "compare_flows", 

92 "compare_voltages", 

93 "voltage_differences", 

94 "plot_polar", 

95 "plot_gens", 

96 "plot_pq", 

97 "plot_batteries", 

98 "CASES_DIR", 

99 "DistOPFCase", 

100 "create_model", 

101 "auto_solve", 

102 "get", 

103 "handle_bat_input", 

104 "handle_branch_input", 

105 "handle_bus_input", 

106 "handle_cap_input", 

107 "handle_gen_input", 

108 "handle_schedules_input", 

109 "handle_reg_input", 

110 "SWING_FREE", 

111 "PQ_FREE", 

112 "SWING_BUS", 

113 "PQ_BUS", 

114 "CONSTANT_PQ", 

115 "CONSTANT_P", 

116 "CONSTANT_Q", 

117 "CONTROL_PQ", 

118]