-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/robin-janssen/CODES-Benchmark
- Loading branch information
Showing
48 changed files
with
1,904 additions
and
168 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,92 @@ | ||
name: CI Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
export PATH="$HOME/.local/bin:$PATH" | ||
- name: Install project with dev dependencies | ||
run: | | ||
poetry install --with dev | ||
# Step to detect if the commit is a merge commit (skip CI on merge commits) | ||
- name: Check if commit is a merge commit | ||
id: check-merge | ||
run: | | ||
if git log -1 --pretty=%B | grep -q "Merge pull request"; then | ||
echo "is-merge=true" >> $GITHUB_ENV | ||
else | ||
echo "is-merge=false" >> $GITHUB_ENV | ||
fi | ||
# Step to detect changes in pyproject.toml or poetry.lock | ||
- name: Check for dependency changes | ||
id: check-deps | ||
if: env.is-merge == 'false' # Skip if it's a merge commit | ||
run: | | ||
if git diff --name-only HEAD~1 | grep -qE 'pyproject.toml|poetry.lock'; then | ||
echo "dependencies-changed=true" >> $GITHUB_ENV | ||
else | ||
echo "dependencies-changed=false" >> $GITHUB_ENV | ||
fi | ||
# Step to generate requirements.txt if dependencies have changed | ||
- name: Generate requirements.txt | ||
if: env.is-merge == 'false' && env.dependencies-changed == 'true' | ||
run: | | ||
poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
# Commit and push the updated requirements.txt if dependencies have changed | ||
- name: Commit and push updated requirements.txt | ||
if: env.is-merge == 'false' && env.dependencies-changed == 'true' | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add requirements.txt | ||
git commit -m "Update requirements.txt [skip ci]" | ||
git push | ||
# Run Black (auto-reformat) using Poetry | ||
- name: Run Black (auto-reformat) | ||
if: env.is-merge == 'false' # Skip if it's a merge commit | ||
run: | | ||
poetry run black . | ||
# Run isort (auto-reformat) using Poetry | ||
- name: Run isort (auto-reformat) | ||
if: env.is-merge == 'false' # Skip if it's a merge commit | ||
run: | | ||
poetry run isort . | ||
# Run pytest using Poetry | ||
- name: Run pytest | ||
if: env.is-merge == 'false' # Skip if it's a merge commit | ||
run: | | ||
poetry run pytest |
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
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,4 @@ | ||
from .benchmark import * | ||
from .surrogates import * | ||
from .train import * | ||
from .utils import * |
File renamed without changes.
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
File renamed without changes.
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
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
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,12 @@ | ||
from codes.surrogates.DeepONet.deeponet import MultiONet | ||
from codes.surrogates.FCNN.fcnn import FullyConnected | ||
from codes.surrogates.LatentNeuralODE.latent_neural_ode import LatentNeuralODE | ||
from codes.surrogates.LatentPolynomial.latent_poly import LatentPoly | ||
|
||
surrogate_classes = [ | ||
MultiONet, | ||
FullyConnected, | ||
LatentNeuralODE, | ||
LatentPoly, | ||
# Add any additional surrogate classes here | ||
] |
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
File renamed without changes.
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
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.