Small feature request: check if the input geometry is a file handle and avoid calling open if it is
While using cfelpyutils
, I needed to load a geometry configuration using CrystFEL's format, but not from a file, from a string in memory. This was not possible, and my solution was to write it in disk, in a temporary file, load it and then remove the file.
This happened due to this line: https://gitlab.desy.de/cfel-sc-public/cfelpyutils/-/blob/main/cfelpyutils/geometry/crystfel_utils.py#L788
It would be a very small change to check if the input parameter is a file handle and, if it is, just read from it, instead of calling open.