Skip to content

Commit

Permalink
Add missing imports for event sources (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe authored and kbruegge committed Feb 27, 2019
1 parent dcb64d4 commit 6e6ba5e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
12 changes: 10 additions & 2 deletions ctapipe/io/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
from .array import get_array_layout
from .eventseeker import EventSeeker
from .eventsource import EventSource, event_source
from .simteleventsource import SimTelEventSource
from .hdf5tableio import HDF5TableReader, HDF5TableWriter
from .tableio import TableWriter, TableReader

# import event sources to make them visible to EventSource.from_url
from .simteleventsource import SimTelEventSource
from .lsteventsource import LSTEventSource
from .nectarcameventsource import NectarCAMEventSource
from .targetioeventsource import TargetIOEventSource

from ctapipe.core.plugins import detect_and_import_io_plugins

detect_and_import_io_plugins()

__all__ = [
'get_array_layout',
'SimTelEventSource',
'HDF5TableWriter',
'HDF5TableReader',
'TableWriter',
'TableReader',
'EventSeeker',
'EventSource',
'event_source',
'SimTelEventSource',
'NectarCAMEventSource',
'LSTEventSource',
'TargetIOEventSource',
]
2 changes: 0 additions & 2 deletions ctapipe/io/lsteventsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ class LSTEventSource(EventSource):
EventSource for LST r0 data.
"""



def __init__(self, config=None, tool=None, **kwargs):

"""
Expand Down
17 changes: 17 additions & 0 deletions ctapipe/io/tests/test_available_sources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def test_available_sources():
from ctapipe.io.eventsource import EventSource
from ctapipe.core import non_abstract_children

# make this before the explicit imports to make sure
# all classes are avaialble even if not explicitly imported
children = non_abstract_children(EventSource)

from ctapipe.io.simteleventsource import SimTelEventSource
from ctapipe.io.lsteventsource import LSTEventSource
from ctapipe.io.nectarcameventsource import NectarCAMEventSource
from ctapipe.io.targetioeventsource import TargetIOEventSource

assert SimTelEventSource in children
assert LSTEventSource in children
assert NectarCAMEventSource in children
assert TargetIOEventSource in children

0 comments on commit 6e6ba5e

Please sign in to comment.