Skip to content

Commit

Permalink
Improved documentation (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zwicker authored Apr 18, 2024
1 parent dd1af86 commit 8191a8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
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

0 comments on commit 8191a8b

Please sign in to comment.