Skip to content

Commit

Permalink
Clean DummyCube from review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
truth-quark committed Oct 2, 2024
1 parent 0af607b commit 53816cb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_um2netcdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def __init__(self, item_code, var_name=None, attributes=None,
self.item_code = item_code # NB: um2nc adds this at runtime
self.var_name = var_name or "unknown_var"
self.standard_name = None
self.long_name = ""
self.long_name = None # cube names appear to default to None

self.attributes = attributes or {} # needs dict for coord()
self.attributes = attributes or {} # needs dict for update()
self.cell_methods = []
self.units = units
self.data = None
Expand All @@ -101,6 +101,8 @@ def __init__(self, item_code, var_name=None, attributes=None,
self._coordinates = {c.name(): c for c in coords} if coords else {}

# update() retains attributes set in __init__()
# NB: this is unlike cubes which convert section & item to the stash code
# these tests reverse this for expediency
section, item = um2nc.to_stash_code(item_code)
self.attributes.update({um2nc.STASH: DummyStash(section, item)})

Expand Down

0 comments on commit 53816cb

Please sign in to comment.