This should really be done with a contextmanager but the `if ...: close()` is better than nothing. _Originally posted by @chatcannon in https://github.com/echemdata/galvani/pull/102#discussion_r1509970154_