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

Add missing imports for event sources #991

Merged
merged 1 commit into from
Feb 27, 2019
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
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