-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from d-SEAMS/addCI
CI: Add a basic test
- Loading branch information
Showing
10 changed files
with
433 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: "Build pyseams and test" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
build_test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: environment.yml | ||
|
||
- name: Build pyseams | ||
shell: bash -l {0} | ||
run: | | ||
micromamba activate pyseamsdev | ||
meson setup bbdir | ||
meson compile -C bbdir | ||
- name: Run a test | ||
shell: bash -l {0} | ||
run: | | ||
python -c 'import bbdir.cyoda' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import bbdir.cyoda as cyoda | ||
trajectory ="subprojects/seams-core/input/traj/clathrate-thf.lammpstrj" | ||
|
||
#Get the frame | ||
resCloud = cyoda.readLammpsTrjreduced( | ||
filename = trajectory, | ||
targetFrame = 1, | ||
typeI = 1, #oxygenAtomType | ||
isSlice = True, | ||
coordLow = [0,0,0], | ||
coordHigh = [34.728,0,0], | ||
) | ||
|
||
#Calculate the neighborlist by ID | ||
nList = cyoda.neighListO( | ||
rcutoff = 3.5, | ||
yCloud = resCloud, | ||
typeI = 1, #oxygenAtomType | ||
) | ||
|
||
#Get the hydrogen-bonded network for the current frame | ||
hbnList = cyoda.populateHbonds( | ||
filename = trajectory, | ||
yCloud = resCloud, | ||
nList = nList, | ||
targetFrame = 1, | ||
Htype = 2, #hydrogen atom type | ||
) | ||
|
||
#Hydrogen-bonded network using indices not IDs | ||
hbnList = cyoda.neighbourListByIndex( | ||
yCloud = resCloud, | ||
nList = hbnList, | ||
) | ||
|
||
#Gets every ring (non-primitives included) | ||
rings = cyoda.ringNetwork( | ||
nList = hbnList, | ||
maxDepth = 6, | ||
) | ||
|
||
#Writes out primitive rings for a bulk system | ||
ring = cyoda.bulkPolygonRingAnalysis( | ||
path = "runOne/", #outDir | ||
rings = rings, | ||
nList = hbnList, | ||
yCloud = resCloud, | ||
maxDepth = 6, | ||
firstFrame = 1, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import bbdir.cyoda as cyoda | ||
trajectory ="subprojects/seams-core/input/traj/cluster-417.lammpstrj" | ||
|
||
#Get the frame | ||
resCloud = cyoda.readLammpsTrjreduced( | ||
filename = trajectory, | ||
targetFrame = 1302, | ||
typeI = 1, #oxygenAtomType | ||
isSlice = False, | ||
coordLow = [0,0,0], | ||
coordHigh = [0,0,0], | ||
) | ||
|
||
#Calculate the neighborlist by ID | ||
nList = cyoda.neighListO( | ||
rcutoff = 3.5, | ||
yCloud = resCloud, | ||
typeI = 1, #oxygenAtomType | ||
) | ||
solCloud = cyoda.PointCloudDouble() | ||
iceList = [] | ||
clump = cyoda.clusterAnalysis( | ||
path = "runOne/", #outDir | ||
iceCloud = solCloud, | ||
yCloud = resCloud, | ||
nList = nList, | ||
iceNeighbourList = iceList, | ||
cutoff = 3.5, | ||
firstFrame = 1302, | ||
bopAnalysis = "q6", | ||
) | ||
|
||
#Gets every ring (non-primitives included) | ||
rings = cyoda.ringNetwork( | ||
nList = iceList, | ||
maxDepth = 6, | ||
) | ||
|
||
#Finds DDCs and HCs | ||
tum3 = cyoda.topoUnitMatchingBulk( | ||
path = "runOne/", #outDir | ||
rings = rings, | ||
iceNeighbourList = iceList, | ||
yCloud = solCloud, | ||
firstFrame = 1302, | ||
printClusters = True, | ||
onlyTetrahedral = False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import bbdir.cyoda as cyoda | ||
trajectory ="input/traj/mW_cubic.lammpstrj" | ||
|
||
solCloud = cyoda.PointCloudDouble() | ||
iceList = [] | ||
|
||
#Get the frame | ||
resCloud = cyoda.readLammpsTrjO( | ||
filename = trajectory, | ||
targetFrame = 1, | ||
type0 = 1, #oxygenAtomType | ||
isSlice = False, | ||
coordLow = [0,0,0], | ||
coordHigh = [50,0,0], | ||
) | ||
|
||
#Calculate the neighborlist by ID | ||
nList = cyoda.neighListO( | ||
rcutoff = 3.5, | ||
yCloud = resCloud, | ||
type0 = 1, #oxygenAtomType | ||
) | ||
|
||
#Calculate Cij (cloud,slice) | ||
resCloud = cyoda.getCorrelPlus( | ||
yCloud = resCloud, | ||
nList = nList, | ||
isSlice = False, | ||
) | ||
|
||
#Write out data (cloud,slice,name) | ||
resCloud = cyoda.getIceTypePlus( | ||
yCloud = resCloud, | ||
nList = nList, | ||
path = "runOne/", | ||
firstFrame = 1, | ||
isSlice = False | ||
outputFileName = "chillPlus.txt", | ||
) | ||
|
||
#Dump the rescloud which currently has CHILL Plus classifications | ||
cyoda.writeDump( | ||
yCloud = resCloud, | ||
path = "runOne/", | ||
outFile = "waterChillP.lammpstrj", | ||
) | ||
|
||
#Average Q6 (cloud,slice) | ||
avgQ6 = cyoda.getq6( | ||
yCloud = resCloud, | ||
nList = nList, | ||
isSlice = False, | ||
) | ||
|
||
#Modification (cloud,q6) | ||
resCloud = cyoda.reclassifyWater( | ||
yCloud = resCloud, | ||
q6 = avgQ6, | ||
) | ||
|
||
#Post reclassification writeOut | ||
cyoda.printIceType( | ||
yCloud = resCloud, | ||
path = "runOne/", | ||
firstFrame = 1, | ||
isSlice = False, | ||
outputFileName = "chillPlus.txt", | ||
) | ||
|
||
#Dump the rescloud which now has the supaa CHILL Plus Trajectory | ||
cyoda.writeDump( | ||
yCloud = resCloud, | ||
path = "runOne/", | ||
outFile = "waterSupaaP.lammpstrj", | ||
) | ||
|
||
#Get the largest ice cluster. Here, iceNeighbourList is the neighbour list by index. | ||
cyoda.clusterAnalysis( | ||
path = "runOne/", | ||
iceCloud = solCloud, | ||
yCloud = resCloud, | ||
nList = nList, | ||
iceNeighbourList = iceList, | ||
cutoff = 3.5, | ||
firstFrame = 1, | ||
bopAnalysis = "q6", | ||
) | ||
|
||
#Recenter the cluster such that the centroid is at the center of the simulation box | ||
cyoda.recenterClusterCloud( | ||
iceCloud = solCloud, | ||
nList = iceList, | ||
) | ||
|
||
#Dump the recentered largest ice cluster | ||
cyoda.writeDump( | ||
yCloud = resCloud, | ||
path = "runOne/", | ||
outFile = "largestIce.lammpstrj", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ dependencies: | |
- eigen==3.4.0 | ||
# Python | ||
- pdm | ||
- pybind11 | ||
- pybind11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.