Skip to content

Commit

Permalink
all functions in documentation and all whatsnew
Browse files Browse the repository at this point in the history
Reestructured documentation and added most of the desired pages at least iwth moc text.

Update dall whatsnew
  • Loading branch information
shirubana committed Oct 5, 2019
1 parent 01a4dbb commit a3deb34
Show file tree
Hide file tree
Showing 82 changed files with 958 additions and 386 deletions.
23 changes: 13 additions & 10 deletions bifacial_radiance/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
Bifacial_radiance results are .csv format files stored in a results folder
autogenerated in the location where the RadianceObj was set to build its scene.
If no path was provided for the RadianceObj to build its scene, it defaults to
TEMP folder in bifacial_radiance > bifacial_radiance
TEMP folder in bifacial_radiance \\ bifacial_radiance
"""

# #DocumentationCheck : Introduced in bifacial_radiance v0.2.4 -- added load.py routines

def load_inputvariablesfile(intputfile):
"""
Loads inputfile which must be in the bifacial_radiance directory,
and must be a *.py file with all the variables, and organizes the variables
and must be a ``.py`` file with all the variables, and organizes the variables
into dictionaries that it returns
Parameters
----------
inputfile : str
String of a *.py file in the bifacial_radiance directory.
String of a ``.py`` file in the bifacial_radiance directory.
Returns
-------
Expand Down Expand Up @@ -122,12 +123,14 @@ def load_inputvariablesfile(intputfile):
def loadRadianceObj(savefile=None):
"""
Load the pickled radiance object for further use
usage: (once you're in the correct local directory)
demo = bifacial_radiance.loadRadianceObj(savefile)
Usage (once you're in the correct local directory)::
demo = bifacial_radiance.loadRadianceObj(savefile)
Parameters
----------
savefile : optional savefile. Otherwise default to save.pickle
savefile : str
Optional savefile name. Otherwise default to `save.pickle`
"""
import pickle
Expand Down Expand Up @@ -197,11 +200,11 @@ def cleanResult(resultsDF, matchers=None):

def loadTrackerDict(trackerdict, fileprefix=None):
"""
Load a trackerdict by reading all files in the `\\results\\` directory.
fileprefix is used to select only certain matching files in `\\results\\`
Load a trackerdict by reading all files in the `\\results` directory.
fileprefix is used to select only certain matching files in `\\results`
It will then save the Wm2Back, Wm2Front and backRatio by reading in all valid files in the
\\results\\ directory. Note: it will match any file ending in '_key.csv'
It will then save the `Wm2Back`, `Wm2Front` and `backRatio` by reading in all valid files in the
`\\results` directory. Note: it will match any file ending in `_key.csv`
Parameters
----------
Expand Down
29 changes: 1 addition & 28 deletions bifacial_radiance/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,33 +50,6 @@
AnalysisObj: Analysis class for plotting and reporting
Revision history
0.3.0: New GUI. Modelchains implemented. Dictionaries implemented as inputs
to most functions. cell Level model capability. Axis of rotation torque
tube possible. clerance_height and hub_height distinction. New internal
Geometry handling. New/improved sensor locations. Multiple Scene object
capability for fixed scenes. HPC friendly code.
0.2.4: Module orientation deprecated. Py36 and cross-platform code compliance
implemented. Modified gendaylit to be based on sun positions by default.
More torquetube options added (round, square, hexagonal and octagonal
profiles), custom spacing between modules in a row added, included
accuracy input option for 1-axis scans, updated falsecolor routine,
module-select bug and module scan bug fixed, updates to pytests.
Update to sensor position on 1axistracking.
0.2.3: arbitrary length and position of module scans in makeScene.
Torquetube option to makeModule. New gendaylit1axis and hourly
makeOct1axis, analysis1axis
0.2.2: Negative 1 hour offset to TMY file inputs
0.2.1: Allow tmy3 input files. Use a different EPW file reader.
0.2.0: Critical 1-axis tracking update to fix geometry issues that were
over-predicting 1-axis results
0.1.1: Allow southern latitudes
0.1.0: 1-axis bug fix and validation vs PVSyst and ViewFactor model
0.0.5: 1-axis tracking draft
0.0.4: Include configuration file module.json and custom module configuration
0.0.3: Arbitrary NxR number of modules and rows for SceneObj
0.0.2: Adjustable azimuth angle other than 180
0.0.1: Initial stable release
"""
import logging
logging.basicConfig()
Expand Down Expand Up @@ -3033,7 +3006,7 @@ def makeFalseColor(self, viewfile, octfile=None, name=None):
"""
Makes a false-color plot of octfile, viewfile
.. warning::
.. note::
For Windows requires installation of falsecolor.exe,
which is part of radwinexe-5.0.a.8-win64.zip found at
http://www.jaloxa.eu/resources/radiance/radwinexe.shtml
Expand Down
14 changes: 7 additions & 7 deletions bifacial_radiance/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ def _returnTimeVals(t=None, trackerdict=None):


def runModelChain(simulationParamsDict, sceneParamsDict, timeControlParamsDict=None, moduleParamsDict=None, trackingParamsDict=None, torquetubeParamsDict=None, analysisParamsDict=None, cellLevelModuleParamsDict=None):
'''
"""
This calls config.py values, which are arranged into dictionaries,
and runs all the respective processes based on the variables in the config.py.
Still under testing!
to import the variables from a .ini file, use:
To import the variables from a .ini file, use::
(simulationParamsDict, sceneParamsDict, timeControlParamsDict, moduleParamsDict,
trackingParamsDict,torquetubeParamsDict,analysisParamsDict,cellLevelModuleParamsDict) =
bifacial_radiance.load.readconfigurationinputfile(inifile)
'''
"""

import bifacial_radiance
import os

Expand Down
8 changes: 5 additions & 3 deletions bifacial_radiance/readepw.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ def readepw(filename=None):
USAF Int USAF identifier
=============== ====== ===================
=======================================================================
========================================================================================
Data field
=======================================================================
========================================================================================
Datetime data
Dry bulb temperature in Celsius at indicated time
Dew point temperature in Celsius at indicated time
Expand Down Expand Up @@ -81,7 +82,8 @@ def readepw(filename=None):
Albedo
Liquid precipitation depth in mm at indicated time
Liquid precipitation quantity
=======================================================================
========================================================================================
S. Quoilin, October 2017
Downloaded from PVLib issue tracker on 3/16/18
Expand Down
Binary file modified docs/sphinx/source/.contributing.rst.un~
Binary file not shown.
Binary file modified docs/sphinx/source/.index.rst.un~
Binary file not shown.
Binary file modified docs/sphinx/source/.installation.rst.un~
Binary file not shown.
Binary file modified docs/sphinx/source/.manualapi.rst.un~
Binary file not shown.
Binary file added docs/sphinx/source/.modelchain.rst.un~
Binary file not shown.
Binary file modified docs/sphinx/source/.validation.rst.un~
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions docs/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ def setup(app):
# If false, no module index is generated.
#latex_domain_indices = True
"""
# extlinks alias
extlinks = {'issue': ('https://github.com/NREL/bifacial_radiance/issues/%s',
'GH'),
'wiki': ('https://github.com/NREL/bifacial_radiance/wiki/%s',
'wiki '),
'doi': ('http://dx.doi.org/%s', 'DOI: '),
'ghuser': ('https://github.com/%s', '@')}
"""
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
Expand Down
31 changes: 14 additions & 17 deletions docs/sphinx/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Contributing
============

.. note::
This contributing document is heavily based on pvlib-python
contribution guidelines. This is still a work in progress

Encouraging more people to help develop bifacial_radiance is essential to our
success. Therefore, we want to make it easy and rewarding for you to
contribute.
Expand All @@ -26,7 +30,7 @@ bifacial_radiance, git, or Python:
contribute to the conversation about how to resolve them.
* Improve the documentation and the unit tests.
* Improve the IPython/Jupyter Notebook tutorials or write new ones that
demonstrate how to use pvlib-python in your area of expertise.
demonstrate how to use bifacial_radiance in your area of expertise.
* Tell your friends and colleagues about bifacial_radiance
* Add your project to our
`Projects and publications that use bifacial_radiance wiki
Expand Down Expand Up @@ -106,7 +110,7 @@ Of course, sometimes it is necessary to make a large pull request. We
only ask that you take a few minutes to consider how to break it into
smaller chunks before proceeding.

bifacial_radiance contains :ref:`3 "layers" of code <modeling-paradigms>`:
bifacial_radiance contains 3 layers of code:
functions, analysis, and ModelChain. We recommend that
contributors focus their work on only one or two of those layers in a
single pull request.
Expand Down Expand Up @@ -138,7 +142,7 @@ a timely manner is to:
#. Start by creating an issue. The issue should be well-defined and
actionable.
#. Ask the maintainers to tag the issue with the appropriate milestone.
#. Tag pvlib community members or ``@bifacial_radiance/maintainer`` when the pull
#. Tag bifacial_radiance community members or ``@bifacial_radiance/maintainer`` when the pull
request is ready for review. (see :ref:`pull-request-reviews`)


Expand All @@ -148,7 +152,7 @@ Pull request reviews
--------------------

The bifacial_radiance community and maintainers will review your pull request in a
timely fashion. Please "ping" ``@bifaical_radinace/maintainer`` if it seems that
timely fashion. Please "ping" ``@bifacial_radinace/maintainer`` if it seems that
your pull request has been forgotten at any point in the pull request
process.

Expand All @@ -157,7 +161,7 @@ community member brings a different perspective when reviewing code.
Some reviewers bring years of expertise in the sub-field that your code
contributes to and will focus on the details of the algorithm. Other
reviewers will be more focused on integrating your code with the rest of
pvlib, ensuring that it is feasible to maintain, that it meets the
bifacial_radiance, ensuring that it is feasible to maintain, that it meets the
:ref:`code style <code-style>` guidelines, and that it is
:ref:`comprehensively tested <testing>`. Limiting the scope of the pull
request makes it much more likely that all of these reviews can be
Expand Down Expand Up @@ -198,7 +202,7 @@ during development. ``warning`` is ok.

We typically use GitHub's
"`squash and merge` <https://help.github.com/articles/about-pull-request-merges/#squash-and-merge-your-pull-request-commits>_"
feature to merge your pull request into pvlib. GitHub will condense the
feature to merge your pull request into bifacial_radiance. GitHub will condense the
commit history of your branch into a single commit when merging into
bifacial_radiance/master (the commit history on your branch remains
unchanged). Therefore, you are free to make commits that are as big or
Expand All @@ -217,7 +221,7 @@ using the `Sphinx Napoleon extension

The numpydoc format includes a specification for the allowable input
types. Python's `duck typing <https://en.wikipedia.org/wiki/Duck_typing>`_
allows for multiple input types to work for many parameters. pvlib uses
allows for multiple input types to work for many parameters. bifacial_radiance uses
the following generic descriptors as short-hand to indicate which
specific types may be used:

Expand All @@ -233,13 +237,6 @@ A relatively easy way to test your documentation is to build it on
instructions and enabling your branch on the readthedocs
`versions admin page <http://docs.readthedocs.io/en/stable/features.html#versions>`_.

Another option is to install the required dependencies in your virtual/conda
environment. See
`docs/environment.yml <https://github.com/pvlib/pvlib-python/blob/master/docs/environment.yml>`_
for the latest dependences for building the complete documentation. Some
doc files can be compiled with fewer dependencies, but this is beyond
the scope of this guide.

.. _testing:

Testing
Expand All @@ -261,19 +258,19 @@ or, for a single test:
We suggest using pytest's ``--pdb`` flag to debug test failures rather
than using ``print`` or ``logging`` calls. For example:

``pytest pvlib --pdb``
``pytest bifacial_radiance/test/modelchain.py --pdb``

will drop you into the
`pdb debugger <https://docs.python.org/3/library/pdb.html>`_ at the
location of a test failure. As described in :ref:`code-style`, pvlib
location of a test failure. As described in :ref:`code-style`, bifacial_radiance
code does not use ``print`` or ``logging`` calls, and this also applies
to the test suite (with rare exceptions).

New unit test code should be placed in the corresponding test module in
the bifacial_radiance/test directory.

Developers **must** include comprehensive tests for any additions or
modifications to pvlib.
modifications to bifacial_radiance.

This documentation
~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit a3deb34

Please sign in to comment.