From 2e6702eb0a13cd5aa736541933b582d2ebc7b2cf Mon Sep 17 00:00:00 2001 From: holl- Date: Mon, 23 Oct 2023 15:24:34 +0200 Subject: [PATCH] Update phiml imports in phi.flow --- phi/flow.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/phi/flow.py b/phi/flow.py index 94fffa9a9..7fa47057c 100644 --- a/phi/flow.py +++ b/phi/flow.py @@ -12,32 +12,34 @@ # Modules import numpy import numpy as np +import phiml +from phiml import math, backend +from phiml.math import extrapolation import phi -from . import math, geom, field, physics, vis -from .math import extrapolation, backend +from . import geom, field, physics, vis from .physics import fluid, advect, diffuse # Classes -from .math import Shape, Tensor, DType, Solve +from phiml.math import Shape, Tensor, DType, Solve from .geom import Geometry, Sphere, Box, Cuboid from .field import Field, Grid, CenteredGrid, StaggeredGrid, mask, Noise, PointCloud, Scene, resample, GeometryMask, SoftGeometryMask, HardGeometryMask from .vis import Viewer from .physics.fluid import Obstacle # Constants -from .math import PI, INF, NAN, f -from .math.extrapolation import PERIODIC, ZERO_GRADIENT +from phiml.math import PI, INF, NAN, f +from phiml.math.extrapolation import PERIODIC, ZERO_GRADIENT # Functions -from .math import ( +from phiml.math import ( wrap, tensor, vec, # Tensor creation shape, spatial, channel, batch, instance, dual, non_spatial, non_channel, non_batch, non_instance, non_dual, # Shape functions (magic) unstack, stack, concat, expand, rename_dims, pack_dims, unpack_dim, flatten, cast, # Magic Ops - jit_compile, jit_compile_linear, minimize, functional_gradient, solve_linear, solve_nonlinear, iterate, identity, # jacobian, hessian, custom_gradient # Functional magic + jit_compile, jit_compile_linear, minimize, gradient as functional_gradient, gradient, solve_linear, solve_nonlinear, iterate, identity, # jacobian, hessian, custom_gradient # Functional magic ) from .geom import union from .vis import show, view, control, plot # Exceptions -from .math import ConvergenceException, NotConverged, Diverged +from phiml.math import ConvergenceException, NotConverged, Diverged