Skip to content

Commit

Permalink
[field] PointCloud no longer simplifies sparse values on construction
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Mar 13, 2024
1 parent 4f98da0 commit 1b35443
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions phi/field/_point_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ..math.extrapolation import Extrapolation, ConstantExtrapolation, PERIODIC


def PointCloud(elements: Union[Tensor, Geometry], values: Any = 1., extrapolation: Union[Extrapolation, float] = 0., bounds: Box = None):
def PointCloud(elements: Union[Tensor, Geometry], values: Any = 1., extrapolation: Union[Extrapolation, float] = 0., bounds: Box = None) -> Field:
"""
A `PointCloud` comprises:
Expand Down Expand Up @@ -41,12 +41,12 @@ def PointCloud(elements: Union[Tensor, Geometry], values: Any = 1., extrapolatio
"""
if bounds is not None:
warnings.warn("bounds argument is deprecated since 2.5 and will be ignored.")
if dual(values):
assert dual(values).rank == 1, f"PointCloud cannot convert values with more than 1 dual dimension."
non_dual_name = dual(values).name[1:]
indices = math.stored_indices(values)[non_dual_name]
values = math.stored_values(values)
elements = elements[{non_dual_name: indices}]
# if dual(values):
# assert dual(values).rank == 1, f"PointCloud cannot convert values with more than 1 dual dimension."
# non_dual_name = dual(values).name[1:]
# indices = math.stored_indices(values)[non_dual_name]
# values = math.stored_values(values)
# elements = elements[{non_dual_name: indices}]
if isinstance(elements, Tensor):
elements = geom.Point(elements)
result = Field(elements, values, extrapolation)
Expand Down

0 comments on commit 1b35443

Please sign in to comment.