Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[codespell]
skip = .git,*.pdf,*.png,*.jpg,*.jpeg,*.gif,*.svg,*.bmp,*.tiff,*.pyc,venv,.venv,.ipynb_checkpoints
check-filenames = true
quiet-level = 2
ignore-words-list = flexcompute,flow360,CL,CD,CMy,CFD,API,CFx,CFz,CFy
ignore-regex = [a-f0-9]{40}
builtin = clear,rare,informal
17 changes: 17 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Linguist-vendored files
docs/* linguist-vendored
notebooks/* linguist-vendored
tests/* linguist-vendored

# Disable linguist detection for IPython notebooks
*.ipynb linguist-detectable=false

# Mark IPython notebooks as generated files
*.ipynb linguist-generated=true

# Specify merge attributes for CHANGELOG.md
CHANGELOG.md merge=union

# Specify diff and merge attributes for IPython notebooks
*.ipynb diff=jupyternotebook
*.ipynb merge=jupyternotebook
13 changes: 13 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[diff "jupyternotebook"]
command = git-nbdiffdriver diff
[merge "jupyternotebook"]
driver = git-nbmergedriver merge %O %A %B %L %P
name = jupyter notebook merge driver
[difftool "nbdime"]
cmd = git-nbdifftool diff \"$LOCAL\" \"$REMOTE\" \"$BASE\"
[difftool]
prompt = false
[mergetool "nbdime"]
cmd = git-nbmergetool merge \"$BASE\" \"$LOCAL\" \"$REMOTE\" \"$MERGED\"
[mergetool]
prompt = false
85 changes: 85 additions & 0 deletions .github/workflows/lint-notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: "lint-notebooks"

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

permissions:
contents: read
pull-requests: write

jobs:
lint:
name: Run notebook linting and spell check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # required for changed-files action

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Run ruff format check
run: uvx ruff format --check --diff .

- name: Run ruff lint check
run: uvx ruff check .

- name: Get changed notebook files
id: changed_notebooks
if: github.event_name == 'pull_request'
uses: tj-actions/changed-files@v46
with:
files: |
**.ipynb

- name: Run spell check on changed notebooks
id: spellcheck
if: github.event_name == 'pull_request' && steps.changed_notebooks.outputs.any_changed == 'true'
continue-on-error: true
run: |
uvx python spellcheck.py ${{ steps.changed_notebooks.outputs.all_changed_files }} > spellcheck_output.txt || true

- name: Prepare spellcheck comment body
id: prepare_comment
if: >
github.event_name == 'pull_request' &&
steps.changed_notebooks.outputs.any_changed == 'true' &&
steps.spellcheck.outcome == 'success' &&
hashFiles('spellcheck_output.txt') != ''
run: |
echo "<!-- lint-notebooks-spellcheck-comment -->" > comment_body.txt
echo "" >> comment_body.txt
cat spellcheck_output.txt >> comment_body.txt
echo "Generated by GitHub Action run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> comment_body.txt

- name: Find existing comment
uses: peter-evans/find-comment@v3
id: find_comment
if: steps.prepare_comment.outcome == 'success'
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: '<!-- lint-notebooks-spellcheck-comment -->'

- name: Post or Update spell check comment
if: steps.prepare_comment.outcome == 'success'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
body-path: comment_body.txt
edit-mode: replace

- name: Determine success on spellchecking errors
if: steps.spellcheck.outputs.spell_error_found == 'true'
uses: actions/github-script@v3
with:
script: |
core.setFailed('Found issues with spelling')
60 changes: 60 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Distribution / packaging
.Python
build/
develop-eggs/
# dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# pyenv
.python-version

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.idea
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# flow360-notebooks
flow360-notebooks
# Flow360 - example notebooks
In this repository you will find notebooks that will take you through using multiple Flow360 features with its python client. They can be found in the notebooks folder.

## Related references

| Reference | URL |
|-------------------------|------------------------------------------------------------------------------|
| Flow360 Documentation | https://docs.flexcompute.com/projects/flow360/en/latest/ |
| Python API Guide | https://docs.flexcompute.com/projects/flow360/en/latest/api_guide/index.html |
| Flow360 Python API repo | https://github.com/flexcompute/Flow360 |

Loading
Loading