Skip to content

Commit

Permalink
More BACN fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AnjoMan committed Apr 11, 2019
1 parent f052198 commit 498e587
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions tests/test_carsons.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def geometric_mean_radius(self):
def wire_positions(self):
return {
'A': (0.762, 8.5344),
'B': (2.1336, 8.5344),
'C': (0, 8.5344),
'C': (2.1336, 8.5344),
'B': (0, 8.5344),
'N': (1.2192, 7.3152),
}

Expand Down Expand Up @@ -291,7 +291,7 @@ def test_unbalanced_carsons_equations(line, z_primitive_expected):
assert_array_almost_equal(
z_primitive_expected,
z_primitive_computed,
decimal=4)
)


@pytest.mark.parametrize(
Expand All @@ -303,7 +303,6 @@ def test_balanced_carsons_equations(line, z_primitive_expected):
assert_array_almost_equal(
z_primitive_expected,
z_primitive_computed,
decimal=4
)


Expand Down
18 changes: 9 additions & 9 deletions tests/test_multiple_neutrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def test_dual_neutral_model():
# resistance gmr (x, y)
# ==========================================
"A": (0.000115575, 0.00947938, (0.762, 8.5344)),
"B": (0.000115575, 0.00947938, (2.1336, 8.5344)),
"N1": (0.000115575, 0.00947938, (0.0, 8.5344)),
"N2": (0.000367852, 0.00248107, (0.0, 7.3152)),
"B": (0.000115575, 0.00947938, (0.0, 8.5344)),
"N1": (0.000115575, 0.00947938, (2.1336, 8.5344)),
"N2": (0.000367852, 0.00248107, (1.2192, 7.3152)),
}))
z_primitive = model.build_z_primitive()

Expand All @@ -32,23 +32,23 @@ def test_dual_neutral_model():
z_equivalent = numpy.delete(z_equivalent, 2, 0)
z_equivalent = numpy.delete(z_equivalent, 2, 1)
z_expected = ACBN_line_z_primitive()
assert_array_almost_equal(z_equivalent, z_expected, decimal=4)
assert_array_almost_equal(z_equivalent, z_expected)


def test_malformed_neutrals_are_ignored():
LINE_WITH_BAD_NEUTRAL_LABEL = LineModel({
# resistance gmr (x, y)
# ==========================================
"A": (0.000115575, 0.00947938, (0.762, 8.5344)),
"B": (0.000115575, 0.00947938, (2.1336, 8.5344)),
"C": (0.000115575, 0.00947938, (0.0, 8.5344)),
"N1": (0.000367852, 0.00248107, (0.0, 7.3152)),
"pN2": (0.000367852, 0.00248107, (1.2192, 7.3152)),
"C": (0.000115575, 0.00947938, (2.1336, 8.5344)),
"B": (0.000115575, 0.00947938, (0.0, 8.5344)),
"N1": (0.000367852, 0.00248107, (1.2192, 7.3152)),
"pN2": (0.000367852, 0.00248107, (0.0, 7.3152)),
})
model = CarsonsEquations(LINE_WITH_BAD_NEUTRAL_LABEL)
z_primitive = model.build_z_primitive()

assert z_primitive.shape == (4, 4)

z_expected = ACBN_line_z_primitive()
assert_array_almost_equal(z_primitive, z_expected, decimal=4)
assert_array_almost_equal(z_primitive, z_expected)

0 comments on commit 498e587

Please sign in to comment.