Skip to content

Commit

Permalink
Remove unnecessary state methods and locking in SCMI writer
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Oct 31, 2018
1 parent 0cf4fe1 commit 0537a4d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions satpy/writers/scmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,20 +713,6 @@ def __init__(self, filename, sector_id, ds_info, awips_info,
self.compress = compress
self.fix_awips = fix_awips

def __getstate__(self):
"""State for pickling."""
args = (self.filename, self.sector_id, self.ds_info, self.awips_info, self.xy_factors, self.tile_info)
kwargs = dict(
compress=self.compress,
fix_awips=self.fix_awips,
)
return args, kwargs

def __setstate__(self, state):
"""Restore from a pickle."""
args, kwargs = state
self.__init__(*args, **kwargs)

def __setitem__(self, key, data):
"""Write an entire tile to a file."""
if np.isnan(data).all():
Expand Down Expand Up @@ -1012,7 +998,8 @@ def save_datasets(self, datasets, sector_id=None,
sources_targets.append((tmp_tile.data, nc_wrapper))

if compute and sources_targets:
return da.store(*zip(*sources_targets))
# the NetCDF creation is per-file so we don't need to lock
return da.store(*zip(*sources_targets), lock=False)
return sources_targets


Expand Down

0 comments on commit 0537a4d

Please sign in to comment.