Commit 2a9a4ffb authored by Joseph Weston's avatar Joseph Weston
Browse files

prefer explicit 'allclose' to equality checking

__eq__ for Models just uses allclose anyway.
parent a5cb1ac1
...@@ -286,7 +286,7 @@ def test_inverse_transform(): ...@@ -286,7 +286,7 @@ def test_inverse_transform():
# Convert it back # Convert it back
ham2 = builder_to_model(syst) ham2 = builder_to_model(syst)
# Check that it's the same as the original # Check that it's the same as the original
assert fam == ham2 assert fam.allclose(ham2)
# Check that the Hamiltonians are identical at random points in the Brillouin zone # Check that the Hamiltonians are identical at random points in the Brillouin zone
sysw = kwant.wraparound.wraparound(syst).finalized() sysw = kwant.wraparound.wraparound(syst).finalized()
...@@ -378,8 +378,8 @@ def test_consistency_kwant(): ...@@ -378,8 +378,8 @@ def test_consistency_kwant():
Ham1 = builder_to_model(model_syst, momenta=Ham.momenta) Ham1 = builder_to_model(model_syst, momenta=Ham.momenta)
# From the pure Kwant builder # From the pure Kwant builder
Ham2 = builder_to_model(kwant_syst, momenta=Ham.momenta) Ham2 = builder_to_model(kwant_syst, momenta=Ham.momenta)
assert Ham == Ham1 assert Ham.allclose(Ham1)
assert Ham == Ham2 assert Ham.allclose(Ham2)
def test_find_builder_discrete_symmetries(): def test_find_builder_discrete_symmetries():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment