Skip to content

DataManager

Ricky Concepcion edited this page Apr 7, 2020 · 3 revisions

Data Manager

The Data Manager (not to be confused with the QuESt Data Manager application or the data management systems) is a control layer class tasked with determining what data is available to use in QuESt applications. The view layer (i.e., the application GUI) queries the Data Manager when it needs to populate user interface elements. For example, QuESt Valuation may need to create toggle buttons for each market area for which the user has downloaded data. It would then query the Data Manager for that information.

Chief responsibilities of this object include:

  • Understanding the data bank structure
  • Parsing the data bank into objects recognizable by the view (e.g., turning file collections into records)

The Data Manager is defined in /es_gui/apps/data_manager/data_manager.py.

Implementation

A DataManager instance is created upon Application launch and is assigned as a member of the current running Application. It can then be accessed by using Kivy's method for getting the current running App and then accessing the DataManager member of it.

Example: Getting which market areas are available for use in QuESt Valuation

from kivy.app import App

dm = App.get_running_app().data_manager  # accesses the Data Manager
market_options = dm.get_markets()  # calls a relevant class method

Data bank

The DataManager class has no particular structure, but can generally can be described as containing the following:

  • Public methods for scanning the QuESt data bank
  • Public methods for obtaining "metadata" used to populate GUI elements
    • get_rate_structures(): returns the rate structure objects in the data bank
    • get_markets(): returns the electricity markets for which data is downloaded
  • Private methods for facilitating scanning the data bank or otherwise

New methods can be added as metadata needs grow.

Static data

In addition to analyzing the data bank, the Data Manager also works with static data. Static data refers to data used to populate the GUI independently of downloaded data. Static data is stored in /es_gui/apps/data_manager/_static/.

Examples of static data include:

  • Node ID : Node Name lookup tables for ISO/RTOs
  • Optimization model parameter names, descriptions, ranges, and mappings to Optimizer member names
  • Parameter templates for different energy storage system technologies

The goal of static data is to extract any hard-coded data/information from the GUI logic. For example, the input fields for defining different model parameters in the QuESt BTM Cost Savings wizard does not need to hardcode each of the parameters and their descriptions, etc. Instead, it loops over the elements defined in the static data and systematically adds them to view. The Data Manager can then communicate the static data to the view when requested.

Kivy notes

Although the Data Manager is a controller layer object, it is derived from the Kivy EventDispatcher class. This allows it to interact with the Application such as with triggering events.

Clone this wiki locally