Skip to content

Commit

Permalink
Merge origin/main
Browse files Browse the repository at this point in the history
  • Loading branch information
tehrengruber committed Jan 16, 2024
2 parents 32bcb6a + 7a9489f commit a981ab1
Show file tree
Hide file tree
Showing 184 changed files with 10,872 additions and 4,987 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ jobs:
run: |
pyversion=${{ matrix.python-version }}
pyversion_no_dot=${pyversion//./}
tox run -e next-py${pyversion_no_dot}-${{ matrix.tox-env-factor }}
# mv coverage.json coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}.json
tox run -e next-py${pyversion_no_dot}-${{ matrix.tox-env-factor }}-cpu
# mv coverage.json coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}-cpu.json
# - name: Upload coverage.json artifact
# uses: actions/upload-artifact@v3
# with:
# name: coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}
# path: coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}.json
# name: coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}-cpu
# path: coverage-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}-cpu.json
# - name: Gather info
# run: |
# echo ${{ github.ref_type }} >> info.txt
Expand All @@ -76,5 +76,5 @@ jobs:
# - name: Upload info artifact
# uses: actions/upload-artifact@v3
# with:
# name: info-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}
# name: info-py${{ matrix.python-version }}-${{ matrix.os }}-${{ matrix.tox-env-factor }}-cpu
# path: info.txt
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ image:
tasks:
- name: Setup venv and dev tools
init: |
ln -s /workspace/gt4py/.gitpod/.vscode /workspace/gt4py/.vscode
ln -sfn /workspace/gt4py/.gitpod/.vscode /workspace/gt4py/.vscode
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools wheel
Expand Down
28 changes: 14 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ repos:
## version = re.search('black==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"rev: '{version}' # version from constraints.txt")
##]]]
rev: '23.7.0' # version from constraints.txt
rev: '23.9.1' # version from constraints.txt
##[[[end]]]
hooks:
- id: black
Expand Down Expand Up @@ -97,14 +97,14 @@ repos:
## print(f"- {pkg}==" + str(re.search(f'\n{pkg}==([0-9\.]*)', constraints)[1]))
##]]]
- darglint==1.8.1
- flake8-bugbear==23.7.10
- flake8-bugbear==23.9.16
- flake8-builtins==2.1.0
- flake8-debugger==4.1.2
- flake8-docstrings==1.7.0
- flake8-eradicate==1.5.0
- flake8-mutable==1.2.0
- flake8-pyproject==1.2.3
- pygments==2.15.1
- pygments==2.16.1
##[[[end]]]
# - flake8-rst-docstrings # Disabled for now due to random false positives
exclude: |
Expand Down Expand Up @@ -146,9 +146,9 @@ repos:
## version = re.search('mypy==([0-9\.]*)', open("constraints.txt").read())[1]
## print(f"#========= FROM constraints.txt: v{version} =========")
##]]]
#========= FROM constraints.txt: v1.4.1 =========
#========= FROM constraints.txt: v1.5.1 =========
##[[[end]]]
rev: v1.4.1 # MUST match version ^^^^ in constraints.txt (if the mirror is up-to-date)
rev: v1.5.1 # MUST match version ^^^^ in constraints.txt (if the mirror is up-to-date)
hooks:
- id: mypy
additional_dependencies: # versions from constraints.txt
Expand All @@ -162,26 +162,26 @@ repos:
##]]]
- astunparse==1.6.3
- attrs==23.1.0
- black==23.7.0
- black==23.9.1
- boltons==23.0.0
- cached-property==1.5.2
- click==8.1.6
- cmake==3.27.0
- click==8.1.7
- cmake==3.27.5
- cytoolz==0.12.2
- deepdiff==6.3.1
- devtools==0.11.0
- deepdiff==6.5.0
- devtools==0.12.2
- frozendict==2.3.8
- gridtools-cpp==2.3.0
- importlib-resources==6.0.0
- gridtools-cpp==2.3.1
- importlib-resources==6.0.1
- jinja2==3.1.2
- lark==1.1.7
- mako==1.2.4
- nanobind==1.4.0
- nanobind==1.5.2
- ninja==1.11.1
- numpy==1.24.4
- packaging==23.1
- pybind11==2.11.1
- setuptools==68.0.0
- setuptools==68.2.2
- tabulate==0.9.0
- typing-extensions==4.5.0
- xxhash==3.0.0
Expand Down
38 changes: 38 additions & 0 deletions CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,44 @@ We deviate from the [Google Python Style Guide][google-style-guide] only in the
- Client code (like tests, doctests and examples) should use the above style for public FieldView API
- Library code should always import the defining module and use qualified names.

### Error messages

Error messages should be written as sentences, starting with a capital letter and ending with a period (avoid exclamation marks). Try to be informative without being verbose. Code objects such as 'ClassNames' and 'function_names' should be enclosed in single quotes, and so should string values used for message interpolation.

Examples:

```python
raise ValueError(f"Invalid argument 'dimension': should be of type 'Dimension', got '{dimension.type}'.")
```

Interpolated integer values do not need double quotes, if they are indicating an amount. Example:

```python
raise ValueError(f"Invalid number of arguments: expected 3 arguments, got {len(args)}.")
```

The double quotes can also be dropped when presenting a sequence of values. In this case the message should be rephrased so the sequence is separated from the text by a colon ':'.

```python
raise ValueError(f"unexpected keyword arguments: {', '.join(set(kwarg_names} - set(expected_kwarg_names)))}.")
```

The message should be kept to one sentence if reasonably possible. Ideally the sentence should be kept short and avoid unneccessary words. Examples:

```python
# too many sentences
raise ValueError(f"Received an unexpeted number of arguments. Should receive 5 arguments, but got {len(args)}. Please provide the correct number of arguments.")
# better
raise ValueError(f"Wrong number of arguments: expected 5, got {len(args)}.")

# less extreme
raise TypeError(f"Wrong argument type. Can only accept 'int's, got '{type(arg)}' instead.")
# but can still be improved
raise TypeError(f"Wrong argument type: 'int' expected, got '{type(arg)}'")
```

The terseness vs. helpfulness tradeoff should be more in favor of terseness for internal error messages and more in favor of helpfulness for `DSLError` and it's subclassses, where additional sentences are encouraged if they point out likely hidden sources of the problem or common fixes.

### Docstrings

We generate the API documentation automatically from the docstrings using [Sphinx][sphinx] and some extensions such as [Sphinx-autodoc][sphinx-autodoc] and [Sphinx-napoleon][sphinx-napoleon]. These follow the Google Python Style Guide docstring conventions to automatically format the generated documentation. A complete overview can be found here: [Example Google Style Python Docstrings](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html#example-google).
Expand Down
1 change: 1 addition & 0 deletions ci/cscs-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ test py310:
- SUBPACKAGE: eve
- SUBPACKAGE: next
VARIANT: [-nomesh, -atlas]
SUBVARIANT: [-cuda11x, -cpu]
Loading

0 comments on commit a981ab1

Please sign in to comment.