Skip to content

Commit

Permalink
Fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jan 3, 2019
1 parent 8e9d6fb commit 8b08f2d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions ctapipe/core/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ def as_dict(self, recursive=False, flatten=False, add_prefix=False):
if flatten:
d.update({
"{}_{}".format(key, k): v
for k, v in val.as_dict(recursive, add_prefix=add_prefix).items()
for k, v in val.as_dict(
recursive,
add_prefix=add_prefix
).items()
})
else:
d[key] = val.as_dict(
Expand Down Expand Up @@ -232,8 +235,12 @@ def as_dict(self, recursive=False, flatten=False, add_prefix=False):
for key, val in self.items():
if isinstance(val, Container) or isinstance(val, Map):
if flatten:
d.update({"{}_{}".format(key, k): v
for k, v in val.as_dict(recursive, add_prefix=add_prefix).items()})
d.update({
"{}_{}".format(key, k): v
for k, v in val.as_dict(
recursive, add_prefix=add_prefix
).items()
})
else:
d[key] = val.as_dict(
recursive=recursive,
Expand Down
2 changes: 1 addition & 1 deletion ctapipe/io/tests/test_hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_writer_closes_file(temp_h5_file):
with tempfile.NamedTemporaryFile() as f:
with HDF5TableWriter(f.name, 'test') as h5_table:

assert h5_table._h5file.isopen == 1
assert h5_table._h5file.isopen == 1

assert h5_table._h5file.isopen == 0

Expand Down

0 comments on commit 8b08f2d

Please sign in to comment.