Skip to content

Commit

Permalink
back in black!
Browse files Browse the repository at this point in the history
  • Loading branch information
asmundb committed Sep 20, 2024
1 parent b08959e commit d909883
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pysurfex/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ def __init__(self, name, initial_time, defs, conf, fileformat):
if self.name == "none" or self.name == "analysis":
self.var = self.create_variable(fileformat, defs, conf[self.name])
elif name == "diff":
self.field1 = self.create_variable(fileformat, defs, conf[self.name]["field1"])
self.field2 = self.create_variable(fileformat, defs, conf[self.name]["field2"])
self.field1 = self.create_variable(
fileformat, defs, conf[self.name]["field1"]
)
self.field2 = self.create_variable(
fileformat, defs, conf[self.name]["field2"]
)
elif name == "rh2q":
self.r_h = self.create_variable(fileformat, defs, conf[self.name]["rh"])
self.temp = self.create_variable(fileformat, defs, conf[self.name]["t"])
Expand Down Expand Up @@ -320,8 +324,9 @@ def read_time_step(self, geo, validtime, cache):
if self.name == "none" or self.name == "analysis":
field = self.var.read_variable(geo, validtime, cache)
elif self.name == "diff":
field = self.field1.read_variable(geo, validtime, cache) \
- self.field2.read_variable(geo, validtime, cache)
field = self.field1.read_variable(
geo, validtime, cache
) - self.field2.read_variable(geo, validtime, cache)
elif self.name == "windspeed" or self.name == "winddir":
field_x = self.x_wind.read_variable(geo, validtime, cache)
field_y = self.y_wind.read_variable(geo, validtime, cache)
Expand Down

0 comments on commit d909883

Please sign in to comment.