Source code for forest.services

"""
Services
========

Application wide services to de-couple components. For example, components
need access to navigation to populate dropdown menus and widgets.


Navigation
----------

Datasets dimensions are often represented by large arrays, instead of storing the
arrays in the ``forest.redux.Store`` a service is provided to load the arrays
from key pieces of information. The key information is stored in the application
state to allow reproduction at a later date.

.. autoclass:: NavigatorServiceLocator
   :members:

.. autoclass:: NullNavigator
   :members:

"""


[docs]class NullNavigator: """Empty container to allow client-code to work if service not found"""
[docs] def variables(self, pattern): """ :returns: empty list """ return []
[docs] def initial_times(self, pattern, variable): """ :returns: empty list """ return []
[docs] def valid_times(self, pattern, variable, initial_time): """ :returns: empty list """ return []
[docs] def pressures(self, pattern, variable, initial_time): """ :returns: empty list """ return []
# TODO: Find a better place to configure this navigation = NavigatorServiceLocator()