Skip to content

Commit a3af718

Browse files
authored
Merge pull request #32 from andrewdnolan/handle_missing_attr
Reorder attr checking to avoid restart file issues
2 parents 3055890 + 08a55bb commit a3af718

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mosaic/descriptor.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,17 @@ def __init__(
114114
#: ``projection`` kwargs are provided.
115115
self.transform = transform
116116

117-
#: Boolean whether parent mesh is (planar) periodic in at least one dim
118-
self.is_periodic = attr_to_bool(mesh_ds.is_periodic)
119117
#: Boolean whether parent mesh is spherical
120118
self.is_spherical = attr_to_bool(mesh_ds.on_a_sphere)
121119

120+
if not self.is_spherical:
121+
is_periodic = attr_to_bool(mesh_ds.is_periodic)
122+
else:
123+
is_periodic = False
124+
125+
#: Boolean whether parent mesh is (planar) periodic in at least one dim
126+
self.is_periodic = is_periodic
127+
122128
# calls attribute setter method
123129
self.latlon = use_latlon
124130

0 commit comments

Comments
 (0)