Skip to content

Commit 0ba92ab

Browse files
committed
Infer units for derived fields when quickly defining them
1 parent 405a156 commit 0ba92ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

yt/fields/field_type_container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def __getattr__(self, attr):
9494

9595
def __setattr__(self, attr, value):
9696
if isinstance(value, DerivedFieldCombination):
97-
self.ds.add_field((self.field_type, attr), value)
97+
self.ds.add_field((self.field_type, attr), value, units="auto")
9898
else:
9999
super().__setattr__(attr, value)
100100

0 commit comments

Comments
 (0)