Skip to content

Commit

Permalink
Merge pull request #5 from SimVascular/master
Browse files Browse the repository at this point in the history
Update from master
  • Loading branch information
kharold23 authored Oct 30, 2024
2 parents 808bd97 + 8a58d68 commit 9bd73b3
Show file tree
Hide file tree
Showing 95 changed files with 7,519 additions and 615 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/gui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow uses Cypress for end-to-end testing of the 0D model GUI.

name: GUI-tests

on: [push, pull_request]

jobs:
cypress-run:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
working-directory: tests/cypress
run: npm install

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Use the Python version compatible with your Flask app

- name: Install Flask dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flask
- name: Start Flask Application
run: |
cd applications/svZeroDGUI
FLASK_APP=app.py flask run --host=0.0.0.0 --port=8902 &
env:
FLASK_ENV: development

- name: Run Cypress tests
uses: cypress-io/github-action@v5
with:
start: npm start
working-directory: tests/cypress
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ jobs:
#alias conda="$CONDA/bin/conda"
conda create -n zerod python=3.11.4
conda run -n zerod pip install -e ".[dev]"
- name: Install Networkx
run: |
conda run -n zerod pip install networkx
- name: Test the build
run: |
cd tests
conda run -n zerod pytest -v --durations=0
conda run -n zerod pytest -v --durations=0 --ignore=test_dirgraph.py
- name: Build using CMake
run: |
mkdir Release
Expand All @@ -51,7 +54,7 @@ jobs:
cmake -DENABLE_COVERAGE=ON ..
make -j2
cd ../tests
conda run -n zerod pytest -v --durations=0 --coverage
conda run -n zerod pytest -v --durations=0 --coverage --ignore=test_dirgraph.py
cd ../Release
make coverage
- name: Save coverage report
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/test_visualization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test Visualization Application

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: Install Graphviz
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y graphviz
- name: Install Graphviz (macOS)
if: runner.os == 'macOS'
run: |
brew install graphviz
- name: Run tests
run: |
pytest tests/test_dirgraph.py
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ Release*/
Debug*/
externals/
*.so
build
build*/

# IDE
.cproject
.project
.settings
*.swp

# Node modules (for directed graph visualization)
node_modules/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ add_executable(svzerodsolver applications/svzerodsolver.cpp
)

add_executable(svzerodcalibrator applications/svzerodcalibrator.cpp
$<TARGET_OBJECTS:svzero_algebra_library>
$<TARGET_OBJECTS:svzero_optimize_library>
$<TARGET_OBJECTS:svzero_model_library>
)
Expand Down
22 changes: 22 additions & 0 deletions applications/svZeroDGUI/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
app.py
This script sets up a basic Flask web server for serving static files and handling
HTTP requests. It includes:
- Initialization of the Flask application.
- A route for serving the main HTML file (`index.html`) when accessing the root URL ('/').
- Configuration to run the application with debugging enabled on port 8902.
"""

from flask import Flask, jsonify, request

app = Flask(__name__)

@app.route('/')
def index():
return app.send_static_file('index.html')

if __name__ == "__main__":
# Generate a random port number between 5000 and 9999
app.run(debug=True, port=8902)
Binary file added applications/svZeroDGUI/static/css/RCR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/svZeroDGUI/static/css/chamber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/svZeroDGUI/static/css/coronary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/svZeroDGUI/static/css/flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/svZeroDGUI/static/css/junction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/svZeroDGUI/static/css/pressure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added applications/svZeroDGUI/static/css/resistance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9bd73b3

Please sign in to comment.