Skip to content

Commit

Permalink
diagnostic flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
Witt-D committed Nov 1, 2023
1 parent 0d90f99 commit 9ce0ecf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gusto/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,18 +1032,18 @@ def setup(self, domain, state_fields):
if not hasattr(state_fields, self.field_name2):
field1 = state_fields(self.field_name1)
field2 = state_fields(self.field_name2, space=field1.function_space(),
pick_up=True, dump=False)
pick_up=True, dump=False)
# Attach state fields to self so that we can pick it up in compute
self.state_fields = state_fields
# The initial value for fields may not have already been set yet so we
# postpone setting it until the compute method is called
self.init_field_set = False
else:
else:
field1 = state_fields(self.field_name1)
field2 = state_fields(self.field_name2, space=field1.function_space(),
pick_up=True, dump=False)
# By default set this new field to the current value
# This may be overwritten if picking up from a checkpoint
# This may be overwritten if picking up from a checkpoint
field2.assign(field1)
self.state_fields = state_fields
self.init_field_set = True
Expand Down Expand Up @@ -1101,6 +1101,7 @@ def setup(self, domain, state_fields):

super().setup(domain, state_fields)


# TODO: unify thermodynamic diagnostics
class ThermodynamicDiagnostic(DiagnosticField):
"""Base thermodynamic diagnostic field, computing many common fields."""
Expand Down

0 comments on commit 9ce0ecf

Please sign in to comment.