Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2-3-Compatibility of Python Code #75

Merged
merged 7 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ jobs:
run: |
docker run -it --name CI_container -v /home/runner/work/podio/podio:/Package -e VIEW=${{ matrix.LCG }} -v /cvmfs:/cvmfs -d clicdp/cc7-lcg96b /bin/bash
- name: Run Python Checks
continue-on-error: ${{matrix.LCG == 'LCG_96b/x86_64-centos7-gcc9-opt' }}
run: |
docker exec CI_container /bin/bash -c "./Package/.github/scripts/runPythonChecks.sh"
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,5 @@ jobs:
run: |
docker run -it --name CI_container -v /home/runner/work/podio/podio:/Package -e VIEW=${{ matrix.LCG }} -v /cvmfs:/cvmfs -d clicdp/cc7-lcg96b /bin/bash
- name: Compile and test
continue-on-error: ${{matrix.LCG == 'LCG_96bpython3/x86_64-centos7-gcc8-opt' }}
run: |
docker exec CI_container /bin/bash -c "./Package/.github/scripts/compile_and_test.sh"
15 changes: 10 additions & 5 deletions python/EventStore.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@


from __future__ import absolute_import, unicode_literals, print_function
from six.moves import range
vvolkl marked this conversation as resolved.
Show resolved Hide resolved

from ROOT import gSystem
gSystem.Load("libpodioRootIO")
from ROOT import podio
Expand All @@ -6,7 +11,7 @@
def iterator(self):
'''dynamically added iterator'''
entries = self.size()
for entry in xrange(entries):
for entry in range(entries):
yield self.at(entry)


Expand Down Expand Up @@ -36,7 +41,7 @@ def __init__(self, filenames, treename=None):
files matching a wildcard pattern.
treename: not used at the moment
'''
if isinstance(filenames,str):
if isinstance(filenames, str):
filenames = (filenames,)
self.files = filenames
self.stores = []
Expand All @@ -53,7 +58,7 @@ def __init__(self, filenames, treename=None):
def __str__(self):
result = "Content:"
for item in self.current_store.getCollectionNames():
result += "\n\t%s" %item
result += "\n\t%s" % item
return result

def get(self, name):
Expand Down Expand Up @@ -86,7 +91,7 @@ def current_filename(self):
return None
else:
return self.current_store.fname

def __enter__(self):
return self

Expand All @@ -99,7 +104,7 @@ def __iter__(self):
'''
for nev, store in self.stores:
self.current_store = store
for entry in xrange(store.getEntries()):
for entry in range(store.getEntries()):
yield store
store.endOfEvent()

Expand Down
Loading