Skip to content

Commit

Permalink
Update to PhiML 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
holl- committed Dec 22, 2024
1 parent fd85039 commit 29be132
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion phi/field/_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def shape(self) -> Shape:
if self.is_grid and '~vector' in self.values.shape:
return batch(self.geometry) & self.resolution & non_dual(self.values).without(self.resolution) & self.geometry.shape['vector']
set_shape = self.geometry.sets[self.sampled_at]
return batch(self.geometry) & (channel(self.geometry) - 'vector') & set_shape & self.values
return batch(self.geometry) & (channel(self.geometry) - 'vector') & set_shape & self.values.shape

@property
def resolution(self):
Expand Down
7 changes: 4 additions & 3 deletions phi/vis/_vis.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,12 @@ def layout_color(content: Dict[Tuple[int, int], List[Field]], indices: Dict[Tupl
if (color[idx] != None).all: # user-specified color
result_pos.append(color[idx])
else:
cmap = requires_color_map(f)
cmap: bool = requires_color_map(f)
channels = channel(f).without('vector')
channel_colors = counter + math.range_tensor(channels)
result_pos.append(math.where(cmap, wrap('cmap'), channel_colors))
counter += channels.volume * math.any(~cmap, shape)
result_pos.append(wrap('cmap') if cmap else channel_colors)
if not cmap:
counter += channels.volume
return result


Expand Down

0 comments on commit 29be132

Please sign in to comment.