Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate points for files with atomic mixing #9

Merged
merged 7 commits into from
Jul 5, 2024
Merged

Conversation

bobleesj
Copy link
Owner

@bobleesj bobleesj commented Jul 5, 2024

#7 has been fixed

The following test has been added to ensure duplicate points are removed for .cif files with atomic mixing.

@pytest.mark.fast
def test_remove_duplicate_connections():
    connections = {
        "CoM1": [
            ("CoM1", 2.618, [-1.33, -0.768, 1.06], [-1.33, 0.768, -1.06]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [-2.66, -1.536, 3.18]),
            ("CoM1", 2.618, [-1.33, -0.768, 1.06], [-2.66, -1.536, 3.18]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [-2.66, -1.536, -1.06]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [0.0, -1.536, 3.18]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [-1.33, 0.768, 3.18]),
        ],
        "OsM2": [
            ("OsM2", 2.618, [1.33, -0.768, 1.06], [2.66, -1.536, 3.18]),
            ("CoM1", 2.618, [1.33, -0.768, 1.06], [1.33, 0.768, 3.18]),
            ("OsM2", 2.618, [1.33, -0.768, 1.06], [1.33, 0.768, -1.06]),
            ("OsM2", 2.618, [1.33, -0.768, 1.06], [0.0, -1.536, 3.18]),
            ("CoM1", 2.618, [1.33, -0.768, 1.06], [1.33, 0.768, -1.06]),
            ("CoM1", 2.618, [1.33, -0.768, 1.06], [2.66, -1.536, 3.18]),
        ],
    }

    assert remove_duplicate_connections(connections) == {
        "CoM1": [
            ("CoM1", 2.618, [-1.33, -0.768, 1.06], [-1.33, 0.768, -1.06]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [-2.66, -1.536, 3.18]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [-2.66, -1.536, -1.06]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [0.0, -1.536, 3.18]),
            ("OsM2", 2.618, [-1.33, -0.768, 1.06], [-1.33, 0.768, 3.18]),
        ],
        "OsM2": [
            ("OsM2", 2.618, [1.33, -0.768, 1.06], [2.66, -1.536, 3.18]),
            ("CoM1", 2.618, [1.33, -0.768, 1.06], [1.33, 0.768, 3.18]),
            ("OsM2", 2.618, [1.33, -0.768, 1.06], [1.33, 0.768, -1.06]),
            ("OsM2", 2.618, [1.33, -0.768, 1.06], [0.0, -1.536, 3.18]),
        ],
    }

@bobleesj bobleesj changed the title Polyhedron Remove duplicate points for files with atomic mixing Jul 5, 2024
@bobleesj bobleesj added the bug Something isn't working label Jul 5, 2024
@bobleesj bobleesj merged commit e43eba5 into main Jul 5, 2024
6 checks passed
@bobleesj bobleesj deleted the polyhedron branch July 5, 2024 18:14
@bobleesj
Copy link
Owner Author

bobleesj commented Jul 5, 2024

261241_CoM1

Adding a polyhedron generated with atomic mixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant