|
1 | 1 | import ctypes |
2 | 2 | import pickle as pickle0 |
3 | | -import cloudpickle as pickle1 |
4 | 3 |
|
| 4 | +import cloudpickle as pickle1 |
5 | 5 | import pytest |
6 | 6 | import numpy as np |
7 | 7 | from sympy import Symbol |
|
12 | 12 | PrecomputedSparseTimeFunction, SubDomain) |
13 | 13 | from devito.ir import Backward, Forward, GuardFactor, GuardBound, GuardBoundNext |
14 | 14 | from devito.data import LEFT, OWNED |
15 | | -from devito.finite_differences.differentiable import Weights |
16 | 15 | from devito.finite_differences.tools import direct, transpose, left, right, centered |
17 | 16 | from devito.mpi.halo_scheme import Halo |
18 | 17 | from devito.mpi.routines import (MPIStatusObject, MPIMsgEnriched, MPIRequestObject, |
19 | 18 | MPIRegion) |
20 | 19 | from devito.types import (Array, CustomDimension, Symbol as dSymbol, Scalar, |
21 | 20 | PointerArray, Lock, PThreadArray, SharedData, Timer, |
22 | 21 | DeviceID, NPThreads, ThreadID, TempFunction, Indirection, |
23 | | - FIndexed, ComponentAccess, StencilDimension) |
| 22 | + FIndexed, ComponentAccess) |
24 | 23 | from devito.types.basic import BoundSymbol, AbstractSymbol |
25 | 24 | from devito.tools import EnrichedTuple |
26 | 25 | from devito.symbolics import (IntDiv, ListInitializer, FieldFromPointer, |
@@ -431,25 +430,6 @@ def test_component_access(self, pickle): |
431 | 430 | assert new_ca.index == 1 |
432 | 431 | assert new_ca.function.name == f.name |
433 | 432 |
|
434 | | - def test_weights_to_array(self, pickle): |
435 | | - grid = Grid(shape=(3, 3, 3)) |
436 | | - x, y, z = grid.dimensions |
437 | | - h_x = x.spacing |
438 | | - |
439 | | - i = StencilDimension('i0', 0, 2) |
440 | | - w = Weights(name='w0', dimensions=i, |
441 | | - initvalue=[1/(h_x**2), 2/(h_x**2), 3/(h_x**2)]) |
442 | | - a = Array(name='w0', dimensions=w.dimensions, initvalue=w.initvalue, |
443 | | - scope='stack') |
444 | | - |
445 | | - pkl_a = pickle.dumps(a) |
446 | | - new_a = pickle.loads(pkl_a) |
447 | | - |
448 | | - # Weights optimizes `initvalue` by turning pows into muls. This test checks |
449 | | - # that the optimization is correctly carried over to the pickled object |
450 | | - # (in practice, the optimized expressions must have been frozen) |
451 | | - assert a.initvalue == new_a.initvalue |
452 | | - |
453 | 433 | def test_symbolics(self, pickle): |
454 | 434 | a = Symbol('a') |
455 | 435 |
|
|
0 commit comments