Skip to content

Commit

Permalink
Merge pull request #1407 from virtualcell/nightly_testing_patch
Browse files Browse the repository at this point in the history
Nightly testing patch
  • Loading branch information
CodeByDrescher authored Jan 7, 2025
2 parents 8c361ab + 0eb0c7d commit c9a6eac
Show file tree
Hide file tree
Showing 18 changed files with 1,446 additions and 1,236 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/NightlyBMDB_CLI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

env:
python-version: "3.10"
poetry-version: "1.2.1"
poetry-version: "2.0"

jobs:
build:
Expand Down Expand Up @@ -379,5 +379,11 @@ jobs:
- name: Post results to slack part 3 (report.md from exec-report CLI command)
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="$(cat ${GITHUB_WORKSPACE}/report.md)" https://slack.com/api/chat.postMessage

- name: Post results to slack part 4
- name: Post results to slack part 4 (sound alarm if changed results)
run: |
if grep -q "Unmatched Results Statistics" "$(cat ${GITHUB_WORKSPACE}/report.md)"; then
curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="@here BMDB Nightly Testing has reported a change in execution results!! Please Investigate" https://slack.com/api/chat.postMessage
fi
- name: Post results to slack part 5
run: curl -X POST -F token="${{ secrets.SLACK_BOT_TOKEN }}" -F channel=${{ secrets.SLACK_CHANNEL_VCELL_DEV_TOKEN }} -F text="To see detailed logs of the BMDB results, see - ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}. Go see what happened!" https://slack.com/api/chat.postMessage
7 changes: 0 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,6 @@


<repositories>
<!-- needed for javax.media.jai -->
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>https://repository.springsource.com/maven/bundles/external</url>
</repository>

<!-- needed for com.mxgraph.jgraphx -->
<repository>
<id>com.alfresco.repository.public</id>
Expand Down
903 changes: 535 additions & 368 deletions pythonVtk/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pythonVtk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.poetry]
name = "pythonvtk"
name = "python_vtk"
version = "0.1.0"
description = ""
authors = ["Jim Schaff <[email protected]>"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import vtk

import vtkService.vtkService as vtkService

x = [1, 2, 3, 4]
y = [1, 2, 3, 4]
ugrid = vtk.vtkUnstructuredGrid()
points = vtk.vtkPoints()
points.SetDataTypeToDouble()
xyToNode = [[] for i in range(len(x))]
index = 0
for i, xCoord in enumerate(x):
for yCoord in y:
points.InsertNextPoint(xCoord, yCoord, 0.0)
xyToNode[i].append(index)
index += 1
ugrid.SetPoints(points)

# Add the volume elements
for i, xCoord in enumerate(x[:-1]):
for j, yCoord in enumerate(y[:-1]):
idList = vtk.vtkIdList()
idList.InsertNextId(xyToNode[i][j])
idList.InsertNextId(xyToNode[i + 1][j])
idList.InsertNextId(xyToNode[i + 1][j + 1])
idList.InsertNextId(xyToNode[i][j + 1])
ugrid.InsertNextCell(vtk.VTK_QUAD, idList)

vtkService.writevtk(ugrid, "abc.vtu")
vtkService.writeDataArrayToNewVtkFile("abc.vtu", "var", [1., 2., 3., 4., 5., 6., 7., 8., 9.], "abc_var.vtu")
import vtk

import python_vtk.vtkService.vtkService as vtkService

x = [1, 2, 3, 4]
y = [1, 2, 3, 4]
ugrid = vtk.vtkUnstructuredGrid()
points = vtk.vtkPoints()
points.SetDataTypeToDouble()
xyToNode = [[] for i in range(len(x))]
index = 0
for i, xCoord in enumerate(x):
for yCoord in y:
points.InsertNextPoint(xCoord, yCoord, 0.0)
xyToNode[i].append(index)
index += 1
ugrid.SetPoints(points)

# Add the volume elements
for i, xCoord in enumerate(x[:-1]):
for j, yCoord in enumerate(y[:-1]):
idList = vtk.vtkIdList()
idList.InsertNextId(xyToNode[i][j])
idList.InsertNextId(xyToNode[i + 1][j])
idList.InsertNextId(xyToNode[i + 1][j + 1])
idList.InsertNextId(xyToNode[i][j + 1])
ugrid.InsertNextCell(vtk.VTK_QUAD, idList)

vtkService.writevtk(ugrid, "abc.vtu")
vtkService.writeDataArrayToNewVtkFile("abc.vtu", "var", [1., 2., 3., 4., 5., 6., 7., 8., 9.], "abc_var.vtu")
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
import argparse

import numpy as np
import vtk

from vtkService.vtkService import writeDataArrayToNewVtkFile


def main():
# try:
parser = argparse.ArgumentParser()
parser.add_argument("invtkfile", help="filename of input vtk mesh (VTK XML unstructured grid")
parser.add_argument("varname", help="name of cell data variable")
parser.add_argument("outvtkfile", help="filename of output vtk mesh (VTK XML unstructured grid")
args = parser.parse_args()

# deserialize raw bytes into VarDataAdd
reader = vtk.vtkXMLUnstructuredGridReader()
reader.SetFileName(args.invtkfile)
reader.Update()
mesh = reader.GetOutput()
assert isinstance(mesh, vtk.vtkUnstructuredGrid)
num_cells = mesh.GetCells().GetSize()

# write 0..N-1 into data
npdata = np.arange(0, num_cells, 0.1)

writeDataArrayToNewVtkFile(args.invtkfile, args.varname, npdata, args.outvtkfile)
print("done")


# except:
# e = sys.exc_info()[0]
# print("exception "+e)
# sys.exit(-1)
# else:
# sys.exit(0)


if __name__ == '__main__':
main()
import argparse

import numpy as np
import vtk

from python_vtk.vtkService.vtkService import writeDataArrayToNewVtkFile


def main():
# try:
parser = argparse.ArgumentParser()
parser.add_argument("invtkfile", help="filename of input vtk mesh (VTK XML unstructured grid")
parser.add_argument("varname", help="name of cell data variable")
parser.add_argument("outvtkfile", help="filename of output vtk mesh (VTK XML unstructured grid")
args = parser.parse_args()

# deserialize raw bytes into VarDataAdd
reader = vtk.vtkXMLUnstructuredGridReader()
reader.SetFileName(args.invtkfile)
reader.Update()
mesh = reader.GetOutput()
assert isinstance(mesh, vtk.vtkUnstructuredGrid)
num_cells = mesh.GetCells().GetSize()

# write 0..N-1 into data
npdata = np.arange(0, num_cells, 0.1)

writeDataArrayToNewVtkFile(args.invtkfile, args.varname, npdata, args.outvtkfile)
print("done")


# except:
# e = sys.exc_info()[0]
# print("exception "+e)
# sys.exit(-1)
# else:
# sys.exit(0)


if __name__ == '__main__':
main()
Loading

0 comments on commit c9a6eac

Please sign in to comment.