Skip to content

Commit

Permalink
add readthedocs.yaml (#15)
Browse files Browse the repository at this point in the history
* add readthedocs.yaml

* drop tests for python 3.7

* add .pre-commit-config.yaml

* Auto format from pre-commit.com hooks

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fschuch and pre-commit-ci[bot] authored Mar 3, 2024
1 parent 576dc7c commit 4f1c4e0
Show file tree
Hide file tree
Showing 26 changed files with 1,360 additions and 1,304 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,35 @@ name: Python package

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python -m unittest discover -s tests/unit
python -m unittest discover -s tests/integration
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
run: |
python -m unittest discover -s tests/unit
python -m unittest discover -s tests/integration
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
default_language_version:
python: python
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
ci:
autofix_commit_msg: "Auto format from pre-commit.com hooks"
autoupdate_commit_msg: "pre-commit autoupdate"
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"xdmf",
"zfill"
]
}
}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,19 @@ Click on any link above to launch [Binder](https://mybinder.org/) and interact w
```python
ux = prm.dataset.load_array("ux-0000.bin")
```

* Load the entire time series for a given variable:

```python
ux = prm.dataset["ux"]
```

* Load all variables from a given snapshot:

```python
snapshot = prm.dataset[10]
```

* Loop through all snapshots, loading them one by one:

```python
Expand All @@ -144,13 +144,13 @@ Click on any link above to launch [Binder](https://mybinder.org/) and interact w
# write the results to the disc
prm.dataset.write(data = vort, file_prefix = "w3")
```

* Or simply load all snapshots at once (if you have enough memory):

```python
ds = prm.dataset[:]
```

* It is possible to produce a new xdmf file, so all data can be visualized on any external tool:

```python
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/Cylinder.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -566,4 +566,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading

0 comments on commit 4f1c4e0

Please sign in to comment.