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

Improved documentation #558

Merged
merged 1 commit into from
Apr 18, 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
9 changes: 5 additions & 4 deletions pde/fields/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@
.. codeauthor:: David Zwicker <[email protected]>
"""

# DataFieldBase has been moved to its own module on 2024-04-18.
# Add it back to `base` for the time being, so dependent code doesn't break
from . import base
from .base import FieldBase
from .collection import FieldCollection
from .datafield_base import DataFieldBase
from .scalar import ScalarField
from .tensorial import Tensor2Field
from .vectorial import VectorField

# DataFieldBase has been moved to its own module on 2024-04-18.
# Add it back to `base` for the time being, so dependent code doesn't break
from . import base # isort:skip

base.DataFieldBase = DataFieldBase # type: ignore
del base
del base # clean namespaces
6 changes: 5 additions & 1 deletion pde/tools/modelrunner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"""
Establishes hooks for the interplay between :mod:`pde` and :mod:`modelrunner`

This package is usually loaded automatically during import if :mod:`modelrunner` is
available. In this case, grids and fields of :mod:`pde` can be directly written to
storages from :mod:`modelrunner.storage`.

.. codeauthor:: David Zwicker <[email protected]>
"""

Expand Down Expand Up @@ -65,7 +69,7 @@ def load_field(storage: StorageBase, loc: Sequence[str]) -> FieldBase:
Returns:
:class:`~pde.fields.base.FieldBase`: the loaded field
"""
# get grid class that was stored
# get field class that was stored
stored_cls = decode_class(storage._read_attrs(loc).get("__class__"))
attributes = stored_cls.unserialize_attributes(storage.read_attrs(loc)) # type: ignore
return stored_cls.from_state(attributes, data=storage.read_array(loc)) # type: ignore
Expand Down
Loading