Coder Social home page Coder Social logo

sandialabs / pvops Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 11.0 36.17 MB

A set of documented functions for supporting operations research of photovoltaic energy systems.

Home Page: https://pvops.readthedocs.io/en/latest/

License: Other

Python 9.25% Jupyter Notebook 90.75%
scr-2609 snl-data-analysis snl-visualization

pvops's Introduction

GitHub version License ActionStatus status

pvops contains a series of functions to facilitate fusion of text-based data with time series production data collected at photovoltaic sites. The package also contains example datasets and tutorials to help demonstrate how the functions can be used.

Installation

pvops can be installed using pip. See more information at readthedocs.

Tutorials

To get started with pvops we recommended working with the tutorials

Package Layout and Documentation

The package is delineated into the following directories.

├───docs                : Documentation directory
|
├───tutorials           : Contains tutorials of functionality
│   └─── example_data   : └─── Example data
|
└───pvops               : Source function library
    ├───tests           : ├─── Library stability tests
    ├───text            : ├─── Text processing functions
    ├───text2time       : ├─── Text2Timeseries functions
    ├───timeseries      : ├─── Timeseries functions
    └───iv              : └─── Current-voltage functions

More information about these modules is available at readthedocs.

Citing

If using this package, please cite our JOSS paper using the following:

Citation:

Bonney et al., (2023). pvOps: a Python package for empirical analysis of photovoltaic field data. 
Journal of Open Source Software, 8(91), 5755, https://doi.org/10.21105/joss.05755

BibTex:

@article{Bonney2023, 
  doi = {10.21105/joss.05755}, 
  url = {https://doi.org/10.21105/joss.05755}, 
  year = {2023}, 
  publisher = {The Open Journal}, 
  volume = {8}, 
  number = {91}, 
  pages = {5755}, 
  author = {Kirk L. Bonney and Thushara Gunda and Michael W. Hopwood and Hector Mendoza and Nicole D. Jackson}, 
  title = {pvOps: a Python package for empirical analysis of photovoltaic field data}, 
  journal = {Journal of Open Source Software} }

Contributing

The long-term success of pvops requires community support. Please see the Contributing page for more on how you can contribute.

Contributors Display

Logo Credit: Daniel Rubinstein

Copyright and License

pvops is copyright through National Technology & Engineering Solutions of Sandia (NTESS). The software is distributed under the Revised BSD License. See the LICENSE file for more information.

pvops's People

Contributors

adamrjensen avatar charity-kwha avatar hmendo avatar kandersolar avatar kbonney avatar mgeier avatar michaelhopwood avatar tgunda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pvops's Issues

[JOSS review assistance] Timeseries expected energy models

  • The iec_calc model is described as being "based on IEC calculations" and using "IEC standards" in https://pvops.readthedocs.io/en/latest/pages/moduleguides/timeseries.html#module-overview and elsewhere. It looks like a simple performance ratio. A few suggestions:
  • As far as I can tell, none of the models make use of temperature data (either back of module temp or the combo of ambient temp and wind speed) based on their own documentation. I would suggest adding this, or at least documenting why it isn't necessary. I would worry that someone like a performance engineer that is new to solar could start with this package and then assume that irradiance is all that really matters. I do see ambient temperature and wind speed passed in some of the examples, but it isn't clear to me if/how they are being used (for example, wind_speed_ms is commented out in the dynamic linear modeling example in tutorial_timeseries.ipynb).
  • Similar to the last point, AC capacity might be useful. If the AIT or linear model tool can estimate AC capacity on their own, this should probably be mentioned in the docs.
  • A comparison of the structure of these models with something like a pvwatts-style model, or PVUSA/ASTM regression, would be helpful.

[JOSS review assistance] Tutorials - general feedback

Here are some of my initial thoughts about the tutorials in general:

  • a markdown file summarizing each of the tutorials and/or suggesting an order in which a user should work through them would be helpful. I see that there is a bit more info in https://pvops.readthedocs.io/en/latest/pages/examples.html. If the readthedocs example page is the best place to start, that should be linked in the README.md when referencing the examples directory. E.g., "Refer to the examples directory, following the guide at https://pvops.readthedocs.io/en/latest/pages/examples.html, for a full run-through of the available functionality."
  • https://pvops.readthedocs.io/en/latest/pages/examples.html calls these "examples" instead of "tutorials" - I would suggest consistent terminology.
  • Incomplete abbreviations page in docs: I noticed that https://pvops.readthedocs.io/en/latest/pages/abbreviations.html is mostly incomplete. This came up when I was trying to find more context for the Timeseries AIT Tutorial.
  • In general, more text in the tutorials to give context would be helpful. Perhaps this could be done by making setting up a fictional solar plant that all of the tutorials and example data would be based on. Give it a fake name, say where it is located, how big it is, what assets it has, etc. Talk about how it has a maintenance team that keeps written maintenance logs (show an example subset of a log file), and how there is there is a weather station and power meter with measurements logged to a data historian, etc. Then describe the tasks (real-world business needs/questions) that a performance engineer (the user going through the tutorials) will be trying to complete. In the process, reference all of the example data files that will be used in the tutorials.

[JOSS review] Add Statement of Need

For the JOSS review, it is stated that the package documentation AND software paper should have a Statement of Need. Currently, I do not see a statement of need in the software documentation (readthedocs); I suggest that this is added, e.g., on the main landing page.

[JOSS review] Avoid separate doc requirements.txt

I'm confused as to why there is a separate requirements.txt file for the documentation.

Is there a reason that these dependencies are not listed here:

pvOps/setup.py

Lines 54 to 56 in fe6e657

DOCS_REQUIRE = [
'sphinx == 2.2.0'
]

I see no reason why they should not be included in the DOCS_REQUIRE, which lets you install documentation dependencies the standard way:

pip install pvops[docs]

Also, it's HIGHLY recommended to pin the versions of the documentation dependencies as this often ends up causing trouble down the road!

This is part of a JOSS review: openjournals/joss-reviews#5755

[JOSS review] Make .__version__ available

It's quasi-standard for Python packages to be able to return the package version using .__version__

This doesn't seem possible using the pvops package at the moment:

pvops.__version__

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pvops' has no attribute '__version__'

Having users easily retrieve the package version is important in science, thus I think this is somewhat important to implement.

This issue is part of a JOSS review: openjournals/joss-reviews#5755

[JOSS Review] Link to example code

In your documentation you write the following:

An example implementation of all capabilities can be found in text_class_example.py for specifics, and tutorial_textmodule.ipynb for basics.

As those two tutorial files take a central role in your documentation: Could you add links to both text_class_example.py and tutorial_textmodule.ipynb? By doing so the reader of your documentation does not need to search through your github repo.

[JOSS review] Consider changing copyright/author

I noticed that the copyright/author on the readthedocs website is different from the main author of the JOSS paper. Perhaps it should be considered changing this to something more generic, e.g., "pvOps Developers" or to Sandia who is stated in the copyright file?

Note, I have no preference for what is provided, I merely wanted to bring attention to this to ensure it is still correct.

This is part of a JOSS review: openjournals/joss-reviews#5755

pvOps/docs/conf.py

Lines 21 to 22 in fe6e657

copyright = "2021, Thushara Gunda"
author = "Thushara Gunda"

image

[JOSS review] Remove external licenses in NOTICE folder

I think it's quite unusual to include a folder with the licenses of dependencies.

One of the main reasons I'm against this is that it is a certainty that these licenses will be outdated. For example, the included pvlib license is no longer correct. pvlib does not do this, and given its affiliation with Sandia I do not think this is necessary here.

Perhaps @cwhanse can comment on this from a Sandia point of view?

[JOSS Review] Error in `tutorial_textmodule.ipynb` - supervised classification

When running the following cell I get an error.

Cell:

# Setting few cross validation splits because of few example data
results, best_model = e.classify_supervised(n_cv_splits=2, embedding='tfidf')
print('best_model', best_model)
results

Error:

UnboundLocalError: local variable 'results_df' referenced before assignment
ValueError: Invalid parameter 'normalize' for estimator RidgeClassifier(alpha=0.0). Valid parameters are: ['alpha', 'class_weight', 'copy_X', 'fit_intercept', 'max_iter', 'positive', 'random_state', 'solver', 'tol'].

Since there is some ML happening in the background it might also be related to my PC? Can you reproduce this error?

update remappings_asset csv

remove duplicate entry (substation--> substation) and 2 incorrect mappings (energy storage/batter --> energy meter and switchgear --> transformer)

[JOSS review assistance] tutorial_timeseries

Feedback on https://github.com/sandialabs/pvOps/blob/master/examples/tutorial_timeseries.ipynb:

  • A description of the example data is needed (each of the 3 files). I think it's ok to describe irradiance, ambient temp, and wind speed as "covariates", but a PV performance engineer might have to look up the definition of covariates (I just did...). In this case, I would also refer to those values as something like "met (meteorological) measurements" or "weather data" to help users put things in context.
  • Just a suggestion, but the power vs covariates charts might be more interesting if you added a 3rd dimension with color. For example, changing the color of the markers in irrad_poa_wm2 chart based on ambient temperature, or in the other two based on irradiance.
  • Repeating the visualization of all three power vs covariated after normalizing feels unecessary. Maybe consider dropping the charts before normalizing?
  • For final results: The straight line over nighttime that is not at zero makes the charts hard to interpret. I'm not sure what the cleanest solution is...
    image
  • I suggest adding scatter plots of measured vs each model
  • The "Mean squared error" and "Coefficient of determination" statistics are not immediately obvious to me. For example, it is very hard to know if 1037605.81 W is a relatively large or small error value. Including something like normalized mean bias error and normalized RMSE, with a short description of what they mean, might be helpful.
  • I suggest adding a PVWatts-style model and/or PVUSA/ASTM regression model to the model performance comparison. And/or cite sources on how these models are used/validated elsewhere. I don't have a good sense for how good these models are and whether they are appropriate to use.

[JOSS review] Test deprecation warnings

When running the tests, I get 13 warnings. Some of these are fine (e.g., divide by zero).

However, there are some deprecation warnings that should be fixed to avoid issues down the road.

  • FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '2013-10-20 00:00:00' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.
    om_df.loc[i, meta_cod] = cod_dates[i]
  • FutureWarning: Series.fillna with 'method' is deprecated and will raise in a future version. Use obj.ffill() or obj.bfill() instead.
    prod_df.loc[:, prod_ener].fillna(method="ffill", inplace=True)
  • MatplotlibDeprecationWarning: The get_cmap function was deprecated in Matplotlib 3.7 and will be removed two minor releases later. Use matplotlib.colormaps[name] or matplotlib.colormaps.get_cmap(obj) instead.
    cmap = plt.cm.get_cmap(cmap_name, len(asset_set))
  • DeprecationWarning: module 'sre_constants' is deprecated
    import sre_constants

Feel free to tick off the above boxes as these are fixed.

There's also a conversion warning, but perhaps this is ok?

RuntimeWarning: some failed to converge after 100 iterations warnings.warn(msg, RuntimeWarning)

This issue is part of a JOSS review: openjournals/joss-reviews#5755

[JOSS Review] Add package overview to documentation page

It would be great if you give an overview of your package in your documentation page. Especially the content of Figure 1 from the paper could be reused for this purpose. Especially the two columns Type of data and Highlights of functions could be very useful on the documentation page.

[JOSS review] Update abbreviations

It seems most of the terms on the abbreviations page are not defined.

Also, many of the items seem to not be abbreviations but rather symbols. Perhaps the title of this page should be changed to Terminology?

[JOSS review] Add dates to What's New

I highly suggest adding dates in parentheses next to the release version in the What's New files.

This makes it much easier to get a sense of the development process and informs which What's New entries are important to read:

Here's an example of how pvlib does it:
image

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.