Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: define frontend entry points for yt 4.2 (as a beta feature) #178

Merged
merged 5 commits into from
Jan 14, 2023
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
10 changes: 3 additions & 7 deletions .github/workflows/bleeding-edge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,11 @@ jobs:
with:
python-version: 3.11-dev

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install git+https://github.com/yt-project/yt.git

- name: Build
run: |
python -m pip install ".[test]"
python -m pip install --upgrade pip
python -m pip install ".[experimental]"
python -m pip install -r tests/requirements.txt

- name: Run Tests
run: pytest --color=yes
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Build
run: |
python3 -m pip install -U pip
python3 -m pip install ".[test]"
python -m pip install --upgrade pip
python -m pip install .
python -m pip install -r tests/requirements.txt

- name: run tests
run: pytest --color=yes

Expand All @@ -55,8 +58,9 @@ jobs:

- name: Build
run: |
python3 -m pip install --upgrade pip
python3 -m pip install .[typecheck]
python -m pip install --upgrade pip
python -m pip install .
python -m pip install mypy==0.971

- name: Run mypy
run: mypy yt_idefix
38 changes: 27 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)

A maturing yt frontend for Idefix and Pluto (vtk), packaged as an extension for yt.
This frontend is a candidate for integration in the core yt code base.

## Installation

```shell
pip install yt_idefix
python -m pip install yt_idefix
```

Alternatively, use
```shell
python -m pip install "yt_idefix[experimental]"
```
to require the bleeding-edge version of `yt`, enabling all experimental
features, including unreleased ones. Note that this route takes longer (a couple
minutes) to install because it will compile yt from source. See [Experimental features](#experimental-features).

## Usage

After importing `yt` itself, make sure to activate the extension
Expand All @@ -26,23 +34,31 @@ import yt
import yt_idefix
```

Now `yt.load` will be able to read Pluto/Idefix `.vtk` output files, as well as Idefix `.dmp` dump files.
Now `yt.load` will be able to read Pluto/Idefix `.vtk` output files, as well as
Idefix `.dmp` dump files.


## Experimental features

## Strecthed grids support
### Seamless plugin support
*new in yt 4.2 (unreleased) + yt_idefix 0.16*

### yt_idefix 0.12.0 and newer
`yt>=4.2` supports automatic
loading for external frontends, i.e., the extra import line (`import yt_idefix`)
will not be needed with this version.

version 0.12.0 brings experimental *native* support for streched grids, which is under
active development upstream, in yt itself.
This feature is marked as experimental until yt 4.2.0 is released.

Slices should now work seamlessly even with older versions of yt, however
yt 4.1 will be required to perform projections correctly.
### Strecthed grids support
*new in yt 4.1 + yt_idefix 0.12*
- `yt_idefix>=0.12.0` natively supports `yt.SlicePlot` for streched grids
- `yt>=4.1.0` is required from `yt.ProjectionPlot`

**update**: yt_idefix 0.13.3 is the last release allowing yt 4.0.x, yt_idefix 0.14.0 requires yt 4.1
Streched grids support is considered experimental as of yt 4.1


### yt_idefix 0.11 and older (deprecated)
## Deprecated features
*will be removed in yt_idefix 1.0*

yt_idefix ships a specialized loader function for datasets with streched grids
`yt_idefix.load_stretched`. This function is only provided as a workaround 4.0.x limitations, but it's highly limited itself:
Expand Down
24 changes: 13 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "yt_idefix"
version = "0.15.0"
version = "0.16.0"
description = "An extension module for yt, adding a frontend for Idefix"
authors = [
{ name = "C.M.T. Robert" },
Expand Down Expand Up @@ -37,19 +37,21 @@ dependencies = [
"yt>=4.1.0",
]

[project.optional-dependencies]
experimental = [
"yt@git+https://github.com/yt-project/yt.git#egg=main",
]

[project.entry-points."yt.frontends"]
# these entry points require yt 4.2 (unreleased at the time of writing)
# they are included early for testing purposes
IdefixDmpkDataset = "yt_idefix.api:IdefixDmpDataset"
IdefixVtkDataset = "yt_idefix.api:IdefixVtkDataset"
PlutoVtkDataset = "yt_idefix.api:PlutoVtkDataset"

[project.license]
text = "GPL-3.0"

[project.optional-dependencies]
test = [
"more-itertools>=8.4",
"pyaml>=17.10.0",
"pytest>=7.0",
"unyt>=2.9.2",
]
typecheck = [
"mypy==0.971",
]

[project.readme]
file = "README.md"
Expand Down
4 changes: 4 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
more-itertools>=8.4
pyaml>=17.10.0
pytest>=7.0
unyt>=2.9.2
2 changes: 1 addition & 1 deletion yt_idefix/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# immediately after `import yt.extensions.idefix`
from yt_idefix.api import *

__version__ = "0.15.0"
__version__ = "0.16.0"