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/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
python: 3.9
toxenv: py39
- os: ubuntu-latest
python: '3.10'
toxenv: py310
Expand All @@ -26,6 +23,9 @@ jobs:
- os: ubuntu-latest
python: '3.12'
toxenv: py312
- os: ubuntu-latest
python: '3.13'
toxenv: py313
runs-on: ${{ matrix.os }}

steps:
Expand Down
12 changes: 2 additions & 10 deletions docs/guides/executor.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ from concurrent.futures import Future
from typing import Callable
from typing import Iterable
from typing import Iterator
from typing import ParamSpec
from typing import TypeVar

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import ParamSpec
else: # pragma: <3.10 cover
from typing_extensions import ParamSpec

P = ParamSpec('P')
T = TypeVar('T')

Expand Down Expand Up @@ -133,13 +129,9 @@ from typing import Callable
from typing import Iterable
from typing import Iterator
from typing import Literal
from typing import ParamSpec
from typing import TypeVar

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import ParamSpec
else: # pragma: <3.10 cover
from typing_extensions import ParamSpec

from pydantic import Field

from taps.executor import ExecutorConfig
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ authors = [
]
description = "Task Performance Suite for benchmarking parallel execution frameworks."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
license = {text = "MIT"}
classifiers = [
"License :: OSI Approved :: MIT License",
Expand All @@ -25,8 +25,7 @@ dependencies = [
"parsl>=2025.07.07",
"proxystore>=0.7.0",
"psutil",
"pydantic>=2,<2.10 ; python_version<'3.9'",
"pydantic>=2 ; python_version>='3.9'",
"pydantic>=2",
"pydantic-settings>=2.3.0",
"ray[client]",
"tomli-w",
Expand Down Expand Up @@ -98,7 +97,7 @@ plugins = [
"proxystore.mypy_plugin",
"pydantic.mypy",
]
python_version = "3.12"
python_version = "3.14"
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
Expand All @@ -120,7 +119,7 @@ allow_untyped_defs = true

[tool.ruff]
line-length = 79
target-version = "py39"
target-version = "py310"

[tool.ruff.format]
indent-style = "space"
Expand Down
7 changes: 1 addition & 6 deletions taps/apps/cholesky.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

import logging
import pathlib
import sys

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import TypeAlias
else: # pragma: <3.10 cover
from typing_extensions import TypeAlias
from typing import TypeAlias

import numpy
from numpy.typing import NDArray
Expand Down
3 changes: 1 addition & 2 deletions taps/apps/configs/failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import sys
from typing import Any
from typing import Dict
from typing import Literal

if sys.version_info >= (3, 11): # pragma: >=3.11 cover
Expand All @@ -29,7 +28,7 @@ class FailureInjectionConfig(AppConfig, use_enum_values=True):
description='Application name.',
)
base: str = Field(description='Base app to inject failures into.')
config: Dict[str, Any] = Field( # noqa: UP006
config: dict[str, Any] = Field(
default_factory=dict,
description='Base app configuration.',
)
Expand Down
3 changes: 1 addition & 2 deletions taps/apps/configs/fedlearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pathlib
from typing import Any
from typing import Literal
from typing import Optional

from pydantic import Field
from pydantic import field_validator
Expand Down Expand Up @@ -64,7 +63,7 @@ class FedlearnConfig(AppConfig, use_enum_values=True):
True,
description='Evaluate the global model on test data after each round.',
)
seed: Optional[int] = Field(None, description='Random seed.') # noqa: UP045
seed: int | None = Field(None, description='Random seed.')

@field_validator('dataset', mode='before')
@classmethod
Expand Down
3 changes: 1 addition & 2 deletions taps/apps/configs/mapreduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pathlib
from typing import Literal
from typing import Optional

from pydantic import Field

Expand All @@ -20,7 +19,7 @@ class MapreduceConfig(AppConfig):
description='Application name.',
)
data_dir: pathlib.Path = Field(description='Text file directory.')
map_tasks: Optional[int] = Field( # noqa: UP045
map_tasks: int | None = Field(
32,
description=(
'Maximum number of map tasks (`None` uses one '
Expand Down
3 changes: 1 addition & 2 deletions taps/apps/configs/physics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from typing import Literal
from typing import Optional

from pydantic import Field

Expand All @@ -27,7 +26,7 @@ class PhysicsConfig(AppConfig):
tick_rate: int = Field(240, description='Simulation steps per seconds.')
total_time: int = Field(10, description='Simulation runtime in seconds.')
real_time: bool = Field(True, description='Simulate at real time.')
seed: Optional[int] = Field(None, description='Random seed.') # noqa: UP045
seed: int | None = Field(None, description='Random seed.')
terrain_width: int = Field(
20,
description='Terrain width/length in meters.',
Expand Down
3 changes: 1 addition & 2 deletions taps/apps/configs/synthetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
from typing import Any
from typing import Literal
from typing import Optional

if sys.version_info >= (3, 11): # pragma: >=3.11 cover
from typing import Self
Expand Down Expand Up @@ -41,7 +40,7 @@ class SyntheticConfig(AppConfig, use_enum_values=True):
task_count: int = Field(description='Number of tasks in the workflow.')
task_data_bytes: int = Field(0, description='Intermediate task data size.')
task_sleep: float = Field(0, description='Minimum duration of each task.')
bag_max_running: Optional[int] = Field( # noqa: UP045
bag_max_running: int | None = Field(
None,
description='Max running tasks in bag workflow.',
)
Expand Down
7 changes: 1 addition & 6 deletions taps/apps/failures/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
import logging
import pathlib
import random
import sys
from typing import Any
from typing import Callable
from typing import cast
from typing import ParamSpec
from typing import TypeVar

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import ParamSpec
else: # pragma: <3.10 cover
from typing_extensions import ParamSpec

from taps.apps import AppConfig
from taps.apps.failures.types import FAILURE_FUNCTIONS
from taps.apps.failures.types import FailureType
Expand Down
3 changes: 1 addition & 2 deletions taps/apps/fedlearn/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from collections import OrderedDict
from typing import Optional

import torch
from numpy.random import Generator
Expand All @@ -22,7 +21,7 @@ class Client(BaseModel):

idx: int = Field(description='Client ID.')
model: torch.nn.Module = Field(description='Client local model.')
data: Optional[Subset] = Field( # noqa: UP045
data: Subset | None = Field(
description='Subset of data this client will train on.',
)

Expand Down
11 changes: 2 additions & 9 deletions taps/apps/fedlearn/types.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
from __future__ import annotations

import enum
import sys
from typing import Any
from typing import Dict
from typing import TypeAlias

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import TypeAlias
else: # pragma: <3.10 cover
from typing_extensions import TypeAlias


Result: TypeAlias = Dict[str, Any] # noqa: UP006
Result: TypeAlias = dict[str, Any]
"""Result type for each FL epoch, round, and task."""


Expand Down
6 changes: 1 addition & 5 deletions taps/apps/moldesign/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@
from io import StringIO
from typing import Any
from typing import Callable
from typing import ParamSpec
from typing import TypeVar

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import ParamSpec
else: # pragma: <3.10 cover
from typing_extensions import ParamSpec

if sys.version_info >= (3, 11): # pragma: >=3.11 cover
from typing import Self
else: # pragma: <3.11 cover
Expand Down
7 changes: 6 additions & 1 deletion taps/apps/montage.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ def run(self, engine: Engine, run_dir: pathlib.Path) -> None: # noqa: PLR0915

mdiff_futures = []
logger.log(APP_LOG_LEVEL, 'Starting difference computations')
for image1, image2, output in zip(images1, images2, outputs):
for image1, image2, output in zip(
images1,
images2,
outputs,
strict=False,
):
future = engine.submit(
mdiff,
image_1=projections_dir / image1,
Expand Down
22 changes: 16 additions & 6 deletions taps/apps/physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def create_contour_plot(

x = numpy.linspace(0, config.width, num=config.width * config.resolution)
y = numpy.linspace(0, config.width, num=config.width * config.resolution)
for ax, positions in zip(axs, (initial_positions, final_positions)):
for ax, positions in zip(
axs,
(initial_positions, final_positions),
strict=False,
):
handle = ax.contour(x, y, heightmap, levels=10)
plt.clabel(handle, inline=True)
px, py = (
Expand All @@ -99,7 +103,9 @@ def create_contour_plot(
)
ax.scatter(px, py, s=16, c='#FFFFFF', zorder=100)

for i, (ax, title) in enumerate(zip(axs, ('Initial', 'Final'))):
for i, (ax, title) in enumerate(
zip(axs, ('Initial', 'Final'), strict=False),
):
ax.set_title(title)
ax.set_xlim(0, config.width)
ax.set_ylim(0, config.width)
Expand Down Expand Up @@ -141,13 +147,17 @@ def create_terrain_plot(
y = numpy.arange(0, config.width, 1 / config.resolution)
x, y = numpy.meshgrid(x, y)

for ax, positions in zip(axs, (initial_positions, final_positions)):
px, py, _ = zip(*positions)
for ax, positions in zip(
axs,
(initial_positions, final_positions),
strict=False,
):
px, py, _ = zip(*positions, strict=False)
xy = numpy.vstack([px, py])
kde = gaussian_kde(xy)(xy)
kde_grid = numpy.zeros_like(heightmap)

for i, (xi, yi) in enumerate(zip(px, py)):
for i, (xi, yi) in enumerate(zip(px, py, strict=False)):
# Clamp positions to be in [0, config.width]. If a ball rolled
# off the edge, it's position would be outside the mesh map.
max_index = (config.width * config.resolution) - 1
Expand All @@ -166,7 +176,7 @@ def create_terrain_plot(
alpha=0.9,
)

for ax, title in zip(axs, ('Initial', 'Final')):
for ax, title in zip(axs, ('Initial', 'Final'), strict=False):
ax.set_title(title, pad=-20)
ax.set_xlim(0, config.width)
ax.set_ylim(0, config.width)
Expand Down
7 changes: 3 additions & 4 deletions taps/engine/_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

from typing import Any
from typing import Optional

from pydantic import BaseModel
from pydantic import ConfigDict
Expand All @@ -22,15 +21,15 @@ class EngineConfig(BaseModel):
default_factory=ProcessPoolConfig,
description='Executor configuration.',
)
filter: Optional[FilterConfig] = Field( # noqa: UP045
filter: FilterConfig | None = Field(
default=None,
description='Filter configuration.',
)
transformer: Optional[TransformerConfig] = Field( # noqa: UP045
transformer: TransformerConfig | None = Field(
default=None,
description='Transformer configuration.',
)
task_record_file_name: Optional[str] = Field( # noqa: UP045
task_record_file_name: str | None = Field(
'tasks.jsonl',
description='Name of line-delimted JSON file to log task records to.',
)
Expand Down
11 changes: 5 additions & 6 deletions taps/engine/_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@
from typing import Generic
from typing import Iterable
from typing import Iterator
from typing import ParamSpec
from typing import Sequence
from typing import TypeVar

if sys.version_info >= (3, 10): # pragma: >=3.10 cover
from typing import ParamSpec
else: # pragma: <3.10 cover
from typing_extensions import ParamSpec

if sys.version_info >= (3, 11): # pragma: >=3.11 cover
from typing import Self
else: # pragma: <3.11 cover
Expand Down Expand Up @@ -336,7 +332,10 @@ def map(
if timeout is not None:
end_time = timeout + time.monotonic()

tasks = [self.submit(function, *args) for args in zip(*iterables)]
tasks = [
self.submit(function, *args)
for args in zip(*iterables, strict=False)
]

# Yield must be hidden in closure so that the futures are submitted
# before the first iterator value is required.
Expand Down
Loading