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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.13"]
runs-on: [ubuntu-latest] #, macos-latest, windows-latest]

include:
- python-version: pypy-3.10
Expand All @@ -68,6 +68,6 @@ jobs:
--durations=20

- name: Upload coverage report
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,3 @@ cmake_minimum_required(VERSION 3.15...3.26)
set(SKBUILD_PROJECT_NAME pscpy)

project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)

set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)

pybind11_add_module(_core MODULE src/main.cpp)
install(TARGETS _core DESTINATION ${SKBUILD_PROJECT_NAME})
27 changes: 0 additions & 27 deletions src/main.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/pscpy/adios2py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _name(self) -> str:
def _dtype(self) -> np.dtype[Any]:
self._assert_not_closed()

return np.dtype(adios2.type_adios_to_numpy(self._var.type()))
return np.dtype(adios2.type_adios_to_numpy(self._var.type())) # type: ignore[no-any-return]

def __getitem__(self, args: SupportsInt | slice | tuple[SupportsInt | slice, ...]) -> NDArray[Any]:
self._assert_not_closed()
Expand Down
2 changes: 1 addition & 1 deletion src/pscpy/psc.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, file: File, length: ArrayLike | None = None, corner: ArrayLik
self.z = self._get_coord(2)

def _get_coord(self, coord_idx: int) -> NDArray[np.floating[Any]]:
return np.linspace( # type: ignore[no-any-return]
return np.linspace(
start=self.corner[coord_idx],
stop=self.corner[coord_idx] + self.length[coord_idx],
num=self.gdims[coord_idx],
Expand Down
11 changes: 5 additions & 6 deletions src/pscpy/pscadios2.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import io
import os
import pathlib
from typing import Any, Iterable, Protocol, SupportsInt
Expand All @@ -25,6 +24,7 @@
)
from xarray.core import indexing
from xarray.core.datatree import DataTree
from xarray.core.types import ReadBuffer
from xarray.core.utils import Frozen, FrozenDict

from .adios2py import File, Variable
Expand Down Expand Up @@ -149,7 +149,7 @@ def psc_open_dataset(
length: ArrayLike | None = None,
corner: ArrayLike | None = None,
) -> xarray.Dataset:
filename = _normalize_path(filename_or_obj) # type: ignore[no-untyped-call]
filename = _normalize_path(filename_or_obj)
store = PscAdios2Store.open(filename, species_names, length=length, corner=corner)

data_vars, attrs = store.load() # type: ignore[no-untyped-call]
Expand All @@ -167,13 +167,12 @@ class PscAdios2BackendEntrypoint(BackendEntrypoint):
@override
def open_dataset(
self,
filename_or_obj: str | os.PathLike[Any] | io.BufferedIOBase | AbstractDataStore,
filename_or_obj: str | os.PathLike[Any] | ReadBuffer[Any] | AbstractDataStore,
*,
drop_variables: str | Iterable[str] | None = None,
length: ArrayLike | None = None,
corner: ArrayLike | None = None,
species_names: Iterable[str] | None = None, # e.g. ['e', 'i']; FIXME should be readable from file
**kwargs: Any,
) -> xarray.Dataset:
if not isinstance(filename_or_obj, (str, os.PathLike)):
raise NotImplementedError()
Expand All @@ -190,14 +189,14 @@ def open_dataset(
)

@override
def guess_can_open(self, filename_or_obj: str | os.PathLike[Any] | io.BufferedIOBase | AbstractDataStore) -> bool:
def guess_can_open(self, filename_or_obj: str | os.PathLike[Any] | ReadBuffer[Any] | AbstractDataStore) -> bool:
if isinstance(filename_or_obj, (str, os.PathLike)):
ext = pathlib.Path(filename_or_obj).suffix
return ext in {".bp"}
return False

@override
def open_datatree(self, filename_or_obj: str | os.PathLike[Any] | io.BufferedIOBase | AbstractDataStore, **kwargs: Any) -> DataTree[Any]:
def open_datatree(self, filename_or_obj: str | os.PathLike[Any] | ReadBuffer[Any] | AbstractDataStore, **kwargs: Any) -> DataTree:
raise NotImplementedError()


Expand Down
11 changes: 0 additions & 11 deletions tests/test_compiled.py

This file was deleted.

Loading