Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
ddac7cd
move FileParser from OBR to Owls
greole Feb 4, 2023
4f42fa0
migrate to pyproject.toml
greole Feb 4, 2023
5df18b7
Fixup
greole Feb 4, 2023
a5d03d1
commit id break pip
greole Feb 4, 2023
6a3acc9
remove plot import
greole Feb 4, 2023
5437e22
clean up
greole Feb 4, 2023
e11b5e0
Reimplement LogFileParser
greole Feb 7, 2023
b3c6bb9
Fixup
greole Feb 7, 2023
85bc9c5
fix writing includes
greole Feb 8, 2023
5b108d8
Add missing _
greole Feb 28, 2023
e4189b9
Add pyparsing to dependencies
greole Mar 15, 2023
edf2138
Fixup
greole Mar 15, 2023
c744f7f
adapt new packape structure
greole Mar 19, 2023
af0e69d
add pre-commit file
greole Mar 19, 2023
6f39e71
add black
greole Mar 19, 2023
80e65ff
reorder
greole Mar 19, 2023
4af2155
reformat with black
greole Mar 19, 2023
e00c2e3
add workflow to push
greole Mar 19, 2023
db0bde7
convert to corresponding type if possible, add unit test
greole Mar 19, 2023
e4f6651
fix problem with multi word values, add some unit tests
greole Mar 19, 2023
26d1fd3
add dummy README.rst
greole Mar 20, 2023
b4c7d27
add dummy CHANGELOG.rst
greole Mar 20, 2023
dce785d
bumb patch level
greole Mar 22, 2023
1775186
fix failing list parse
greole Mar 23, 2023
4f6d3a7
format
greole Mar 23, 2023
a6c67b9
parse of_list to py list
greole Mar 23, 2023
a32d6c0
add simple status check to log file parser
greole Mar 24, 2023
713cac3
Fixup
greole Mar 24, 2023
13e88ee
add log header
greole Apr 19, 2023
3301ab5
temporary fix for separator
greole Apr 19, 2023
7dab261
make is_complete a property
greole Apr 19, 2023
7e497ad
add standalone functionality for FoamDictParser, slight pyparsing fun…
lupeterm Apr 21, 2023
acdec63
revert back to snake case
lupeterm Apr 25, 2023
f831fd1
add foamDictParser standalone test
lupeterm Apr 25, 2023
e19d98b
fix missing quotation marks bug
lupeterm Apr 25, 2023
2f86c15
fix, pyparsing naming, remove try-except in FileParser.get, restored …
lupeterm Apr 25, 2023
fd22876
Merge pull request #22 from greole/issue/standalone-foamdict
greole Apr 25, 2023
27bddaa
Move update to separate method
greole Apr 25, 2023
3df4509
Fixup
greole Apr 25, 2023
4e57e71
Fix issue with non flushing file
greole Apr 25, 2023
2121a88
Merge pull request #24 from greole/fix_flush_file
greole Apr 25, 2023
1921daf
Fixup
greole Apr 25, 2023
70d11db
Merge pull request #25 from greole/fix_flush_file
greole Apr 25, 2023
b306c9b
Fix typos
greole Jun 13, 2023
e1c89c7
Merge pull request #27 from greole/fix_typos
greole Jun 13, 2023
85213e0
test and warn for empty DFs
greole Jul 19, 2023
5f7d98c
use column names directly
greole Aug 10, 2023
be56943
update variable parsing, improve tests
greole Sep 1, 2023
5af8f11
add single and kvp mode to variable parser
greole Sep 1, 2023
bac29dc
fixup
greole Sep 1, 2023
2e3f47d
clean up unneeded mesh function
greole Sep 1, 2023
d85cc6f
cleanup
greole Sep 1, 2023
1bccb80
cleanup
greole Sep 1, 2023
643f108
add imports
greole Sep 1, 2023
5c78d82
fixup missing pd
greole Sep 1, 2023
9c7b985
update package install
greole Sep 1, 2023
62718f2
request at least python 3.9
greole Sep 1, 2023
6fef36f
request at least python 3.9
greole Sep 1, 2023
3571d6c
fix version 3.10
greole Sep 1, 2023
6159577
remove old integration test
greole Sep 1, 2023
c40291f
copy obr pipeline
greole Sep 1, 2023
f4484e5
add basic implementation of new log parser
greole Sep 19, 2023
207db66
add example log
greole Sep 19, 2023
e60ca48
start split parser
greole Sep 20, 2023
9f80cd3
add custom matcher
greole Sep 21, 2023
bf03c83
Do some performance optimisations
greole Sep 22, 2023
d311a85
improve type hints, add further tests, read footer
greole Sep 22, 2023
4a97157
fix typos
greole Sep 22, 2023
47df36d
Merge pull request #30 from greole/Owls2.0_refactParser
greole Sep 22, 2023
cf68abc
add CFL number parser
greole Sep 25, 2023
663e343
Check last timestep for Courant number
greole Sep 25, 2023
cf92da0
add cfl number parser test
greole Sep 25, 2023
9ae8387
wrap str elements of list in quotes to be compatible if .org version …
greole Sep 25, 2023
6402d63
allow for Time = 0.1[s] notation of .org version of OF
greole Sep 26, 2023
44f6d80
add ExecutionTime parsers
greole Sep 27, 2023
2acd53b
add default value for ExecutionTime
greole Sep 27, 2023
d7dc1f1
add failure msg
greole Oct 1, 2023
137ad6b
eval number types of last time step
greole Oct 2, 2023
823e4a8
fixup dont try to eval _count
greole Oct 3, 2023
9805063
remove setup.py in favour of pyproject.toml
greole Nov 21, 2023
04de605
Merge branch 'Owls2.0' of github.com:greole/Owls into Owls2.0
greole Nov 21, 2023
c4d1bdd
fixup
greole Nov 21, 2023
4cbd9eb
fix dataframe creation if no p_count or time is present
greole Dec 7, 2023
495df7b
require pyparsing >3.0.0
greole Dec 22, 2023
0583b00
add option to skip update on init
greole Dec 26, 2023
2e71e8b
add PimpleConvergedMatcher
greole Jan 19, 2024
08f9db5
Merge branch 'Owls2.0' of github.com:greole/Owls into Owls2.0
greole Jan 19, 2024
7b65b44
allow finder to fail
greole Feb 5, 2024
7901c31
allow finder to fail
greole Feb 5, 2024
ecf0143
allow finder to fail
greole Feb 5, 2024
d440b3b
add nNodes counter
greole Feb 5, 2024
9107f23
clean up
greole Feb 6, 2024
796a1e3
clean up
greole Feb 6, 2024
e8d1201
use last occurance of time step cont errors
greole Feb 10, 2024
9646bcc
Merge branch 'Owls2.0' of github.com:greole/Owls into Owls2.0
greole Feb 10, 2024
34c6bd6
add basic unit test
greole Apr 24, 2024
883a4ff
allow underscore in name
greole Apr 24, 2024
76f8168
fix failing test, expect last cont error
greole Apr 24, 2024
f46ac34
add further unit tests
greole Apr 25, 2024
d0b3a6c
Merge pull request #33 from greole/fix/underscore_variables
greole Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/bot-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -e

API_HEADER="Accept: application/vnd.github.v3+json"
AUTH_HEADER="Authorization: token $GITHUB_TOKEN"

api_get() {
curl -X GET -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1"
}

api_post() {
curl -X POST -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1" -d "$2"
}

api_patch() {
curl -X PATCH -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1" -d "$2"
}

api_delete() {
curl -X DELETE -s -H "${AUTH_HEADER}" -H "${API_HEADER}" "$1"
}
107 changes: 107 additions & 0 deletions .github/bot-pr-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env bash

source .github/bot-base.sh

EXTENSION_REGEX='\.(py)$'
FORMAT_HEADER_REGEX='^(benchmark|core|cuda|hip|include/ginkgo/core|omp|reference|dpcpp|common/unified|test)/'
FORMAT_REGEX='^(common|examples)/'
CLANG_FORMAT=clang-format-14

echo -n "Collecting information on triggering PR"
PR_URL=$(jq -r .pull_request.url "$GITHUB_EVENT_PATH")
if [[ "$PR_URL" == "null" ]]; then
# if this was triggered by an issue comment: get PR and commenter
echo -n .............
PR_URL=$(jq -er .issue.pull_request.url "$GITHUB_EVENT_PATH")
echo -n .
USER_LOGIN=$(jq -er ".comment.user.login" "$GITHUB_EVENT_PATH")
echo -n .
USER_URL=$(jq -er ".comment.user.url" "$GITHUB_EVENT_PATH")
echo -n .
else
# else it was triggered by a PR sync: get PR creator
USER_LOGIN=$(jq -er ".pull_request.user.login" "$GITHUB_EVENT_PATH")
echo -n .
USER_URL=$(jq -er ".pull_request.user.url" "$GITHUB_EVENT_PATH")
echo -n .
fi
echo -n .
PR_JSON=$(api_get $PR_URL)
echo -n .
PR_MERGED=$(echo "$PR_JSON" | jq -r .merged)
echo -n .
PR_NUMBER=$(echo "$PR_JSON" | jq -r .number)
echo -n .
ISSUE_URL=$(echo "$PR_JSON" | jq -er ".issue_url")
echo -n .
BASE_REPO=$(echo "$PR_JSON" | jq -er .base.repo.full_name)
echo -n .
BASE_BRANCH=$(echo "$PR_JSON" | jq -er .base.ref)
echo -n .
HEAD_REPO=$(echo "$PR_JSON" | jq -er .head.repo.full_name)
echo -n .
HEAD_BRANCH=$(echo "$PR_JSON" | jq -er .head.ref)
echo .

BASE_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$BASE_REPO"
HEAD_URL="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/$HEAD_REPO"

JOB_URL="https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"

bot_delete_comments_matching() {
local search_matching="$1"
COMMENTS=$(api_get "$ISSUE_URL/comments" | jq -r '.[] | select((.user.login == "peterBot") and (.body | startswith('"\"$search_matching\""'))) | .url')
for URL in $COMMENTS; do
api_delete "$URL" > /dev/null
done
}

bot_comment() {
api_post "$ISSUE_URL/comments" "{\"body\":\"$1\"}" > /dev/null
}

bot_error() {
echo "$1"
bot_comment "Error: $1"
exit 1
}

bot_get_all_changed_files() {
local pr_url="$1"
local pr_files=""
local page="1"
while true; do
# this api allows 100 items per page
# github action uses `bash -e`. The last empty page will leads jq error, use `|| :` to ignore the error.
local pr_page_files=$(api_get "$pr_url/files?&per_page=100&page=${page}" | jq -er '.[] | select(.status != "removed") | .filename' || :)
if [ "${pr_page_files}" = "" ]; then
break
fi
if [ ! "${pr_files}" = "" ]; then
# add the same new line format as jq output
pr_files="${pr_files}"$'\n'
fi
pr_files="${pr_files}${pr_page_files}"
page=$(( page + 1 ))
done
echo "${pr_files}"
}

# collect info on the user that invoked the bot
echo -n "Collecting information on triggering user"
USER_JSON=$(api_get $USER_URL)
echo .

USER_NAME=$(echo "$USER_JSON" | jq -r ".name")
if [[ "$USER_NAME" == "null" ]]; then
USER_NAME=$USER_LOGIN
fi
USER_EMAIL=$(echo "$USER_JSON" | jq -r ".email")
if [[ "$USER_EMAIL" == "null" ]]; then
USER_EMAIL="$USER_LOGIN@users.noreply.github.com"
fi
USER_COMBINED="$USER_NAME <$USER_EMAIL>"

if [[ "$PR_MERGED" == "true" ]]; then
bot_error "PR already merged!"
fi
21 changes: 21 additions & 0 deletions .github/bot-pr-format-base.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

source .github/bot-pr-base.sh

echo "Retrieving PR file list"
PR_FILES=$(bot_get_all_changed_files ${PR_URL})
NUM=$(echo "${PR_FILES}" | wc -l)
echo "PR has ${NUM} changed files"

TO_FORMAT="$(echo "$PR_FILES" | grep -E $EXTENSION_REGEX || true)"

git remote add fork "$HEAD_URL"
git fetch fork "$HEAD_BRANCH"

git config user.email "lukas.petermann13@gmail.com"
git config user.name "PeterBot"

# checkout current PR head
LOCAL_BRANCH=format-tmp-$HEAD_BRANCH
git checkout -b $LOCAL_BRANCH fork/$HEAD_BRANCH

22 changes: 22 additions & 0 deletions .github/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

cp .github/bot-pr-format-base.sh /tmp
source /tmp/bot-pr-format-base.sh


# format files
black --verbose src/


echo "listing files"
# check for changed files, replace newlines by \n
LIST_FILES=$(git diff --name-only | sed '$!s/$/\\n/' | tr -d '\n')
echo $LIST_FILES
echo "gonna commit files"
# commit changes if necessary
if [[ "$LIST_FILES" != "" ]]; then
git commit -a -m "Format files

Co-authored-by: $USER_COMBINED"
git push fork "$LOCAL_BRANCH:$HEAD_BRANCH" 2>&1 || bot_error "Cannot push formatted branch, are edits for maintainers allowed?"
fi
21 changes: 21 additions & 0 deletions .github/workflows/pr-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
issue_comment:
types: [created]
name: OnCommentPR
jobs:
format:
name: format
runs-on: ubuntu-latest
if: github.event.issue.pull_request != '' && github.event.comment.body == 'format!' && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
permissions:
pull-requests: write
contents: write
steps:
- name: Install black
run: sudo apt-get install -y black
- name: Checkout the latest code (shallow clone)
uses: actions/checkout@v3
- name: run black and commit changes
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: cp --preserve .github/format.sh /tmp && /tmp/format.sh
11 changes: 4 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
name: Python package

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
- push
- pull_request

jobs:
build:
Expand All @@ -16,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand All @@ -28,8 +26,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python setup.py install
python -m pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/typo_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Test GitHub Action
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check for typos
uses: crate-ci/typos@master
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
args: ["."]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.1.1
verbose: true
hooks:
- id: mypy
args: ["--ignore-missing-imports", "--show-error-codes", "--non-interactive"]
additional_dependencies: ['types-PyYAML']
Empty file added CHANGELOG.rst
Empty file.
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

Loading