Skip to content

Commit

Permalink
Update phiml imports in phi.flow
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Oct 24, 2023
1 parent 14004bd commit 2e6702e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions phi/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2e6702e

Please sign in to comment.