Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
* Removed deprecated "method" argument from solve method of PDEs
* Fixed docstring of plot method of FieldCollection
* Fixed some type hints
  • Loading branch information
david-zwicker committed Feb 16, 2024
1 parent 5180993 commit 721a066
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pde/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# determine the package version
try:
# try reading version of the automatically generated module
from ._version import __version__
from ._version import __version__ # type: ignore
except ImportError:
# determine version automatically from CVS information
from importlib.metadata import PackageNotFoundError, version
Expand Down
4 changes: 2 additions & 2 deletions pde/fields/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,10 +957,10 @@ def plot(
Args:
kind (str or list of str):
Determines the kind of the visualizations. Supported values are `image`,
`line`, `vector`, `interactive`, or `rgb`. Alternatively, `auto`
`line`, `vector`, `interactive`, or `merged`. Alternatively, `auto`
determines the best visualization based on each field itself. Instead of
a single value for all fields, a list with individual values can be
given, unless `rgb` is chosen.
given, unless `merged` is chosen.
figsize (str or tuple of numbers):
Determines the figure size. The figure size is unchanged if the string
`default` is passed. Conversely, the size is adjusted automatically when
Expand Down
4 changes: 2 additions & 2 deletions pde/grids/_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def gather(self, data: TData) -> list[TData] | None:
"""
from mpi4py.MPI import COMM_WORLD # @UnresolvedImport

return COMM_WORLD.gather(data, root=0)
return COMM_WORLD.gather(data, root=0) # type: ignore

def allgather(self, data: TData) -> list[TData]:
"""gather a value from reach node and sends them to all nodes
Expand All @@ -720,7 +720,7 @@ def allgather(self, data: TData) -> list[TData]:
"""
from mpi4py.MPI import COMM_WORLD # @UnresolvedImport

return COMM_WORLD.allgather(data)
return COMM_WORLD.allgather(data) # type: ignore

@plot_on_axes()
def plot(self, ax, **kwargs) -> None:
Expand Down
8 changes: 0 additions & 8 deletions pde/pdes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,6 @@ def solve(
from ..solvers import Controller
from ..solvers.base import SolverBase # @Reimport

# warn on deprecated argument (deprecated on 2023-05-26)
if solver == "explicit" and "method" in kwargs:
warnings.warn(
"Argument `method` has been renamed to `solver` in `solve` method",
DeprecationWarning,
)
solver = kwargs.pop("method")

# create solver instance
if callable(solver):
solver_obj = solver(pde=self, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion pde/tools/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def get_progress_bar_class(fancy: bool = True):
progress_bar_class = tqdm.tqdm
else:
# use the fancier version of the progress bar in jupyter
from tqdm.auto import tqdm as progress_bar_class
from tqdm.auto import tqdm as progress_bar_class # type: ignore

Check warning on line 46 in pde/tools/output.py

View check run for this annotation

Codecov / codecov/patch

pde/tools/output.py#L46

Added line #L46 was not covered by tests
else:
# only import text progress bar
progress_bar_class = tqdm.tqdm
Expand Down

0 comments on commit 721a066

Please sign in to comment.