Exemplo n.º 1
0
 def test_calculate_mw_miles_many_scaled_two_branches_excluded(self):
     mock_ct = {"branch": {"branch_id": {11: 2, 12: 3, 13: 1.5, 14: 1.2, 15: 3}}}
     expected_mw_miles = {
         "mw_miles": 9125.027895725,
         "transformer_mw": 108,
         "num_lines": 1,
         "num_transformers": 2,
     }
     mw_miles = _calculate_mw_miles(self.grid, mock_ct, exclude_branches=[11, 13])
     self._check_expected_values(mw_miles, expected_mw_miles)
Exemplo n.º 2
0
 def test_calculate_mw_miles_one_transformer_scaled(self):
     mock_ct = {"branch": {"branch_id": {13: 2.5}}}
     expected_mw_miles = {
         "mw_miles": 0,
         "transformer_mw": 45,
         "num_lines": 0,
         "num_transformers": 1,
     }
     mw_miles = _calculate_mw_miles(self.grid, mock_ct)
     self._check_expected_values(mw_miles, expected_mw_miles)
Exemplo n.º 3
0
 def test_calculate_mw_miles_many_scaled(self):
     mock_ct = {"branch": {"branch_id": {11: 2, 12: 3, 13: 1.5, 14: 1.2, 15: 3}}}
     expected_mw_miles = {
         "mw_miles": 15917.06341095,
         "transformer_mw": 123,
         "num_lines": 2,
         "num_transformers": 3,
     }
     mw_miles = _calculate_mw_miles(self.grid, mock_ct)
     self._check_expected_values(mw_miles, expected_mw_miles)
Exemplo n.º 4
0
 def test_calculate_mw_miles_no_scale(self):
     mock_ct = {"branch": {"branch_id": {}}}
     expected_mw_miles = {k: 0 for k in expected_keys}
     mw_miles = _calculate_mw_miles(self.grid, mock_ct)
     self._check_expected_values(mw_miles, expected_mw_miles)