Skip to content

Commit

Permalink
name change to avoid confusion, simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jan 21, 2022
1 parent 38b733f commit d038a63
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions yt/visualization/plot_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ def validate_plot(f):
@wraps(f)
def newfunc(*args, **kwargs):
plot = args[0]
if hasattr(plot, "data_is_valid") and not plot.data_is_valid:
if getattr(plot, "has_valid_frb", True):
plot._recreate_frb()
if hasattr(plot, "_profile_valid") and not plot._profile_valid:
if getattr(plot, "_profile_valid", True):
plot._recreate_profile()
if not plot._plot_valid:
# it is the responsibility of _setup_plots to
Expand Down
6 changes: 3 additions & 3 deletions yt/visualization/plot_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def frb(self):
# * if there's none
# * if the data has been invalidated
# * if the frb has been inalidated
if not self.data_is_valid:
if not self.has_valid_frb:
self._recreate_frb()
return self._frb

Expand Down Expand Up @@ -864,7 +864,7 @@ def __init__(self, *args, **kwargs):
PlotWindow.__init__(self, *args, **kwargs)

@property
def data_is_valid(self) -> bool:
def has_valid_frb(self) -> bool:
return self._frb is not None and self._frb._data_valid

def _setup_origin(self):
Expand Down Expand Up @@ -985,7 +985,7 @@ def _setup_plots(self):

if self._plot_valid:
return
if not self.data_is_valid:
if not self.has_valid_frb:
self._recreate_frb()
self._colorbar_valid = True
for f in list(set(self.data_source._determine_fields(self.fields))):
Expand Down

0 comments on commit d038a63

Please sign in to comment.