Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 0 additions & 2 deletions .github/scripts/lcio.pylint.py3k.rc

This file was deleted.

8 changes: 0 additions & 8 deletions .github/scripts/runPythonChecks.sh

This file was deleted.

9 changes: 2 additions & 7 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
LCG: ["LCG_97/x86_64-centos7-gcc8-opt",
"LCG_101/x86_64-centos7-gcc11-opt",
LCG: ["LCG_101/x86_64-centos7-gcc11-opt",
"LCG_102/x86_64-centos7-gcc11-opt",
"LCG_102/x86_64-centos7-clang12-opt",
"LCG_102/x86_64-ubuntu2004-gcc9-opt"]
Expand All @@ -30,12 +29,8 @@ jobs:
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
..
make -k
ctest --output-on-failure
make install
if [[ ${{ matrix.LCG }} =~ LCG_97 ]]; then
ctest --output-on-failure -E t_anajob_py
else
ctest --output-on-failure
fi
echo "::group::Test downstream build"
cd -
export CMAKE_PREFIX_PATH=$PWD/install:$CMAKE_PREFIX_PATH
Expand Down
31 changes: 0 additions & 31 deletions .github/workflows/python.yml

This file was deleted.

1 change: 0 additions & 1 deletion examples/python/EventBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from time import time

import sys, math
from sixlcio.moves import range

def generateEvents( outputFileName, nEvents ):

Expand Down
1 change: 0 additions & 1 deletion examples/python/exampleDrivers/McParticlePlotDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from __future__ import absolute_import, unicode_literals
from pyLCIO.drivers.Driver import Driver
from ROOT import TH1D, TCanvas
from sixlcio.moves import input

class McParticlePlotDriver( Driver ):
''' Example driver to illustrate how to fill a histogram in an @EventLoop '''
Expand Down
2 changes: 0 additions & 2 deletions examples/python/lcio_ced.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import sys

from pyLCIO.io.LcioReader import LcioReader
from sixlcio.moves import range
from sixlcio.moves import input

#---------------------------------------
# load CED library
Expand Down
1 change: 0 additions & 1 deletion src/python/pyLCIO/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import absolute_import, unicode_literals
from .base.SetupLcioDictionary import setupLcioDictionary
setupLcioDictionary()

Expand Down
1 change: 0 additions & 1 deletion src/python/pyLCIO/base/DecorateLcioClasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
from ROOT import TVector3, TLorentzVector
from pyLCIO import EVENT, IMPL, IO, UTIL
from array import array
Expand Down
18 changes: 9 additions & 9 deletions src/python/pyLCIO/base/HandleExceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
from sixlcio import reraise
import inspect, sys, ROOT, pyLCIO
import inspect
import ROOT
import pyLCIO
import pyLCIO.exceptions.Exceptions

# Cope with API change with ROOT version >= 6.21
Expand All @@ -27,22 +27,22 @@ def wrappedMethod(*args, **kargs):
message = str(e)
if 'lcio::Exception' in message:
message = message.split('lcio::Exception: ')[1].split(' (C++ exception)')[0]
reraise(pyLCIO.LcioException(message), None, sys.exc_info()[2])
raise pyLCIO.LcioException(message) from e
elif 'lcio::EventException' in message:
message = message.split('lcio::EventException: ')[1].split(' (C++ exception)')[0]
reraise(pyLCIO.EventException(message), None, sys.exc_info()[2])
raise pyLCIO.EventException(message) from e
elif 'lcio::DataNotAvailableException' in message:
message = message.split('lcio::DataNotAvailableException: ')[1].split(' (C++ exception)')[0]
reraise(pyLCIO.DataNotAvailableException(message), None, sys.exc_info()[2])
raise pyLCIO.DataNotAvailableException(message) from e
elif 'lcio::ReadOnlyException' in message:
message = message.split('lcio::ReadOnlyException: ')[1].split(' (C++ exception)')[0]
reraise(pyLCIO.ReadOnlyException(message), None, sys.exc_info()[2])
raise pyLCIO.ReadOnlyException(message) from e
elif 'lcio::IOException' in message:
message = message.split('lcio::IOException: ')[1].split(' (C++ exception)')[0]
reraise(pyLCIO.IOException(message), None, sys.exc_info()[2])
raise pyLCIO.IOException(message) from e
elif 'lcio::EndOfDataException' in message:
message = message.split('lcio::EndOfDataException: ')[1].split(' (C++ exception)')[0]
reraise(pyLCIO.EndOfDataException(message), None, sys.exc_info()[2])
raise pyLCIO.EndOfDataException(message) from e
raise
return wrappedMethod

Expand Down
14 changes: 7 additions & 7 deletions src/python/pyLCIO/base/SetupLcioDictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
import os
import sys

from ROOT import gSystem
import os, sys

class RootDictLoadError(Exception):
"""Raised if gSystem.Load cannot successfully load a shared lib/dict"""
Expand All @@ -26,8 +26,8 @@ def setupLcioDictionary():
print('Loading LCIO ROOT dictionaries ...')
try:
# First try via ROOT and automatic lookup on LD_LIBRARY_PATH
try_load_lib('liblcio.so')
try_load_lib('liblcioDict.so')
try_load_lib('liblcio')
try_load_lib('liblcioDict')
return
except RootDictLoadError:
pass
Expand All @@ -43,8 +43,8 @@ def setupLcioDictionary():

for lib_dir in ['lib', 'lib64']:
try:
try_load_lib(os.path.join(lcioPath, lib_dir, 'liblcio.so'))
try_load_lib(os.path.join(lcioPath, lib_dir, 'liblcioDict.so'))
try_load_lib(os.path.join(lcioPath, lib_dir, 'liblcio'))
try_load_lib(os.path.join(lcioPath, lib_dir, 'liblcioDict'))
return
except RootDictLoadError:
pass
Expand Down
4 changes: 1 addition & 3 deletions src/python/pyLCIO/drivers/Driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''
from __future__ import absolute_import, unicode_literals
from __future__ import print_function, division
from pyLCIO import IO
from time import time

Expand Down Expand Up @@ -37,7 +35,7 @@ def processRunHeader( self, runHeader ):
''' Method that is executed for each run header '''
for driver in self.drivers:
startTime = time()
driver.processRunHeader( run )
driver.processRunHeader( runHeader )
driver.processedTime += time() - startTime

def processEvent( self, event ):
Expand Down
2 changes: 0 additions & 2 deletions src/python/pyLCIO/drivers/EventMarkerDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from pyLCIO.drivers.Driver import Driver

class EventMarkerDriver ( Driver ):
Expand Down
1 change: 0 additions & 1 deletion src/python/pyLCIO/drivers/WriteLcioDriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
from pyLCIO.drivers.Driver import Driver
from ROOT import EVENT, IOIMPL

Expand Down
2 changes: 0 additions & 2 deletions src/python/pyLCIO/exceptions/Exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import unicode_literals

class LcioException(Exception):
def __init__( self, message ):
super(LcioException, self).__init__(message)
Expand Down
5 changes: 1 addition & 4 deletions src/python/pyLCIO/io/EventLoop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,11 @@

@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''
from __future__ import absolute_import, unicode_literals
from __future__ import print_function
import os

from pyLCIO.drivers.Driver import Driver
from pyLCIO.io.LcioReader import LcioReader
from pyLCIO.io.StdHepReader import StdHepReader
from io import open

class EventLoop:
''' Class that manages a loop of LCIO events '''
Expand All @@ -37,7 +34,7 @@ def addFiles( self, files):
self.addFile( fileName )

def addFileList( self, fileListName ):
fileListFile = open( fileList, 'r' )
fileListFile = open( fileListName, 'r' )
for line in fileListFile:
self.addFile( line.strip() )
fileListFile.close()
Expand Down
2 changes: 0 additions & 2 deletions src/python/pyLCIO/io/LcioReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
import os

from pyLCIO import IOIMPL, IO
from pyLCIO.io.Reader import Reader
#from ROOT import vector
from ROOT import std

class LcioReader( Reader ):
Expand Down
7 changes: 1 addition & 6 deletions src/python/pyLCIO/io/Reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
from pyLCIO import EVENT
from sixlcio.moves import range
from io import open
import sixlcio as six

class Reader( object ):
''' Generic reader class '''
Expand All @@ -20,7 +16,7 @@ def __init__( self, reader, fileName=None ):
self.fileIter = iter( self.fileList )
self.isOpen = False

if fileName and isinstance(fileName, six.string_types):
if fileName and isinstance(fileName, str):
self.addFile( fileName )
elif isinstance( fileName, list ):
self.addFileList( fileName )
Expand Down Expand Up @@ -62,7 +58,6 @@ def __next__( self ):
self.__close__()
return next(self)

next = __next__ # for Python 2

def skip( self, nEntries ):
''' Skip entries from the stream '''
Expand Down
1 change: 0 additions & 1 deletion src/python/pyLCIO/io/StdHepReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
@author: <a href="mailto:[email protected]">Christian Grefe</a>
'''

from __future__ import absolute_import, unicode_literals
import os

from pyLCIO.io.Reader import Reader
Expand Down
2 changes: 0 additions & 2 deletions src/python/pylcio.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import absolute_import, unicode_literals
from __future__ import print_function
from pyLCIO.io.EventLoop import EventLoop
from xml.etree import ElementTree

Expand Down
Loading