Skip to content

Commit

Permalink
Patch 1.2.d; compatibility fixes for Kivy v.1.11.0 and more
Browse files Browse the repository at this point in the history
  • Loading branch information
rconcep committed Jun 4, 2019
1 parent 13440d0 commit 8532a5c
Show file tree
Hide file tree
Showing 16 changed files with 146 additions and 91 deletions.
52 changes: 52 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
dist: xenial # required for Python >= 3.7
language: python
sudo: false # if false, use TravisCI's container based build

python:
- "3.6"
- "3.7"

addons:
apt:
packages:
- ccache

cache:
directories:
- $HOME/.ccache

before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start

# setup miniconda for numpy, scipy, pandas
before_install:
- echo "before install"
- export PATH=/usr/lib/ccache:$PATH
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a

install:
- echo "install"
- conda env create python=$TRAVIS_PYTHON_VERSION --file ci/environment.yml
- source activate test_env
- conda list
- echo $PATH
- ls -l /home/travis/miniconda/envs/test_env/lib
- pip install git+https://github.com/PyUtilib/pyutilib.git
- pip install git+https://github.com/Pyomo/pyomo.git
- conda install kivy -c conda-forge
- conda install -c conda-forge glpk
- python setup.py develop

script:
- python -m unittest -v

after_success:
coveralls
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
# Master branch changelog

## Patch 1.2.d
### QuESt
* Removed "id" property for NavigationButton(ActionButton) widgets to address deprecation warnings.
* Added files to repository for Travis CI. We will be implementing continuous integration and unit tests over the next few updates.

#### QuESt Data Manager
* PV profiles that are obtained using PVWatts now use the "TMY3" dataset instead of the default "NSRDB" dataset.
* This is to maintain consistency with the load profiles obtained from OpenEI.org which are based on TMY3.

#### QuESt Valuation
* The "Single Run" mode in QuESt Valuation has been deprecated and removed from the GUI.
* The functionality of the "Single Run" mode is already duplicated by the "Batch Run" mode.

### Resolved issues
* Various issues due to Kivy v1.11.0 update. Backwards compatibility with Kivy v1.10.1 should be maintained.
* An issue where the settings for the QuESt BTM data management system were not respected.
* An issue where the wrong navigation bar was loaded upon entering QuESt BTM.
* An issue where attempting to start the QuESt Valuation Wizard (on the second screen) or QuESt Valuation Batch Runs (when selecting a market area) after a fresh or install or with no `/data/` directory resulted in a fatal crash.

## Patch 1.2.c
### Resolved issues
* An issue where attempting to download ISO/RTO market data for ERCOT resulted in a fatal crash.

## Patch 1.2.b

### Resolved issues
* An issue where attempting to export a PNG from a results viewer when solved models were selected but no plot had yet been drawn resulted in a fatal crash.

Expand Down
3 changes: 0 additions & 3 deletions QuESt.kv
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
#:include es_gui/apps/data_manager/pv.kv

#:include es_gui/apps/valuation/home.kv
#:include es_gui/apps/valuation/valuationscreen.kv
#:include es_gui/apps/valuation/batchrunscreen.kv
#:include es_gui/apps/valuation/results_viewer.kv
#:include es_gui/apps/valuation/setparametersscreen.kv
#:include es_gui/apps/valuation/loaddatascreen.kv
#:include es_gui/apps/valuation/wizard.kv
#:include es_gui/apps/valuation/reporting.kv

Expand Down
36 changes: 25 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<img src="es_gui/resources/logo/Quest_Logo_RGB.png" alt="QuESt logo" width=300px margin="auto" />

# QuESt: Optimizing Energy Storage
Current release version: 1.2.c
Current release version: 1.2.d

Release date: 05/03/19
Release date: 06/04/19

## Table of contents
- [Introduction](#intro)
Expand Down Expand Up @@ -53,23 +53,36 @@ The software is designed to be used by anyone with an interest in performing ana
## Getting started
<a id="getting-started"></a>

### Installing from executable
### Installing from executable (recommended)
Running QuESt from an executable is the most straightforward way to get started with QuESt. You do not require any Python installation to install QuESt with this method; simply run the executable. What is required:

#### Windows 10
For Windows 10 users, we will offer an executable version of QuESt. This version comes pre-packaged with its own Python environment (including Kivy) so no Python installation is required. Until further notice, you will still need to install a solver for Pyomo in order to solve optimization problems such as those in QuESt Valuation and QuESt BTM.
* QuESt executable package
* Solver compatible with Pyomo

You can find the executable version with each release in the **Releases** section:
https://github.com/rconcep/snl-quest/releases
We are currently looking into packaging a basic solver to simplify the installation process further.

#### Windows 10
You can find the executable version with each release in the [**Releases**](https://github.com/rconcep/snl-quest/releases) section.

1. Download and extract the `.zip` that is *not* labeled "Source code."
1. Download and extract the `.zip` that is *not* labeled "Source code." Its name will be `snl-quest-v{version number}-win10.zip`.
2. Inside the extracted folder, there will be a lot of files and folders. Locate the `snl-quest-v{version number}.exe` file and run it.
3. A command prompt should open along with the QuESt GUI.

### Installing from source code
#### OSX, Linux
Currently, we do not offer executable packages of QuESt for OSX or Linux operating systems. They are possible to package but we have not implemented those packaging processes yet. Installing from source code is an option.

#### Solvers compatible with Pyomo
When running the executable version of QuESt, a solver compatible for Pyomo is required to be installed and on your system path. Here are a few examples:

##### Installing GLPK (for Windows)
1. Download and extract the executables for Windows linked [here](http://winglpk.sourceforge.net/).
2. The glpk.dll and glpsol.exe files are in the `w32` and `w64` subdirectories for 32-Bit and 64-Bit Windows, respectively. These files need to be in the system path for Windows. The easiest way to do this is to move those files to the `C:\windows\system32` directory. You can also place them in the same directory as the QuESt executable.
3. (When placing the files in your system path) Try running the command ``glpsol`` in the command prompt (Windows) or terminal (OSX). If you receive a message other than something like "command not found," it means the solver is successfully installed.

### Installing from source code (advanced)
For all platforms, you can instead install QuESt using the codebase in this repository.

You will want to obtain the codebase for QuESt. You can do that by downloading a release version in a compressed archive from the "releases" tab on the GitHub repository page. Alternatively, you can clone this repository or download a compressed archive of it by clicking the "Clone or download" button on this page. We recommend keeping the QuESt files in a location where you have read/write permission. Once you have the codebase, follow the appropriate set of instructions for your operating system.
You will want to obtain the codebase for QuESt. You can do that by downloading a release version in a compressed archive from the "releases" tab on the GitHub repository page labeled as "Source code". Alternatively, you can clone this repository or download a compressed archive of it by clicking the "Clone or download" button on this page. We recommend keeping the QuESt files in a location where you have read/write permission. Once you have the codebase, follow the appropriate set of instructions for your operating system.

**Requirements**
* Python 3.6+
Expand Down Expand Up @@ -106,10 +119,11 @@ If you've installed Python using Anaconda, you may be able to install several so
#### Installing GLPK (for OSX)
You will need to either build GLPK from source or install it using the [homebrew](https://brew.sh/) package manager. This [blog post](http://arnab-deka.com/posts/2010/02/installing-glpk-on-a-mac/) may be useful.

#### Installing GLPK (for OSX via Anaconda)
#### Installing GLPK or CBC (for OSX via Anaconda)
If you've installed Python using Anaconda, you may be able to install several solvers through Anaconda's package manager with the following (according to Pyomo's [installation instructions](https://pyomo.readthedocs.io/en/latest/installation.html)):

``conda install -c conda-forge glpk``
``conda install -c conda-forge coincbc``

##### Installing IPOPT (for Windows)
1. Download and extract the pre-compiled binaries linked [here](https://www.coin-or.org/download/binary/Ipopt/). Select the latest version appropriate for your system and OS.
Expand Down
17 changes: 17 additions & 0 deletions ci/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: test_env
channels:
- conda-forge
- defaults
dependencies:
- numpy
- scipy
- pandas
- six
- matplotlib
- xlrd
- jinja2
- bs4
- requests
- urllib3
- holidays

8 changes: 3 additions & 5 deletions es_gui/apps/btm/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ class BehindTheMeterHomeScreen(Screen):
def __init__(self, **kwargs):
super(BehindTheMeterHomeScreen, self).__init__(**kwargs)

# # Initialize data management system.
# Initialize data management system.
self.dms = BtmDMS(
# max_memory=App.get_running_app().config.getint('valuation', 'valuation_dms_size')*1000,
# save_data=bool(App.get_running_app().config.getint('valuation', 'valuation_dms_save')),
save_data = True,
max_memory=App.get_running_app().config.getint('btm', 'btm_dms_size')*1000,
save_data=bool(App.get_running_app().config.getint('btm', 'btm_dms_save')),
save_name='btm_dms.p',
home_path='data',
)
Expand All @@ -34,7 +33,6 @@ def on_enter(self):
ab = self.manager.nav_bar
ab.reset_nav_bar()
ab.set_title('Behind-the-Meter Applications')
ab.build_data_manager_nav_bar()

# data_manager = App.get_running_app().data_manager

Expand Down
7 changes: 6 additions & 1 deletion es_gui/apps/data_manager/data_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ def get_markets(self):
"""Returns a keys view of all of the markets for valuation available."""
# self.scan_valuation_data_bank()

return self.data_bank['valuation'].keys()
try:
valuation_data_bank = self.data_bank['valuation']
except KeyError:
return []
else:
return self.data_bank['valuation'].keys()

def scan_valuation_data_bank(self):
"""Scans the valuation data bank to determine what data has been downloaded."""
Expand Down
2 changes: 1 addition & 1 deletion es_gui/apps/data_manager/pv.kv
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#password: True
write_tab: False
hint_text: 'API key'
text: app.App.get_running_app().config.get('data_manager_openei', 'openei_key')
text: app.App.get_running_app().config.get('datamanager-openei', 'openei_key')
size_hint_x: 0.7

BoxLayout:
Expand Down
1 change: 1 addition & 0 deletions es_gui/apps/data_manager/pv.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def get_inputs(self):
api_key, pv_params = self._validate_inputs()

# Fixed values.
pv_params['dataset'] = 'tmy3'
pv_params['radius'] = '0'
pv_params['timeframe'] = 'hourly'
pv_params['api_key'] = api_key
Expand Down
2 changes: 1 addition & 1 deletion es_gui/apps/data_manager/rate_structure.kv
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#password: True
write_tab: False
hint_text: 'API key'
text: app.App.get_running_app().config.get('data_manager_openei', 'openei_key')
text: app.App.get_running_app().config.get('datamanager-openei', 'openei_key')
size_hint_x: 0.7

BoxLayout:
Expand Down
4 changes: 2 additions & 2 deletions es_gui/apps/data_manager/widgets.kv
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
#password: True
write_tab: False
hint_text: 'Email Address'
text: app.App.get_running_app().config.get('data_manager_iso-ne', 'iso-ne_api_username')
text: app.App.get_running_app().config.get('datamanager-isone', 'iso-ne_api_username')

BoxLayout:
orientation: 'horizontal'
Expand Down Expand Up @@ -1089,7 +1089,7 @@
#password: True
write_tab: False
hint_text: 'Subscription key'
text: app.App.get_running_app().config.get('data_manager_pjm', 'pjm_subscription_key')
text: app.App.get_running_app().config.get('datamanager-pjm', 'pjm_subscription_key')

BoxLayout:
orientation: 'horizontal'
Expand Down
9 changes: 5 additions & 4 deletions es_gui/apps/valuation/home.kv
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
orientation: 'horizontal'
spacing: 10

MenuTileButton:
background_color: C(hex_pms312)
text: '[font=Modern Pictograms][size=80]r[/size][/font]\nSingle Run'
on_release: root.manager.current = 'load_data'
# MenuTileButton:
# background_color: C(hex_pms312)
# text: '[font=Modern Pictograms][size=80]r[/size][/font]\nSingle Run'
# on_release: root.manager.current = 'load_data'
# disabled: True

MenuTileButton:
id: advanced_button
Expand Down
12 changes: 6 additions & 6 deletions es_gui/apps/valuation/loaddatascreen.kv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#: kivy 1.10.0
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
#: import ListItemButton kivy.uix.listview.ListItemButton
# import ListAdapter kivy.adapters.listadapter.ListAdapter
# import ListItemButton kivy.uix.listview.ListItemButton


<LoadToolbar@BoxLayout>:
Expand All @@ -14,10 +14,10 @@
# size: self.size


<ListItemButton>:
font_size: stnd_font
selected_color: 1, 1, 1, 1
deselected_color: 0, 0, 0, 1
# <ListItemButton>:
# font_size: stnd_font
# selected_color: 1, 1, 1, 1
# deselected_color: 0, 0, 0, 1

<MySpinner@Spinner>:
background_normal: 'es_gui/resources/images/button_normal.png'
Expand Down
6 changes: 3 additions & 3 deletions es_gui/resources/settings/data_manager.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "string",
"title": "Subscription key",
"desc": "Key provided for PJM's Data Miner 2 API access.",
"section": "data_manager_pjm",
"section": "datamanager-pjm",
"key": "pjm_subscription_key"
},
{
Expand All @@ -18,7 +18,7 @@
"type": "string",
"title": "API username",
"desc": "Username for ISO-NE Web Services API account.",
"section": "data_manager_iso-ne",
"section": "datamanager-isone",
"key": "iso-ne_api_username"
},
{
Expand All @@ -29,7 +29,7 @@
"type": "string",
"title": "API key",
"desc": "Key for OpenEI, PVWatts, and other Data.gov developer network API access. Also referred to as NREL Developer Network API key.",
"section": "data_manager_openei",
"section": "datamanager-openei",
"key": "openei_key"
}
]
Loading

0 comments on commit 8532a5c

Please sign in to comment.