-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd1af86
commit 8191a8b
Showing
2 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]> | ||
""" | ||
|
||
|
@@ -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 | ||
|