Skip to content

Commit

Permalink
feat: Deprecate preserve_scalars method in misc.py (#603)
Browse files Browse the repository at this point in the history
The `preserve_scalars` method in `misc.py` has been deprecated with a warning message.
  • Loading branch information
david-zwicker authored Aug 22, 2024
1 parent a58b012 commit e243936
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pde/tools/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import importlib
import json
import os
import warnings
from pathlib import Path
from typing import Any, Callable, TypeVar

Expand Down Expand Up @@ -80,6 +81,8 @@ def preserve_scalars(method: TFunc) -> TFunc:
Returns:
The decorated method
"""
# deprecated on 2024-08-21
warnings.warn("Method deprecated", DeprecationWarning)

@functools.wraps(method)
def wrapper(self, *args):
Expand Down
2 changes: 1 addition & 1 deletion tests/grids/operators/test_cartesian_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def test_laplace_matrix(ndim, rng):


@pytest.mark.parametrize(
"grid", [UnitGrid([12]), CartesianGrid([[0, 1], [4, 5.5]], 8), UnitGrid([3, 3, 3])]
"grid", [UnitGrid([12]), CartesianGrid([(0, 1), (4, 5.5)], 8), UnitGrid([3, 3, 3])]
)
@pytest.mark.parametrize("bc_val", ["auto_periodic_neumann", {"value": "sin(x)"}])
def test_poisson_solver_cartesian(grid, bc_val, rng):
Expand Down

0 comments on commit e243936

Please sign in to comment.