scikit-hep / pyhepmc

Easy-to-use Python bindings for HepMC3
https://scikit-hep.org/pyhepmc/
BSD 3-Clause "New" or "Revised" License
21 stars 11 forks source link

Make pyhepmc.open wrappable #55

Closed HDembinski closed 1 year ago

HDembinski commented 1 year ago

In impy.writer:

        # TODO fix the following in pyhepmc, we should be able
        # to use the public API and not these secrets
        op = gzip.open if file.suffix == ".gz" else open
        self._file = op(file, "wb")
        self._ios = pyiostream(self._file)
        self._writer = _WrappedWriter(self._ios, None, WriterAscii)