diff --git a/docs/sphinx/source/_static/no_scrollbars.css b/docs/sphinx/source/_static/no_scrollbars.css new file mode 100644 index 0000000000..5177a66ac8 --- /dev/null +++ b/docs/sphinx/source/_static/no_scrollbars.css @@ -0,0 +1,11 @@ +/* override table width restrictions */ +/* as described in https://github.com/snide/sphinx_rtd_theme/issues/117 */ +.wy-table-responsive table td, .wy-table-responsive table th { + /* !important prevents the common CSS stylesheets from + overriding this as on RTD they are loaded after this stylesheet */ + white-space: normal !important; +} + +.wy-table-responsive { + overflow: visible !important; +} diff --git a/docs/sphinx/source/api.rst b/docs/sphinx/source/api.rst new file mode 100644 index 0000000000..3da8646bfd --- /dev/null +++ b/docs/sphinx/source/api.rst @@ -0,0 +1,413 @@ +.. currentmodule:: pvlib + +############# +API reference +############# + + +Classes +======= + +pvlib-python provides a collection of classes for users that prefer +object-oriented programming. These classes can help users keep track of +data in a more organized way, and can help to simplify the modeling +process. The classes do not add any functionality beyond the procedural +code. Most of the object methods are simple wrappers around the +corresponding procedural code. + +.. autosummary:: + :toctree: generated/ + + location.Location + pvsystem.PVSystem + tracking.SingleAxisTracker + modelchain.ModelChain + pvsystem.LocalizedPVSystem + tracking.LocalizedSingleAxisTracker + + +Solar Position +============== + +Functions and methods for calculating solar position. + +.. autosummary:: + :toctree: generated/ + + location.Location.get_solarposition + solarposition.get_solarposition + solarposition.spa_python + solarposition.ephemeris + solarposition.pyephem + solarposition.spa_c + +Additional functions for quantities closely related to solar position. + +.. autosummary:: + :toctree: generated/ + + solarposition.calc_time + solarposition.pyephem_earthsun_distance + solarposition.nrel_earthsun_distance + spa.calculate_deltat + +The spa module contains the implementation of the built-in NREL SPA +algorithm. + +.. autosummary:: + :toctree: generated/ + + spa + + +Clear sky +========= + +.. autosummary:: + :toctree: generated/ + + location.Location.get_clearsky + clearsky.ineichen + clearsky.lookup_linke_turbidity + clearsky.simplified_solis + clearsky.haurwitz + + +Airmass and atmospheric models +============================== + +.. autosummary:: + :toctree: generated/ + + location.Location.get_airmass + atmosphere.absoluteairmass + atmosphere.relativeairmass + atmosphere.pres2alt + atmosphere.alt2pres + atmosphere.gueymard94_pw + atmosphere.first_solar_spectral_correction + + +Irradiance +========== + +Methods for irradiance calculations +----------------------------------- + +.. autosummary:: + :toctree: generated/ + + pvsystem.PVSystem.get_irradiance + pvsystem.PVSystem.get_aoi + tracking.SingleAxisTracker.get_irradiance + +Decomposing and combining irradiance +------------------------------------ + +.. autosummary:: + :toctree: generated/ + + irradiance.extraradiation + irradiance.aoi + irradiance.aoi_projection + irradiance.poa_horizontal_ratio + irradiance.beam_component + irradiance.globalinplane + irradiance.grounddiffuse + +Transposition models +-------------------- + +.. autosummary:: + :toctree: generated/ + + irradiance.total_irrad + irradiance.isotropic + irradiance.perez + irradiance.haydavies + irradiance.klucher + irradiance.reindl + irradiance.king + +DNI estimation models +--------------------- + +.. autosummary:: + :toctree: generated/ + + irradiance.disc + irradiance.dirint + irradiance.erbs + irradiance.liujordan + + +PV Modeling +=========== + +Classes +------- + +The :py:class:`~pvsystem.PVSystem` class provides many methods that +wrap the functions listed below. See its documentation for details. + +.. autosummary:: + :toctree: generated/ + + pvsystem.PVSystem + pvsystem.LocalizedPVSystem + +AOI modifiers +------------- + +.. autosummary:: + :toctree: generated/ + + pvsystem.physicaliam + pvsystem.ashraeiam + pvsystem.sapm_aoi_loss + +Single diode model +------------------ + +Functions relevant for the single diode model. + +.. autosummary:: + :toctree: generated/ + + pvsystem.singlediode + pvsystem.calcparams_desoto + pvsystem.v_from_i + pvsystem.i_from_v + +SAPM model +---------- + +Functions relevant for the SAPM model. + +.. autosummary:: + :toctree: generated/ + + pvsystem.sapm + pvsystem.sapm_effective_irradiance + pvsystem.sapm_celltemp + pvsystem.sapm_spectral_loss + pvsystem.sapm_aoi_loss + pvsystem.snlinverter + +PVWatts model +------------- + +.. autosummary:: + :toctree: generated/ + + pvsystem.pvwatts_dc + pvsystem.pvwatts_ac + pvsystem.pvwatts_losses + + +Other +----- + +.. autosummary:: + :toctree: generated/ + + pvsystem.retrieve_sam + pvsystem.systemdef + pvsystem.scale_voltage_current_power + + +Tracking +======== + +SingleAxisTracker +----------------- + +The :py:class:`~tracking.SingleAxisTracker` inherits from +:py:class:`~pvsystem.PVSystem`. + +.. autosummary:: + :toctree: generated/ + + tracking.SingleAxisTracker + tracking.SingleAxisTracker.singleaxis + tracking.SingleAxisTracker.get_irradiance + tracking.SingleAxisTracker.localize + tracking.LocalizedSingleAxisTracker + +Functions +--------- + +.. autosummary:: + :toctree: generated/ + + tracking.singleaxis + + +TMY +=== + +Methods and functions for reading data from TMY files. + +.. autosummary:: + :toctree: generated/ + + location.Location.from_tmy + tmy.readtmy2 + tmy.readtmy3 + + +Forecasting +=========== + +Forecast models +--------------- + +.. autosummary:: + :toctree: generated/ + + forecast.GFS + forecast.NAM + forecast.RAP + forecast.HRRR + forecast.HRRR_ESRL + forecast.NDFD + +Getting data +------------ + +.. autosummary:: + :toctree: generated/ + + forecast.ForecastModel.get_data + forecast.ForecastModel.get_processed_data + +Processing data +--------------- + +.. autosummary:: + :toctree: generated/ + + forecast.ForecastModel.process_data + forecast.ForecastModel.rename + forecast.ForecastModel.cloud_cover_to_ghi_linear + forecast.ForecastModel.cloud_cover_to_irradiance_clearsky_scaling + forecast.ForecastModel.cloud_cover_to_transmittance_linear + forecast.ForecastModel.cloud_cover_to_irradiance_liujordan + forecast.ForecastModel.cloud_cover_to_irradiance + forecast.ForecastModel.kelvin_to_celsius + forecast.ForecastModel.isobaric_to_ambient_temperature + forecast.ForecastModel.uv_to_speed + forecast.ForecastModel.gust_to_speed + +IO support +---------- + +These are public for now, but use at your own risk. + +.. autosummary:: + :toctree: generated/ + + forecast.ForecastModel.set_dataset + forecast.ForecastModel.set_query_latlon + forecast.ForecastModel.set_location + forecast.ForecastModel.set_time + + +ModelChain +========== + +Creating a ModelChain object. + +.. autosummary:: + :toctree: generated/ + + modelchain.ModelChain + +Running +------- + +Running a ModelChain. + +.. autosummary:: + :toctree: generated/ + + modelchain.ModelChain.run_model + modelchain.ModelChain.complete_irradiance + modelchain.ModelChain.prepare_inputs + +Attributes +---------- + +Simple ModelChain attributes: + +``system, location, clearsky_model, transposition_model, +solar_position_method, airmass_model`` + +Properties +---------- + +ModelChain properties that are aliases for your specific modeling functions. + +.. autosummary:: + :toctree: generated/ + + modelchain.ModelChain.orientation_strategy + modelchain.ModelChain.dc_model + modelchain.ModelChain.ac_model + modelchain.ModelChain.aoi_model + modelchain.ModelChain.spectral_model + modelchain.ModelChain.temp_model + modelchain.ModelChain.losses_model + modelchain.ModelChain.effective_irradiance_model + +Model definitions +----------------- + +ModelChain model definitions. + +.. autosummary:: + :toctree: generated/ + + modelchain.ModelChain.sapm + modelchain.ModelChain.singlediode + modelchain.ModelChain.pvwatts_dc + modelchain.ModelChain.snlinverter + modelchain.ModelChain.adrinverter + modelchain.ModelChain.pvwatts_inverter + modelchain.ModelChain.ashrae_aoi_loss + modelchain.ModelChain.physical_aoi_loss + modelchain.ModelChain.sapm_aoi_loss + modelchain.ModelChain.no_aoi_loss + modelchain.ModelChain.first_solar_spectral_loss + modelchain.ModelChain.sapm_spectral_loss + modelchain.ModelChain.no_spectral_loss + modelchain.ModelChain.sapm_temp + modelchain.ModelChain.pvwatts_losses + modelchain.ModelChain.no_extra_losses + +Inference methods +----------------- + +Methods that automatically determine which models should be used based +on the information in the associated :py:class:`~pvsystem.PVSystem` object. + +.. autosummary:: + :toctree: generated/ + + modelchain.ModelChain.infer_dc_model + modelchain.ModelChain.infer_ac_model + modelchain.ModelChain.infer_aoi_model + modelchain.ModelChain.infer_spectral_model + modelchain.ModelChain.infer_temp_model + modelchain.ModelChain.infer_losses_model + +Functions +--------- + +Functions for power modeling. + +.. autosummary:: + :toctree: generated/ + + modelchain.basic_chain + modelchain.get_orientation diff --git a/docs/sphinx/source/classes.rst b/docs/sphinx/source/classes.rst deleted file mode 100644 index ccda434462..0000000000 --- a/docs/sphinx/source/classes.rst +++ /dev/null @@ -1,61 +0,0 @@ -.. _classes: - -Classes -======= - -pvlib-python provides a collection of classes -for users that prefer object-oriented programming. -These classes can help users keep track of data in a more organized way, -and can help to simplify the modeling process. -The classes do not add any functionality beyond the procedural code. -Most of the object methods are simple wrappers around the -corresponding procedural code. - -Location --------- -.. autoclass:: pvlib.location.Location - :members: - :undoc-members: - :show-inheritance: - :noindex: - -PVSystem --------- -.. autoclass:: pvlib.pvsystem.PVSystem - :members: - :undoc-members: - :show-inheritance: - :noindex: - -ModelChain ----------- -.. autoclass:: pvlib.modelchain.ModelChain - :members: - :undoc-members: - :show-inheritance: - :noindex: - -LocalizedPVSystem ------------------ -.. autoclass:: pvlib.pvsystem.LocalizedPVSystem - :members: - :undoc-members: - :show-inheritance: - :noindex: - -SingleAxisTracker ------------------ -.. autoclass:: pvlib.tracking.SingleAxisTracker - :members: - :undoc-members: - :show-inheritance: - :noindex: - -LocalizedSingleAxisTracker --------------------------- -.. autoclass:: pvlib.tracking.LocalizedSingleAxisTracker - :members: - :undoc-members: - :show-inheritance: - :noindex: - diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index cda390e293..546e61c80e 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -126,6 +126,7 @@ def __getattr__(cls, name): # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False +autosummary_generate = True # -- Options for HTML output ---------------------------------------------- @@ -219,6 +220,10 @@ def __getattr__(cls, name): # Output file base name for HTML help builder. htmlhelp_basename = 'PVLIB_Pythondoc' +# A workaround for the responsive tables always having annoying scrollbars. +def setup(app): + app.add_stylesheet("no_scrollbars.css") + # -- Options for LaTeX output --------------------------------------------- diff --git a/docs/sphinx/source/index.rst b/docs/sphinx/source/index.rst index 45f10ecedf..517bd9fe1d 100644 --- a/docs/sphinx/source/index.rst +++ b/docs/sphinx/source/index.rst @@ -68,7 +68,7 @@ Contents ======== .. toctree:: - :maxdepth: 2 + :maxdepth: 5 package_overview whatsnew @@ -77,8 +77,7 @@ Contents timetimezones clearsky forecasts - modules - classes + api comparison_pvlib_matlab variables_style_rules diff --git a/docs/sphinx/source/modules.rst b/docs/sphinx/source/modules.rst deleted file mode 100644 index e0a23ea8ac..0000000000 --- a/docs/sphinx/source/modules.rst +++ /dev/null @@ -1,90 +0,0 @@ -Modules -======= - -atmosphere ------------------ - -.. automodule:: pvlib.atmosphere - :members: - :undoc-members: - :show-inheritance: - -clearsky ----------------- - -.. automodule:: pvlib.clearsky - :members: - :undoc-members: - :show-inheritance: - -forecast ----------------- - -.. automodule:: pvlib.forecast - :members: - :undoc-members: - :show-inheritance: - -irradiance ------------------ - -.. automodule:: pvlib.irradiance - :members: - :undoc-members: - :show-inheritance: - -location ---------------- - -.. automodule:: pvlib.location - :members: - :undoc-members: - :show-inheritance: - -modelchain ----------- - -.. automodule:: pvlib.modelchain - :members: - :undoc-members: - :show-inheritance: - -pvsystem ---------------- - -.. automodule:: pvlib.pvsystem - :members: - :undoc-members: - :show-inheritance: - -solarposition --------------------- - -.. automodule:: pvlib.solarposition - :members: - :undoc-members: - :show-inheritance: - -tmy --------------------- - -.. automodule:: pvlib.tmy - :members: - :undoc-members: - :show-inheritance: - -tracking --------------------- - -.. automodule:: pvlib.tracking - :members: - :undoc-members: - :show-inheritance: - -tools --------------------- - -.. automodule:: pvlib.tools - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/sphinx/source/whatsnew/v0.4.2.txt b/docs/sphinx/source/whatsnew/v0.4.2.txt index a9e30b5cfd..fe12d53ad6 100644 --- a/docs/sphinx/source/whatsnew/v0.4.2.txt +++ b/docs/sphinx/source/whatsnew/v0.4.2.txt @@ -39,6 +39,9 @@ Enhancements * Added more attributes to ModelChain, PVSystem, and Location printed representations. (:issue:`254`) * Added name attribute to ModelChain and PVSystem. (:issue:`254`) +* Restructured API section of the documentation so that there are + separate pages for each function, class, or method. (:issue:`258`) + Code Contributors ~~~~~~~~~~~~~~~~~