Пример #1
0
 def test_current_unbalance_nema(self):
     np.testing.assert_allclose(
         acnsim.current_unbalance(self.sim, ['Primary A', 'Primary B', 'Primary C']),
         np.array(self.edf_algo_true_analysis_dict['primary_current_unbalance_nema']))
     np.testing.assert_allclose(
         acnsim.current_unbalance(self.sim, ['Secondary A', 'Secondary B', 'Secondary C']),
         np.array(self.edf_algo_true_analysis_dict['secondary_current_unbalance_nema']))
Пример #2
0
 def test_current_unbalance_nema(self):
     # A RuntimeWarning is expected to be raised in this test case as
     # of acnportal v.1.0.3. See Github issue #57 for a discussion of
     # why this occurs.
     with self.assertWarns(RuntimeWarning):
         np.testing.assert_allclose(
             acnsim.current_unbalance(self.sim, ['Primary A', 'Primary B', 'Primary C']),
             np.array(self.edf_algo_true_analysis_dict['primary_current_unbalance_nema']))
     with self.assertWarns(RuntimeWarning):
         np.testing.assert_allclose(
             acnsim.current_unbalance(self.sim, ['Secondary A', 'Secondary B', 'Secondary C']),
             np.array(self.edf_algo_true_analysis_dict['secondary_current_unbalance_nema']))
Пример #3
0
 def test_current_unbalance_nema(self) -> None:
     # A RuntimeWarning is expected to be raised in this test case as
     # of acnportal v.1.0.3. See Github issue #57 for a discussion of
     # why this occurs.
     with self.assertWarns(RuntimeWarning):
         np.testing.assert_allclose(
             acnsim.current_unbalance(
                 self.sim, ["Primary A", "Primary B", "Primary C"]),
             np.array(self.edf_algo_true_analysis_dict[
                 "primary_current_unbalance_nema"]),
             atol=1e-6,
         )
     with self.assertWarns(RuntimeWarning):
         np.testing.assert_allclose(
             acnsim.current_unbalance(
                 self.sim, ["Secondary A", "Secondary B", "Secondary C"]),
             np.array(self.edf_algo_true_analysis_dict[
                 "secondary_current_unbalance_nema"]),
             atol=1e-6,
         )
Пример #4
0
 def test_current_unbalance_nema_warning(self) -> None:
     with self.assertWarns(DeprecationWarning):
         acnsim.current_unbalance(self.sim,
                                  ["Primary A", "Primary B", "Primary C"],
                                  type="NEMA")
Пример #5
0
 def test_current_unbalance_nema_error(self) -> None:
     with self.assertRaises(ValueError):
         acnsim.current_unbalance(self.sim,
                                  ["Primary A", "Primary B", "Primary C"],
                                  unbalance_type="ABC")
Пример #6
0
 def test_current_unbalance_nema_warning(self):
     with self.assertWarns(DeprecationWarning):
         acnsim.current_unbalance(self.sim, ['Primary A', 'Primary B', 'Primary C'], type='NEMA')
Пример #7
0
 def test_current_unbalance_nema_error(self):
     with self.assertRaises(ValueError):
         acnsim.current_unbalance(self.sim, ['Primary A', 'Primary B', 'Primary C'], unbalance_type='ABC')