diff --git a/docs/api.rst b/docs/api.rst index 3094f86..32ed4b4 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -16,4 +16,7 @@ API Reference .. automodapi:: hvpy.datasource :no-inheritance-diagram: +.. automodapi:: hvpy.event + :no-inheritance-diagram: + .. automodapi:: hvpy.utils diff --git a/hvpy/__init__.py b/hvpy/__init__.py index 7aebce3..dbb1156 100644 --- a/hvpy/__init__.py +++ b/hvpy/__init__.py @@ -1,5 +1,6 @@ -from .facade import * from .config import set_api_url -from .version import __version__ from .datasource import * +from .event import * +from .facade import * from .utils import create_layers +from .version import __version__ diff --git a/hvpy/event.py b/hvpy/event.py new file mode 100644 index 0000000..fb25a64 --- /dev/null +++ b/hvpy/event.py @@ -0,0 +1,30 @@ +from enum import Enum + +__all__ = ["EventType"] + + +class EventType(Enum): + """ + Enum for the event types supported by Helioviewer. + """ + + ACTIVE_REGION = "AR" + CORONAL_CAVITY = "CC" + CORONAL_DIMMING = "CD" + CORONAL_HOLE = "CH" + CORONAL_JET = "CJ" + CORONAL_MASS_EJECTION = "CE" + CORONAL_RAIN = "CR" + CORONAL_WAVE = "CW" + EMERGING_FLUX = "EF" + ERUPTION = "ER" + FILAMENT = "FI" + FILAMENT_ACTIVATION = "FA" + FILAMENT_ERUPTION = "FE" + FLARE = "FL" + LOOP = "LP" + OSCILLATION = "OS" + PLAGE = "PG" + SIGMOD = "SG" + SPRAY_SURGE = "SP" + SUNSPOT = "SS" diff --git a/hvpy/tests/test_event.py b/hvpy/tests/test_event.py new file mode 100644 index 0000000..981a4b5 --- /dev/null +++ b/hvpy/tests/test_event.py @@ -0,0 +1,28 @@ +from hvpy import EventType + +helioviewer_event_types = { + "Active Region": "AR", + "Coronal Cavity": "CC", + "Coronal Dimming": "CD", + "Coronal Hole": "CH", + "Coronal Jet": "CJ", + "Coronal Mass Ejection": "CE", + "Coronal Rain": "CR", + "Coronal Wave": "CW", + "Emerging Flux": "EF", + "Eruption": "ER", + "Filament": "FI", + "Filament Activation": "FA", + "Filament Eruption": "FE", + "Flare": "FL", + "Loop": "LP", + "Oscillation": "OS", + "Plage": "PG", + "Sigmod": "SG", + "Spray Surge": "SP", + "Sunspot": "SS", +} + + +def test_event_types(): + assert [x.value for x in EventType] == list(helioviewer_event_types.values())