Skip to content

Commit

Permalink
remove Step.closeout (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored May 10, 2024
2 parents d20b642 + 531f752 commit d1a0a6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 35 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.6.0 (unreleased)
==================

- Remove unused ``Step.closeout`` [#152]

0.5.2 (2024-03-21)
==================

Expand Down
35 changes: 0 additions & 35 deletions src/stpipe/step.py
Original file line number Diff line number Diff line change
Expand Up @@ -1157,41 +1157,6 @@ def _make_output_path(
output_dir = expandvars(expanduser(output_dir))
return join(output_dir, basename)

def closeout(self, to_close=None, to_del=None):
"""Close out step processing
Parameters
----------
to_close : [object(, ...)]
List of objects with a `close` method to execute
The objects will also be deleted
to_del : [object(, ...)]
List of objects to simply delete
Notes
-----
Other operations, such as forced garbage collection
will also be done.
"""
if to_close is None:
to_close = []
if to_del is None:
to_del = []
to_del += to_close
for item in to_close:
try:
if hasattr(item, "close"):
item.close()
except Exception as exception: # noqa: PERF203
self.log.debug('Could not close "%s"Reason:\n%s', item, exception)
for item in to_del:
try:
del item
except NameError as error: # noqa: PERF203
self.log.debug("An error has occurred: %s", error)
gc.collect()

@classmethod
def _datamodels_open(cls, init, **kwargs):
"""
Expand Down

0 comments on commit d1a0a6d

Please sign in to comment.