Skip to content

Commit

Permalink
Code linting
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeJones123 committed Dec 19, 2024
1 parent d42995a commit f260510
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions cads_adaptors/adaptors/cams_regional_fc/cacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,14 @@ def delete(self, fieldinfo):

class CacherS3AndFile(CacherS3):
"""Sub-class of CacherS3 to cache not only to an S3 bucket but to a local
file as well.
file as well.
"""

def __init__(self, *args, field2path=None, **kwargs):
super().__init__(*args, **kwargs)
self.field2path = field2path

def _write_field_sync(self, data, fieldinfo):

# Write to the S3 bucket
super()._write_field_sync(data, fieldinfo)

Expand All @@ -403,5 +402,5 @@ def _write_field_sync(self, data, fieldinfo):
path = self.field2path(fieldinfo)
self.logger.info(f"Caching {fieldinfo} to {path}")
os.makedirs(os.path.dirname(path), exist_ok=True)
with open(path, 'wb') as f:
with open(path, "wb") as f:
f.write(data)
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ def meteo_france_retrieve(
# Create an object that will handle the caching
if cacher is None:
cacher = CacherS3(
integration_server, logger=logger, tmpdir=tmpdir,
**(cacher_kwargs or {})
integration_server, logger=logger, tmpdir=tmpdir, **(cacher_kwargs or {})
)
with cacher:

# Create an object that will allow URL downloading in parallel
downloader = Downloader(
getter=getter,
Expand Down

0 comments on commit f260510

Please sign in to comment.