diff --git a/ctapipe/core/container.py b/ctapipe/core/container.py index b7d5e6b563a..43606921e36 100644 --- a/ctapipe/core/container.py +++ b/ctapipe/core/container.py @@ -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( @@ -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, diff --git a/ctapipe/io/tests/test_hdf5.py b/ctapipe/io/tests/test_hdf5.py index a4644e7c5dc..24569c8666a 100644 --- a/ctapipe/io/tests/test_hdf5.py +++ b/ctapipe/io/tests/test_hdf5.py @@ -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