diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index cc4eeba90..70d60a73b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,19 +15,24 @@ jobs: - uses: cvmfs-contrib/github-action-cvmfs@v3 - uses: aidasoft/run-lcg-view@v4 with: - release-platform: LCG_102/x86_64-centos7-clang12-opt + container: centos7 + view-path: /cvmfs/sw-nightlies.hsf.org/key4hep run: | echo "::group::Setup pre-commit" - export PYTHONPATH=$(python -m site --user-site):$PYTHONPATH export PATH=/root/.local/bin:$PATH + # Newer versions of git are more cautious around the github runner + # environment and without this git rev-parse --show-cdup in pre-commit + # fails + git config --global --add safe.directory $(pwd) pip install pre-commit - # Use virtualenv from the LCG release - pip uninstall --yes virtualenv + pip install pylint==2.12.2 + pip install flake8 echo "::endgroup::" echo "::group::Run CMake" mkdir build cd build cmake .. -DENABLE_SIO=ON \ + -DENABLE_RNTUPLE=ON \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror "\ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a57fa321a..858d20849 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,12 +13,15 @@ jobs: strategy: fail-fast: false matrix: - sio: [ON] - LCG: ["LCG_102/x86_64-centos7-clang12-opt", - "LCG_102/x86_64-centos8-gcc11-opt", - "dev3/x86_64-centos7-clang12-opt", + RNTUPLE: [ON] + LCG: ["dev3/x86_64-centos7-clang12-opt", "dev4/x86_64-centos7-gcc11-opt", "dev4/x86_64-centos7-clang12-opt"] + include: + - LCG: "LCG_102/x86_64-centos7-clang12-opt" + RNTUPLE: OFF + - LCG: "LCG_102/x86_64-centos8-gcc11-opt" + RNTUPLE: OFF steps: - uses: actions/checkout@v3 - uses: cvmfs-contrib/github-action-cvmfs@v3 @@ -29,7 +32,8 @@ jobs: echo "::group::Run CMake" mkdir build install cd build - cmake -DENABLE_SIO=${{ matrix.sio }} \ + cmake -DENABLE_SIO=ON \ + -DENABLE_RNTUPLE=${{ matrix.RNTUPLE }} \ -DCMAKE_INSTALL_PREFIX=../install \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \ diff --git a/python/podio/root_io.py b/python/podio/root_io.py index 4dc6f16a7..a5f25950e 100644 --- a/python/podio/root_io.py +++ b/python/podio/root_io.py @@ -1,12 +1,12 @@ #!/usr/bin/env python3 """Python module for reading root files containing podio Frames""" -from podio.base_reader import BaseReaderMixin - from ROOT import gSystem gSystem.Load('libpodioRootIO') # noqa: E402 from ROOT import podio # noqa: E402 # pylint: disable=wrong-import-position +from podio.base_reader import BaseReaderMixin # pylint: disable=wrong-import-position + Writer = podio.ROOTFrameWriter diff --git a/python/podio/sio_io.py b/python/podio/sio_io.py index ae695fbb7..01f9d577f 100644 --- a/python/podio/sio_io.py +++ b/python/podio/sio_io.py @@ -1,8 +1,6 @@ #!/usr/bin/env python3 """Python module for reading sio files containing podio Frames""" -from podio.base_reader import BaseReaderMixin # pylint: disable=wrong-import-position - from ROOT import gSystem ret = gSystem.Load('libpodioSioIO') # noqa: 402 # Return values: -1 when it doesn't exist and -2 when there is a version mismatch @@ -10,6 +8,8 @@ raise ImportError('Error when importing libpodioSioIO') from ROOT import podio # noqa: 402 # pylint: disable=wrong-import-position +from podio.base_reader import BaseReaderMixin # pylint: disable=wrong-import-position + Writer = podio.SIOFrameWriter diff --git a/python/podio_class_generator.py b/python/podio_class_generator.py index dfd8d08ff..1c1220cf3 100755 --- a/python/podio_class_generator.py +++ b/python/podio_class_generator.py @@ -13,9 +13,9 @@ import jinja2 +from podio_schema_evolution import DataModelComparator # dealing with cyclic imports from podio.podio_config_reader import PodioConfigReader from podio.generator_utils import DataType, DefinitionError, DataModelJSONEncoder -from podio_schema_evolution import DataModelComparator # dealing with cyclic imports THIS_DIR = os.path.dirname(os.path.abspath(__file__)) TEMPLATE_DIR = os.path.join(THIS_DIR, 'templates') diff --git a/src/EventStore.cc b/src/EventStore.cc index 947d83fff..831cc7030 100644 --- a/src/EventStore.cc +++ b/src/EventStore.cc @@ -34,7 +34,7 @@ bool EventStore::get(uint32_t id, CollectionBase*& collection) const { } void EventStore::registerCollection(const std::string& name, podio::CollectionBase* coll) { - m_collections.push_back({name, coll}); + m_collections.emplace_back(name, coll); auto id = m_table->add(name); coll->setID(id); } diff --git a/src/ROOTReader.cc b/src/ROOTReader.cc index 768e099f3..a366962ac 100644 --- a/src/ROOTReader.cc +++ b/src/ROOTReader.cc @@ -133,7 +133,7 @@ CollectionBase* ROOTReader::readCollectionData(const root_utils::CollectionBranc collection->setID(id); collection->prepareAfterRead(); - m_inputs.emplace_back(std::make_pair(collection, name)); + m_inputs.emplace_back(collection, name); return collection; } diff --git a/src/SIOBlockUserData.cc b/src/SIOBlockUserData.cc index 0c6a52381..e1318add2 100644 --- a/src/SIOBlockUserData.cc +++ b/src/SIOBlockUserData.cc @@ -1,7 +1,5 @@ #include "podio/SIOBlockUserData.h" -//#define PODIO_ADD_USER_TYPE_SIO(type) static UserDataSIOBlock _default##type##CollcetionSIOBlock ; - namespace podio { static SIOBlockUserData _defaultfloatCollcetionSIOBlock; @@ -18,22 +16,3 @@ static SIOBlockUserData _defaultuint32_tCollcetionSIOBlock; static SIOBlockUserData _defaultuint64_tCollcetionSIOBlock; } // namespace podio - -// g++ -E ../src/SIOBlockUserData.cc -// PODIO_ADD_USER_TYPE_SIO(int) -// PODIO_ADD_USER_TYPE_SIO(long) -// PODIO_ADD_USER_TYPE_SIO(float) -// PODIO_ADD_USER_TYPE_SIO(double) -// PODIO_ADD_USER_TYPE_SIO(unsigned) -// PODIO_ADD_USER_TYPE_SIO(unsigned int) -// PODIO_ADD_USER_TYPE_SIO(unsigned long) -// PODIO_ADD_USER_TYPE_SIO(char) -// PODIO_ADD_USER_TYPE_SIO(short) -// PODIO_ADD_USER_TYPE_SIO(long long) -// PODIO_ADD_USER_TYPE_SIO(unsigned long long) -// PODIO_ADD_USER_TYPE_SIO(int16_t) -// PODIO_ADD_USER_TYPE_SIO(int32_t) -// PODIO_ADD_USER_TYPE_SIO(int64_t) -// PODIO_ADD_USER_TYPE_SIO(uint16_t) -// PODIO_ADD_USER_TYPE_SIO(uint32_t) -// PODIO_ADD_USER_TYPE_SIO(uint64_t) diff --git a/src/SchemaEvolution.cc b/src/SchemaEvolution.cc index 2377e5833..60b53264e 100644 --- a/src/SchemaEvolution.cc +++ b/src/SchemaEvolution.cc @@ -50,7 +50,7 @@ void SchemaEvolution::registerEvolutionFunc(const std::string& collType, SchemaV // structure and update the index if (typeIt->second.index == MapIndex::NoEvolutionAvailable) { typeIt->second.index = m_evolutionFuncs.size(); - m_evolutionFuncs.emplace_back(EvolFuncVersionMapT{}); + m_evolutionFuncs.emplace_back(); } // From here on out we don't need the mutabale any longer