-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add missing imports for event sources (#991)
- Loading branch information
Showing
3 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |