Skip to content

Commit ac18fdf

Browse files
committed
Update _data.py
1 parent 6348208 commit ac18fdf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

WrightTools/data/_data.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,14 +767,13 @@ def norm_for_each(
767767
If not empty, a new channel will be created.
768768
Fields (e.g. name) can be supplied by supplying a dictionary (consult `Data.create_channel`).
769769
770-
771770
Examples
772771
--------
773772
import WrightTools.datasets as ds
774773
import WrightTools as wt
775774
776775
d = wt.open(ds.wt5.v1p0p1_MoS2_TrEE_movie)
777-
d.norm_for_each("d2", "ai0") # equivalent to d.ai0[:] /= d.ai0[:].max(axis=(0,1))[None, None, :]
776+
d.norm_for_each("d2", channel="ai0") # equivalent to d.ai0[:] /= d.ai0[:].max(axis=(0,1))[None, None, :]
778777
779778
"""
780779
variables = [self.get_var(var) for var in vars]
@@ -783,7 +782,7 @@ def norm_for_each(
783782
trivial = {i for i, si in enumerate(joint_shape) if si == 1}
784783
if not trivial:
785784
raise wt_exceptions.WrightToolsWarning(
786-
f"joint variables {[var.natural_name for var in variables]} and Channel {channel.natural_name} have the same shape {channel.shape}. "
785+
f"variable(s) {[var.natural_name for var in variables]} and Channel {channel.natural_name} have the same shape {channel.shape}. "
787786
+ "Produces a ones array channel."
788787
)
789788
# nontrivial = tuple({i for i in range(self.ndim)} - trivial)
@@ -796,7 +795,7 @@ def norm_for_each(
796795
self.create_channel(
797796
new_channel.pop(
798797
"name",
799-
f"{channel.natural_name}_norm_{''.join([f'v{self.variable_names.index(v.natural_name)}' for v in variables])}",
798+
f"{channel.natural_name}_{''.join([f'v{self.variable_names.index(v.natural_name)}' for v in variables])}_norm",
800799
),
801800
values=new,
802801
**new_channel,

0 commit comments

Comments
 (0)