Skip to content

Commit

Permalink
use entrypoints, bump min yt version, update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishavlin committed Nov 17, 2023
1 parent d0aaa76 commit e634b0e
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 119 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f tests/test_requirements.txt ]; then python -m pip install -r tests/test_requirements.txt; fi
- name: Setup yt_aspect
run: |
python -m pip install -e .
python -m pip install -e .[test]
- name: Test with pytest
run: pytest --cov=./ --cov-report=xml:coverage/coverage.xml

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-verification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: Build Verification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/create-gh-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,20 @@ on:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release
name: Create Github Release

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
tag: ${{ github.ref }}
prerelease: false
name: Release ${{ github.ref }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
Expand Down
58 changes: 0 additions & 58 deletions .github/workflows/style-checks.yaml

This file was deleted.

10 changes: 7 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
default_language_version:
python: python3.10

ci:
autofix_prs: false
autoupdate_schedule: weekly

repos:
- repo: https://github.com/ambv/black
rev: 22.8.0 # keep in sync with tests/lint_requirements.txt
rev: 22.8.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/timothycrosley/isort
rev: '5.12.0' # keep in sync with tests/lint_requirements.txt
rev: '5.12.0'
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: '6.0.0' # keep in sync with tests/lint_requirements.txt
rev: '6.0.0'
hooks:
- id: flake8
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ To load a single timestep:

```python
import yt
import yt_aspect

ds = yt.load('output_convection_box_3d/solution/solution-00000.pvtu')
```
Expand Down
4 changes: 1 addition & 3 deletions examples/slice.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import yt

import yt_aspect # noqa: F401

files = [
"aspect/output_convection_box_3d/nproc_1/solution/solution-00002.pvtu",
"aspect/output_convection_box_3d/nproc_4/solution/solution-00001.pvtu",
Expand All @@ -11,5 +9,5 @@

ds = yt.load(files[2])

p = yt.SlicePlot(ds, "z", "T")
p = yt.SlicePlot(ds, "z", ("all", "T"))
p.save("test")
17 changes: 15 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "yt_aspect"
version = "0.1.1"
version = "0.2.0"
authors = [
{ name="Chris Havlin", email="[email protected]" },
]
Expand All @@ -16,10 +16,23 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies=['yt>4.1.0', 'xmltodict']
dependencies=['yt>=4.2.2', 'xmltodict']


[project.urls]
"Homepage" = "https://github.com/data-exp-lab/yt_aspect"
"Bug Tracker" = "https://github.com/data-exp-lab/yt_aspect/issues"

[project.entry-points."yt.frontends"]
aspect = "yt_aspect.api:ASPECTDataset"
pvtu = "yt_aspect.api:PVTUDataset"

[project.optional-dependencies]
test = [
"pytest>=6.1",
"tomli",
"pytest-cov",
]
dev = [
'pre-commit',
]
4 changes: 0 additions & 4 deletions tests/lint_requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion tests/test_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import unyt
import yt

import yt_aspect # NOQA
from yt_aspect.data_structures import _is_aspect_datafile, _is_pvtu_datafile


Expand Down
4 changes: 0 additions & 4 deletions tests/test_requirements.txt

This file was deleted.

13 changes: 1 addition & 12 deletions yt_aspect/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
from .data_structures import ( # noqa: F401
ASPECTDataset,
ASPECTUnstructuredIndex,
ASPECTUnstructuredMesh,
PVTUDataset,
PVTUIndex,
PVTUMesh,
)
from .fields import ASPECTFieldInfo, PVTUFieldInfo # noqa: F401
from .io import IOHandlerASPECT, IOHandlerPVTU # noqa: F401

__version__ = "0.1.1"
__version__ = "0.2.0"
15 changes: 10 additions & 5 deletions yt_aspect/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from .data_structures import ASPECTDataset # noqa: F401; noqa: F401
from .data_structures import ASPECTUnstructuredIndex # noqa: F401
from .data_structures import ASPECTUnstructuredMesh # noqa: F401
from .fields import ASPECTFieldInfo # noqa: F401
from .io import IOHandlerASPECT # noqa: F401
from .data_structures import ( # noqa: F401
ASPECTDataset,
ASPECTUnstructuredIndex,
ASPECTUnstructuredMesh,
PVTUDataset,
PVTUIndex,
PVTUMesh,
)
from .fields import ASPECTFieldInfo, PVTUFieldInfo # noqa: F401
from .io import IOHandlerASPECT, IOHandlerPVTU # noqa: F401

0 comments on commit e634b0e

Please sign in to comment.