Code Monkey home page Code Monkey logo

solarprod's Introduction

REPOSITORY DESCRIPTION

This repository contains the code for a web page created to display solar electric production data. The code is quite generic, so it could actually be used to display any type of electric production data. You can reuse it freely under the terms of the GPL version 3 (see the LICENSE file of this repository, or below for a short note).

FEATURES

Here is the list of the current features (included in version 1.0.0)

  • Display daily data using lines.
  • Display monthly, yearly or all data using bars.
  • Display data per string, per inverter or total when available.
  • Legend allows to select shown curves.
  • Easily go to previous/next day/month/year.
  • Export displayed data as CSV.
  • Cursors (to obtain the accurate value of a data point).
  • Parent plot.
  • Child plot by clicking on the desired bar.
  • Embedded help.
  • Plant information.
  • Configuration of the application.

Ideas I have to extend the functionalities of the page are listed below

FUTURE DEVELOPMENTS

Here is the list of ideas I would like to implement

  • Nominal data.
  • Plant events.
  • Fixed scale plots.

If you have any other feature you will be interested in, please let me know. I will be pleased to develop it if I think it is a must have.

If you want to implement extension, also tell me please. Admittedly you can do what you desire with the code (under the licensing constraints), but this will avoid double work.

DEPLOYING

The script deploy.sh allows to easily deploy the web page to production server. It takes as only mandatory argument the path to the folder, where the code should be deployed.

You can select which FileSaver.js version you want by creating a FileSaver-version.local file and writing the desired version inside. Currently, FileSaver version 1.3.4 is recommended.

TESTING

End-to-end testing

The repository inculdes an extensive end-to-end test suite, for the features listed above. The testing uses Selenium WebDriver to automate browser interaction. Currently only Firefox is supported and tested against.

The tests are run in a Python virtual environment, so that no system-wide package installation is needed. To easily setup the test environment, you can use the script autotest/setup.sh, which takes as optional arguments:

  1. The path to the test directory (defaults to the script directory)
  2. The path to the code directory (defaults to autotest/../prod/)
  3. The path to the directory where profiles will be generated (defaults to profiles in test directory)
  4. The path to the directory where exported data will be saved (defaults to export in test directory)

If you are not using the latest version of Firefox you will need to create a gecko-version.local file containing the version of the marionnette to use. Unfortunatlety, I was not able to locate a compatibility table, so you will have to try various versions of the marionnette until it works. Release dates may be a good heuristic.

To run the tests, the most handy manner is to invoke

python -m unittest -v autotest[.testcase[.testfixture]]

from the root directory after having sourced the virtual environment using

source autotest/env/bin/activate

See the module init file for a list of test cases and test fixtures. Running all the test fixtures for version 1.0.0 takes approximately 25min on my PC.

Unit testing

The repository includes unit test for Javascript objects and functions. Javascript unit testing uses Jasmine, which allows to automatically run all the tests by opening unittest/testrunner.html in a web browser.

The setup of the test environment should be done automatically when running unittest/setup.sh, which takes as optional arguments:

  1. The path to the test directory (defaults to the script directory)
  2. The path to the GenTest source directory (defaults to GenTest in script directory)
  3. The path to the directory where Jasmine will be installed (defaults to jasmine in test directory)
  4. The path to the directory where GenTest will be installed (defaults to gentest in test directory)

If you want to use another version than the latest version of Jasmine, create a jasmine-version.local file containing the desired version number and if you want to use another version than the latest version of Jasmine Ajax, create a jasmine-ajax-version.local file containing the desired version number.

LICENSING INFORMATION

These programs are free software: you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

These programs are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

solarprod's People

Contributors

pasccom avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.