Skip to content

Commit

Permalink
Make sure center/radius have units
Browse files Browse the repository at this point in the history
  • Loading branch information
cphyc committed Dec 3, 2024
1 parent 34c4144 commit 3a5dd48
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions yt/visualization/plot_modifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,12 @@ def __call__(self, plot):
units = "code_length"
self.radius = self.radius.to(units)

if not hasattr(self.radius, "units"):
self.radius = plot.data.ds.quan(self.radius, "code_length")

if not hasattr(self.center, "units"):
self.center = plot.data.ds.arr(self.center, "code_length")

# This assures the radius has the appropriate size in
# the different coordinate systems, since one cannot simply
# apply a different transform for a length in the same way
Expand Down

0 comments on commit 3a5dd48

Please sign in to comment.