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

Mark EventStore based I/O as deprecated #378

Merged
merged 3 commits into from
Mar 1, 2023
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: 1 addition & 1 deletion .github/workflows/edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
cmake -DENABLE_SIO=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror " \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DUSE_EXTERNAL_CATCH2=ON \
-DBUILD_TESTING=OFF\
-G Ninja ..
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/key4hep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cmake -DENABLE_SIO=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror " \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DUSE_EXTERNAL_CATCH2=ON \
-G Ninja ..
echo "::endgroup::"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
cmake -DENABLE_SIO=${{ matrix.sio }} \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror " \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DUSE_EXTERNAL_CATCH2=OFF \
-G Ninja ..
echo "::endgroup::"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cmake -DENABLE_SIO=${{ matrix.sio }} \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror " \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
-DUSE_EXTERNAL_CATCH2=OFF \
-DPODIO_SET_RPATH=ON \
-G Ninja ..
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: clang-tidy
name: clang-tidy
entry: clang-tidy -warnings-as-errors='*' -p compile_commands.json
entry: clang-tidy -warnings-as-errors='*,-clang-diagnostic-deprecated-declarations' -p compile_commands.json
types: [c++]
exclude: (tests/(datamodel|src)/.*(h|cc)|podioVersion.in.h)
language: system
Expand Down
3 changes: 2 additions & 1 deletion include/podio/ASCIIWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PODIO_ASCIIWRITER_H

#include "podio/EventStore.h"
#include "podio/utilities/Deprecated.h"

#include <fstream>
#include <functional>
Expand Down Expand Up @@ -30,7 +31,7 @@ struct ColWriter : public ColWriterBase {

typedef std::map<std::string, ColWriterBase*> FunMap;

class ASCIIWriter {
class DEPR_EVTSTORE ASCIIWriter {

public:
ASCIIWriter(const std::string& filename, EventStore* store);
Expand Down
3 changes: 2 additions & 1 deletion include/podio/EventStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "podio/GenericParameters.h"
#include "podio/ICollectionProvider.h"
#include "podio/IMetaDataProvider.h"
#include "podio/utilities/Deprecated.h"

/**
This is an *example* event store
Expand All @@ -33,7 +34,7 @@ class IReader;
typedef std::map<int, GenericParameters> RunMDMap;
typedef std::map<int, GenericParameters> ColMDMap;

class EventStore : public ICollectionProvider, public IMetaDataProvider {
class DEPR_EVTSTORE EventStore : public ICollectionProvider, public IMetaDataProvider {
public:
/// Make non-copyable
EventStore(const EventStore&) = delete;
Expand Down
3 changes: 2 additions & 1 deletion include/podio/IMetaDataProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#define PODIO_IMETADATAPROVIDER_H

#include "podio/GenericParameters.h"
#include "podio/utilities/Deprecated.h"

namespace podio {

/** Inteface to access meta data for runs, events and collections.
* @author F. Gaede, DESY
* @date Apr 2020
*/
class IMetaDataProvider {
class DEPR_EVTSTORE IMetaDataProvider {

public:
/// destructor
Expand Down
3 changes: 2 additions & 1 deletion include/podio/IReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define PODIO_IREADER_H

#include "podio/podioVersion.h"
#include "podio/utilities/Deprecated.h"

#include <algorithm>
#include <map>
Expand All @@ -22,7 +23,7 @@ class CollectionBase;
class CollectionIDTable;
class GenericParameters;

class IReader {
class DEPR_EVTSTORE IReader {
public:
virtual ~IReader() = default;
/// Read Collection of given name
Expand Down
3 changes: 2 additions & 1 deletion include/podio/PythonEventStore.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
#include "podio/EventStore.h"
#include "podio/GenericParameters.h"
#include "podio/IReader.h"
#include "podio/utilities/Deprecated.h"

#include <memory>

namespace podio {

class PythonEventStore {
class DEPR_EVTSTORE PythonEventStore {
public:
/// constructor from filename
PythonEventStore(const char* filename);
Expand Down
3 changes: 2 additions & 1 deletion include/podio/ROOTWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "podio/CollectionBase.h"
#include "podio/CollectionBranches.h"
#include "podio/EventStore.h"
#include "podio/utilities/Deprecated.h"

#include "TBranch.h"

Expand All @@ -18,7 +19,7 @@ class TFile;
class TTree;

namespace podio {
class ROOTWriter {
class DEPR_EVTSTORE ROOTWriter {

public:
ROOTWriter(const std::string& filename, EventStore* store);
Expand Down
3 changes: 2 additions & 1 deletion include/podio/SIOWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "podio/CollectionBase.h"
#include "podio/EventStore.h"
#include "podio/SIOBlock.h"
#include "podio/utilities/Deprecated.h"

// SIO specific includes
#include <sio/definitions.h>
Expand All @@ -15,7 +16,7 @@
// forward declarations

namespace podio {
class SIOWriter {
class DEPR_EVTSTORE SIOWriter {

public:
SIOWriter(const std::string& filename, EventStore* store);
Expand Down
3 changes: 2 additions & 1 deletion include/podio/TimedWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

#include "podio/BenchmarkRecorder.h"
#include "podio/BenchmarkUtil.h"
#include "podio/utilities/Deprecated.h"

#include <chrono>
#include <string>

namespace podio {

template <class WrappedWriter>
class TimedWriter {
class DEPR_EVTSTORE TimedWriter {
using ClockT = benchmark::ClockT;

public:
Expand Down
7 changes: 7 additions & 0 deletions include/podio/utilities/Deprecated.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef PODIO_UTILITIES_DEPRECATED_H
#define PODIO_UTILITIES_DEPRECATED_H

#define DEPR_EVTSTORE \
[[deprecated("The EventStore based I/O model is deprecated and will be removed. Switch to the Frame based model.")]]

#endif // PODIO_UTILITIES_DEPRECATED_H
5 changes: 4 additions & 1 deletion python/podio/EventStore.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""Python EventStore for reading files with podio generated datamodels"""

import warnings
warnings.warn("The EventStore based I/O model is deprecated and will be removed. Switch to the Frame based model.",
FutureWarning)

from ROOT import gSystem
from ROOT import gSystem # pylint: disable=wrong-import-position
gSystem.Load("libpodioPythonStore") # noqa: E402
from ROOT import podio # noqa: E402 # pylint: disable=wrong-import-position

Expand Down