Skip to content

Commit

Permalink
Fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jan 23, 2024
1 parent 58522eb commit 4d5032c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions python/podio/frame_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

# pylint: disable-next=import-error # gbl is a dynamic module from cppyy
from cppyy.gbl import std
from podio.frame import Frame
import cppyy
from podio.frame import Frame


class FrameCategoryIterator:
Expand Down Expand Up @@ -32,8 +32,8 @@ def __next__(self):
frame_data = self._reader.readNextFrame(self._category)
except AttributeError:
frame_data = self._reader.readNextEntry(self._category)
except std.runtime_error:
raise StopIteration
except std.runtime_error as error:
raise StopIteration from error
if frame_data:
return Frame(std.move(frame_data))

Expand Down Expand Up @@ -67,9 +67,9 @@ def __getitem__(self, entry):
'points to the library folder of the installation of podio and also to the library '
'folder with your data model\n')
raise
except std.runtime_error:
except std.runtime_error as error:
raise IndexError('Unable to read frame, you might be trying to read beyond bounds or a '
'non-existent category')
'non-existent category') from error

if frame_data:
if isinstance(frame_data, cppyy.gbl.podio.ROOTFrameData):
Expand Down
4 changes: 3 additions & 1 deletion python/podio/root_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from ROOT import gSystem, gInterpreter
gSystem.Load('libpodioRootIO') # noqa: E402
gInterpreter.LoadFile("podio/Reader.h") # noqa: E402
gInterpreter.LoadFile("podio/Reader.h") # noqa: E402
from ROOT import podio # noqa: E402 # pylint: disable=wrong-import-position

from podio.base_reader import BaseReaderMixin # pylint: disable=wrong-import-position
Expand All @@ -26,6 +26,7 @@ def __init__(self, filenames):

super().__init__()


class ROOTFrameReader(BaseReaderMixin):
"""Reader class for reading podio root files."""

Expand Down Expand Up @@ -96,6 +97,7 @@ def __init__(self, filename):
self._writer = podio.makeWriter(filename)
super().__init__()


class ROOTFrameWriter(BaseWriterMixin):
"""Writer class for writing podio root files"""
def __init__(self, filename):
Expand Down
2 changes: 1 addition & 1 deletion src/RNTupleWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void RNTupleWriter::writeFrame(const podio::Frame& frame, const std::string& cat
}

void RNTupleWriter::writeFrame(const podio::Frame& frame, const std::string& category,
const std::vector<std::string>& collsToWrite) {
const std::vector<std::string>& collsToWrite) {
auto& catInfo = getCategoryInfo(category);

// Use the writer as proxy to check whether this category has been initialized
Expand Down

0 comments on commit 4d5032c

Please sign in to comment.