This document is intended to help new collaborators to the PVInsight project get set up with a Python environment for running PVInsight algorithms. We recommend using miniconda as a package and virtual environment manager.
If you are looking to use solar-data-tools and statistical-clear-sky on your own data sets, you will want to follow the intructions for the pvi-user environment below.
If you are looking to work on or develop the solar-data-tools and statistical-clear-sky packages, you'll want to follow the instructions for the pvi-dev environment.
- Make sure that gcc and g++ are installed on your system. For Mac OS we suggest using homebrew to install these two pieces of software. For Ubuntu, you can use apt-get.
- Install miniconda: https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html
- Obtain a Mosek license. Personal-use academic licenses are available for free to people with
.eduemail addresses here: https://www.mosek.com/products/academic-licenses/ - Put license here:
~/mosek/mosek.lic
This environment grabs the latest published versions of solar-data-tools and statistical-clear-sky from Anaconda, and installs them in an environment with all the necessary support software. This is intended for users of PVInsight software.
- Create a new environment from the
pvi-user.yamlfile included in this repository, by runningconda env create -f path/to/pvi-user.yml - Activate the new environment:
conda activate pvi-user(“pvi-user” is the name of the environment) - Check that everything is installed and working correctly by running
nosetests cvxpyfrom within the new environment
This environment installs all the necessary support software, but does not install solar-data-tools or statistical-clear-sky from Anaconda. Instead, these packages are cloned from GitHub (pre-published coded) and installed as "editable" packages with pip. This allows for local editing and testing of the packages and is intending for developers of PVInsight software. After following these instructions, the developer can make changes in their local solar-data-tools and statistical-clear-sky repositories, and the environment will point to the local version. I highly recommend using this feature along with Jupyter Notebooks and the Jupypter auto-reload magic:
%load_ext autoreload
%autoreload 2With this setup, changes to the codebase are immediately propagated into the current Notebooks session, eliminating the need to reload data sets while testing new functions.
- Clone
solar-data-toolsandstatistical-clear-skyto your local machine - Create a new environment from the
pvi-dev.yamlfile included in this repository, by runningconda env create -f path/to/pvi-dev.yml - Activate the new environment:
conda activate pvi-dev(“pvi-dev” is the name of the environment) - Run the following two commands:
pip install -e path/to/solar-data-toolsandpip install -e path/to/statistical-clear-sky - Check that everything is installed and working correctly by running
nosetests cvxpyfrom within the new environment
You may find that there are a small number of errors. I currently get the following:
Ran 752 tests in 44.747s
FAILED (SKIP=147, errors=1, failures=1)
That is okay. If you get a large number of errors, then something probably went wrong with the installation of CVXPY and associated backend numerical solvers. Please contact us through our issues page, and we will try to get back to you within a week.