Skip to content

Commit fb87689

Browse files
committed
Change field methods to use wrapped array.copyto. This makes set_state issue a warning instead of an error for real-valued EVPs.
1 parent 1388ffd commit fb87689

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dedalus/core/field.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717

1818
from ..libraries.fftw import fftw_wrappers as fftw
19+
from ..tools.array import copyto
1920
from ..tools.config import config
2021
from ..tools.cache import CachedMethod, CachedAttribute
2122
from ..tools.exceptions import UndefinedParityError
@@ -567,7 +568,7 @@ def __setitem__(self, layout, data):
567568
"""Set data viewed in a specified layout."""
568569
layout = self.dist.get_layout_object(layout)
569570
self.preset_layout(layout)
570-
np.copyto(self.data, data)
571+
copyto(self.data, data)
571572

572573
def get_basis(self, coord):
573574
return self.domain.get_basis(coord)
@@ -599,7 +600,7 @@ def set_global_data(self, global_data):
599600
self.set_local_data(global_data[np.ix_(*elements)])
600601

601602
def set_local_data(self, local_data):
602-
np.copyto(self.data, local_data)
603+
copyto(self.data, local_data)
603604

604605
def change_scales(self, scales):
605606
"""Change data to specified scales."""
@@ -619,7 +620,7 @@ def change_scales(self, scales):
619620
# Copy over scale change
620621
old_data = self.data
621622
self.preset_scales(scales)
622-
np.copyto(self.data, old_data)
623+
copyto(self.data, old_data)
623624

624625
def change_layout(self, layout):
625626
"""Change data to specified layout."""

0 commit comments

Comments
 (0)