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

Increase minimum python to 3.9 #267

Merged
merged 4 commits into from
Jun 25, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

strategy:
matrix:
python-version: ["3.8", "3.11"]
python-version: ["3.9", "3.11"]

runs-on: ubuntu-latest
steps:
Expand Down
15 changes: 8 additions & 7 deletions caput/mpiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@
import os
import time
import warnings
from typing import TYPE_CHECKING, Any, Sequence, Tuple, Union
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any, Union

if TYPE_CHECKING:
from mpi4py import MPI
Expand Down Expand Up @@ -1325,8 +1326,8 @@ def reshape(self, *shape):
"""

def _check_shapes(
current_shape: Tuple[int], new_shape: Tuple[int]
) -> Tuple[int]:
current_shape: tuple[int], new_shape: tuple[int]
) -> tuple[int]:
"""Check that we can reshape one array into another.

Returns the fully fleshed out shape, or raises a ValueError.
Expand Down Expand Up @@ -1400,7 +1401,7 @@ def _check_shapes(
self.comm,
)

def _prep_buf(self, x: np.ndarray) -> Tuple[np.ndarray, "MPI.Datatype"]:
def _prep_buf(self, x: np.ndarray) -> tuple[np.ndarray, "MPI.Datatype"]:
"""Prepare a buffer for sending/recv by mpi4py.

If this is array is a supported datatype it just returns a simple buffer spec,
Expand Down Expand Up @@ -2173,7 +2174,7 @@ def _get_common_comm(
def _mpi_to_ndarray(
inputs: Sequence[Union[MPIArray, npt.ArrayLike, None]],
only_mpiarray: bool = False,
) -> Tuple[Union[npt.ArrayLike, None], ...]:
) -> tuple[Union[npt.ArrayLike, None], ...]:
# ) -> Tuple[List[Union[np.ndarray, None]], int, "MPI.IntraComm"]:
"""Ensure a list with mixed MPIArrays and ndarrays are all ndarrays.

Expand Down Expand Up @@ -2241,8 +2242,8 @@ def _create_or_get_dset(group, name, shape, dtype, **kwargs):


def sanitize_slice(
sl: Tuple[Any], naxis: int
) -> Tuple[Tuple[Any], Tuple[int], Tuple[int]]:
sl: tuple[Any], naxis: int
) -> tuple[tuple[Any], tuple[int], tuple[int]]:
"""Sanitize and extract information from the arguments to an array indexing.

Parameters
Expand Down
4 changes: 2 additions & 2 deletions caput/tod.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import glob
import inspect
from typing import Any, Tuple
from typing import Any

import h5py
import numpy as np
Expand Down Expand Up @@ -645,7 +645,7 @@ def _copy_non_time_data(
return [n[1:] if n[0] == "/" else n for n in to_dataset_names]


def _dset_has_axis(entry: Any, axes: Tuple[str]) -> bool:
def _dset_has_axis(entry: Any, axes: tuple[str]) -> bool:
"""Check if `entry` is a dataset with an axis named in `axes`."""
if memh5.is_group(entry):
return False
Expand Down
3 changes: 1 addition & 2 deletions caput/tools.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
"""Collection of assorted tools."""

from collections import deque
from collections.abc import Mapping
from collections.abc import Iterable, Mapping
from itertools import chain
from numbers import Number
from sys import getsizeof
from types import ModuleType
from typing import Iterable

import numpy as np

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ exclude = [
"*/__init__.py",
]

target-version = "py38"
target-version = "py39"

[tool.versioneer]
VCS = "git"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
[console_scripts]
caput-pipeline=caput.scripts.runner:cli
""",
python_requires=">=3.8",
python_requires=">=3.9",
install_requires=requires,
extras_require={
"mpi": ["mpi4py>=1.3"],
Expand Down
Loading