Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nnn911 committed Aug 16, 2023
1 parent d326d8e commit 124c9ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
Expand Down
18 changes: 18 additions & 0 deletions tests/test_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,21 @@ def test_selection_fcc_settings(import_pipeline: Pipeline):

for k, v in expected.items():
assert data.attributes[k] == v


def test_fcc_distance_settings(import_pipeline: Pipeline):
pipe = import_pipeline
pipe.modifiers.append(ScoreBasedDenoising(scale=2.5, structure="FCC"))
pipe.modifiers.append(CommonNeighborAnalysisModifier())
data = pipe.compute()
expected = {
"CommonNeighborAnalysis.counts.BCC": 11,
"CommonNeighborAnalysis.counts.FCC": 7898,
"CommonNeighborAnalysis.counts.HCP": 214,
"CommonNeighborAnalysis.counts.ICO": 0,
"CommonNeighborAnalysis.counts.OTHER": 325,
}

assert len(data.tables["Convergence"].xy()) == 8
for k, v in expected.items():
assert data.attributes[k] == v

0 comments on commit 124c9ec

Please sign in to comment.