{ "info": { "author": "SLAC National Accelerator Laboratory - Bennet Meyers", "author_email": "bennetm@stanford.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering" ], "description": "# StatisticalClearSky\n\n[![PyPI release](https://img.shields.io/pypi/v/statistical-clear-sky.svg)](https://pypi.org/project/statistical-clear-sky/)\n[![Anaconda Cloud release](https://anaconda.org/slacgismo/statistical-clear-sky/badges/version.svg)](https://anaconda.org/slacgismo/statistical-clear-sky)\n[![Build Status](https://travis-ci.com/tadatoshi/StatisticalClearSky.svg?branch=development)](https://travis-ci.com/tadatoshi/StatisticalClearSky)\n[![codecov](https://codecov.io/gh/tadatoshi/StatisticalClearSky/branch/development/graph/badge.svg)](https://codecov.io/gh/tadatoshi/StatisticalClearSky)\n\nStatistical estimation of a clear sky signal from PV system power data\n\n## Getting Started\n\nYou can install pip package or Anaconda package for this project.\n\n### Installation\n\nIf you are using pip:\n\n```sh\n$ pip install statistical-clear-sky\n```\n\nAs of February 11, 2019, it fails because scs package installed as a dependency of cxvpy expects numpy to be already installed.\n[scs issue 85](https://github.com/cvxgrp/scs/issues/85) says, it is fixed.\nHowever, it doesn't seem to be reflected in its pip package.\nAlso, cvxpy doesn't work with numpy version less than 1.16.\nAs a work around, install numpy separatly first and then install this package.\ni.e.\n```sh\n$ pip install 'numpy>=1.16'\n$ pip install statistical-clear-sky\n```\n\nIf you are using Anaconda, the problem described above doesn't occur since numpy is already installed. And during statistical-clear-sky installation, numpy is upgraded above 1.16:\n\n```sh\n$ conda install -c slacgismo statistical-clear-sky\n```\n\n#### Solvers\n\nThe default convex solver included with cvxpy is ECOS, which is open source. However this solver tends to fail on problems with >1000 variables, as it does not work for this algorithm.\n\nSo, the default behavior of the code is to use the commercial Mosek solver. Thus, we encourage you to install it separately as below and obtain the license on your own.\n\n* [mosek](https://www.mosek.com/resources/getting-started/) - For using MOSEK solver.\n\n If you are using pip:\n ```sh\n $ pip install -f https://download.mosek.com/stable/wheel/index.html Mosek\n ```\n\n If you are using Anaconda:\n ```sh\n $ conda install -c mosek mosek==8.1.43\n ```\n\nAcademic licenses are available for free here: [https://www.mosek.com/products/academic-licenses/](https://www.mosek.com/products/academic-licenses/)\n\n## Usage\n\n### As a part of Python code or inside Jupyter notebook\n\n#### Example 1: Simplest example with the fewest number of input parameters.\n\nUsing default solver (Open Source solver: ECOS)\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d)\n\niterative_fitting.execute()\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\ndegradation_rate = iterative_fitting.degradation_rate()\n```\n\n#### Example 2: Estimating clear sky signals without degradation.\n\nYou can estimate clear sky signals based on the assumption that there is no year-to-year degradation.\nIn this case, you can set is_degradation_calculated keyword argument to False in execute method.\nBy default, it's set to True.\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d)\n\niterative_fitting.execute(is_degradation_calculated=False)\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\n```\n\n#### Example 3: Using a different solver.\n\nThe default solver ECOS is not stable with large set of input data.\nThe following example shows how to specify to use Mosek solver by passing solver_type keyword argument (to the constructor).\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d,\n solver_type='MOSEK')\n\niterative_fitting.execute()\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\ndegradation_rate = iterative_fitting.degradation_rate()\n```\n\n#### Example 4: Setting rank for Generalized Low Rank Modeling.\n\nBy default, rank of low rank matrices is specified to be 6.\nYou can change it by specifying rank_k keyword argument (in the constructor).\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d, rank_k=6)\n\niterative_fitting.execute()\n\n# Get the resulting left low rank matrix and right low rank matrix for evaluation.\nleft_low_rank_matrix = iterative_fitting.left_low_rank_matrix()\n# The above can be also obtained as l_cs_value:\nl_cs_value = iterative_fitting.l_cs_value\n\n# Get the resulting right low rank matrix for evaluation.\nright_low_rank_matrix = iterative_fitting.right_low_rank_matrix()\n# The above can be also obtained as r_cs_value:\nr_cs_value = iterative_fitting.r_cs_value\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\n\ndegradation_rate = iterative_fitting.degradation_rate()\n# The above can be also obtained as beta_value:\nbeta_value = iterative_fitting.beta_value\n```\n\n#### Example 5: Setting different hyper-parameters for minimization of objective function of Generalized Low Rank Modeling.\n\nThere are three hyper-parameters in the objective function of Generalized Low Rank Modeling, i.e. mu_l, mu_r, and tau.\nBy default, mu_l is set to 1.0, mu_r is set to 20.0, and tau is set to 0.8.\nYou can change it by specifying mu_l, mu_r, and tau keyword arguments in execute method.\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d)\n\niterative_fitting.execute(mu_l=5e2, mu_r=1e3, tau=0.9)\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\ndegradation_rate = iterative_fitting.degradation_rate()\n```\n\n#### Example 6: Setting different control parameters for minimization of objective function of Generalized Low Rank Modeling.\n\nThere are three control parameters in the objective function of Generalized Low Rank Modeling, i.e. exit criteria - exit_criterion_epsilon, and maximum number of iteration - max_iteration.\nBy default, exit_criterion_epsilon is set to 1e-3, max_iteration is set to 100.\nYou can change it by specifying eps and max_iteration keyword arguments in execute method.\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d)\n\niterative_fitting.execute(exit_criterion_epsilon=1e-6, max_iteration=10)\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\ndegradation_rate = iterative_fitting.degradation_rate()\n```\n\n#### Example 7: Setting limit on degradation rate.\n\nYou can specify the maximum degradation and minimum degradation by setting max_degradation and min_degradation keyword arguments in execute method.\nBy default, they are set not to be used.\n\n```python\nimport numpy as np\nfrom statistical_clear_sky.algorithm.iterative_fitting import IterativeFitting\n\n# Usually read from a CSV file or a database with more data,\n# covering 1 day (column) and a few years (row):\npower_signals_d = np.array([[0.0, 0.0, 0.0, 0.0],\n [1.33389997, 1.40310001, 0.67150003, 0.77249998],\n [1.42349994, 1.51800001, 1.43809998, 1.20449996],\n [1.52020001, 1.45150006, 1.84809995, 0.99949998]])\n\niterative_fitting = IterativeFitting(power_signals_d)\n\niterative_fitting.execute(max_degradation=0.0, min_degradation=-0.5)\n\nclear_sky_signals = iterative_fitting.clear_sky_signals()\ndegradation_rate = iterative_fitting.degradation_rate()\n```\n\n## Jupyter notebook examples\n\nAlternatively, you can clone this repository (GIT) and execute the example codes under notebooks folder.\n\nSimplest way to install dependencies if you are using pip is by\n\n```sh\n$ pip install -r requirements.txt\n```\n\nAs mentioned in the section, \"Getting Started\" above,\nas of February 11, 2019, it fails because scs package installed as a dependency of cxvpy expects numpy to be already installed.\n[scs issue 85](https://github.com/cvxgrp/scs/issues/85) says, it is fixed.\nHowever, it doesn't seem to be reflected in its pip package.\nAlso, cvxpy doesn't work with numpy version less than 1.16.\nAs a work around, install numpy separatly first and install the other packages using requirements.txt. i.e.\n```sh\n$ pip install 'numpy>=1.16'\n$ pip install -r requirements.txt\n```\n\n## Running the tests\n\n### Unit tests (developer tests)\n\n1. GIT clone this project.\n\n2. In the project directory in terminal,\n\n ```\n $ python -m unittest\n ```\n\n This runs all the tests under tests folder.\n\nAll the tests are placed under \"tests\" directory directly under the project directory.\nIt is using \"unittest\" that is a part of Python Standard Library by default.\nThere may be a better unit testing framework.\nBut the reason is to invite as many contributors as possible with variety of background.\n\n### Coding style tests\n\n[pylint](https://www.pylint.org/) is used to check if coding style is conforming to \"PEP 8 -- Style Guide for Python Code\"\n\nNote: We are open to use [LGTM](https://lgtm.com/).\nHowever, since we decided to use another code coverage tool [codecov](https://codecov.io/) based on a comment by project's Technical Advisory Council, we decided not to use another tool that does code coverage.\nWe are also open to use other coding style tools.\n\nExample of using pylint:\n\nIn the project directory in terminal,\n```\n$ pylint statistical_clear_sky\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://github.com/bmeyers/StatisticalClearSky/contributing) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [Semantic Versioning](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/bmeyers/StatisticalClearSky/tags).\n\n## Authors\n\n* **Bennet Meyers** - *Initial work and Main research work* - [Bennet Meyers GitHub](https://github.com/bmeyers)\n\n* **Tadatoshi Takahashi** - *Refactoring and Packaging work and Research support work* - [Tadatoshi Takahashi GitHub](https://github.com/tadatoshi)\n\nSee also the list of [contributors](https://github.com/bmeyers/StatisticalClearSky/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the BSD 2-Clause License - see the [LICENSE](LICENSE) file for details\n\n## References\n\n[1] B. Meyers, M. Tabone, and E. C. Kara, \"Statistical Clear Sky Fitting Algorithm,\" IEEE Photovoltaic Specialists Conference, 2018.\n\n## Acknowledgments\n\n* The authors would like to thank Professor Stephen Boyd from Stanford University for his input and guidance and Chris Deline, Mike Deceglie, and Dirk Jordan from NREL for collaboration.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bmeyers/StatisticalClearSky", "keywords": "solar pv photovoltaic", "license": "", "maintainer": "", "maintainer_email": "", "name": "statistical-clear-sky", "package_url": "https://pypi.org/project/statistical-clear-sky/", "platform": "", "project_url": "https://pypi.org/project/statistical-clear-sky/", "project_urls": { "Bug Reports": "https://github.com/bmeyers/StatisticalClearSky/issues", "Homepage": "https://github.com/bmeyers/StatisticalClearSky" }, "release_url": "https://pypi.org/project/statistical-clear-sky/0.2.1/", "requires_dist": [ "numpy (>=1.16)", "pandas", "seaborn", "cvxpy (>=1.0)", "solar-data-tools", "check-manifest ; extra == 'dev'", "coverage ; extra == 'test'" ], "requires_python": ">=3.6, <4", "summary": "Statistical estimation of a clear sky signal from PV system power data", "version": "0.2.1" }, "last_serial": 5679119, "releases": { "0.1.19": [ { "comment_text": "", "digests": { "md5": "dae931f84f88f99d51e4261f435358e6", "sha256": "79926a6650fa63dfcb833ffe545bb2afcbd6ab0ec5eee2a0819593703244cd4f" }, "downloads": -1, "filename": "statistical_clear_sky-0.1.19-py3-none-any.whl", "has_sig": false, "md5_digest": "dae931f84f88f99d51e4261f435358e6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6, <4", "size": 44092, "upload_time": "2019-08-14T16:38:20", "url": "https://files.pythonhosted.org/packages/3c/1e/2fc5f95782a99882a095bfb38e21750b2492c27ee6335551b529c774ce97/statistical_clear_sky-0.1.19-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d8ed6fca8714b83e166d3f69b0c29e96", "sha256": "a6efae593d2aedcb8b2712d0e0d7788b7a4c90ab052964adc5ce7b275464c2ee" }, "downloads": -1, "filename": "statistical-clear-sky-0.1.19.tar.gz", "has_sig": false, "md5_digest": "d8ed6fca8714b83e166d3f69b0c29e96", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 34405, "upload_time": "2019-03-27T03:32:18", "url": "https://files.pythonhosted.org/packages/94/41/b282e1699a29a346a1fbfbe1a1b5e1924c2757b26c96f9b27927a9462f34/statistical-clear-sky-0.1.19.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "8cfb0d1a6de6fbec2dc4e2fa8ab06855", "sha256": "c33f95282322dc74cef72d1583a440819077d1fecffbe274bad6cdc4ead7486e" }, "downloads": -1, "filename": "statistical_clear_sky-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8cfb0d1a6de6fbec2dc4e2fa8ab06855", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6, <4", "size": 44078, "upload_time": "2019-08-14T16:53:29", "url": "https://files.pythonhosted.org/packages/83/9b/07fcb156a80ab215b6ddda51df061d1c63ff9c5266c2cab75ec2f3276ec8/statistical_clear_sky-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b581746dd68ecb661bc4fcfb4c509960", "sha256": "d0e27de10159b124bbd170f603c5ebd19f0de3bff716cd78670f38bbdbeb807b" }, "downloads": -1, "filename": "statistical-clear-sky-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b581746dd68ecb661bc4fcfb4c509960", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 33675, "upload_time": "2019-08-14T16:53:31", "url": "https://files.pythonhosted.org/packages/a0/80/dbebc007e5f593da32100fd0e9141c1afa854225f6dfa6a944ffbee4bc00/statistical-clear-sky-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "d0004660b53b3179f037a6d698233366", "sha256": "4bfa5c33e86164b2fc19290bd2c8617877a0f88972b84e9330e7296845a1ce69" }, "downloads": -1, "filename": "statistical_clear_sky-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d0004660b53b3179f037a6d698233366", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6, <4", "size": 44077, "upload_time": "2019-08-14T20:36:45", "url": "https://files.pythonhosted.org/packages/58/db/a2880bb63e44cdb88212f323f605b355739b04ef97a7a76f77317dfba9e0/statistical_clear_sky-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e6953a3d44604b3be686292799072ea", "sha256": "ca9ad405f285f7a02a0e5144c9cbb549f4a4187a75e5c290819ca7740ff64df1" }, "downloads": -1, "filename": "statistical-clear-sky-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9e6953a3d44604b3be686292799072ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 34133, "upload_time": "2019-08-14T20:36:46", "url": "https://files.pythonhosted.org/packages/99/16/1aa852a6890870ef9b60ed744a87de231d4243822af46fcbdbb9e467c2a3/statistical-clear-sky-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d0004660b53b3179f037a6d698233366", "sha256": "4bfa5c33e86164b2fc19290bd2c8617877a0f88972b84e9330e7296845a1ce69" }, "downloads": -1, "filename": "statistical_clear_sky-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "d0004660b53b3179f037a6d698233366", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6, <4", "size": 44077, "upload_time": "2019-08-14T20:36:45", "url": "https://files.pythonhosted.org/packages/58/db/a2880bb63e44cdb88212f323f605b355739b04ef97a7a76f77317dfba9e0/statistical_clear_sky-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e6953a3d44604b3be686292799072ea", "sha256": "ca9ad405f285f7a02a0e5144c9cbb549f4a4187a75e5c290819ca7740ff64df1" }, "downloads": -1, "filename": "statistical-clear-sky-0.2.1.tar.gz", "has_sig": false, "md5_digest": "9e6953a3d44604b3be686292799072ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6, <4", "size": 34133, "upload_time": "2019-08-14T20:36:46", "url": "https://files.pythonhosted.org/packages/99/16/1aa852a6890870ef9b60ed744a87de231d4243822af46fcbdbb9e467c2a3/statistical-clear-sky-0.2.1.tar.gz" } ] }