Skip to content

Broken link in read_midc documentation #1363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
williamhobbs opened this issue Dec 29, 2021 · 2 comments · Fixed by #1365
Closed

Broken link in read_midc documentation #1363

williamhobbs opened this issue Dec 29, 2021 · 2 comments · Fixed by #1365
Milestone

Comments

@williamhobbs
Copy link
Contributor

The link to Variable Style Rules (https://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html) appears to be broken:

def read_midc(filename, variable_map={}, raw_data=False, **kwargs):
"""Read in National Renewable Energy Laboratory Measurement and
Instrumentation Data Center weather data. The MIDC is described in [1]_.
Parameters
----------
filename: string or file-like object
Filename, url, or file-like object of data to read.
variable_map: dictionary
Dictionary for mapping MIDC field names to pvlib names. Used to rename
the columns of the resulting DataFrame. Does not map names by default.
See Notes for an example.
raw_data: boolean
Set to true to use format_index_raw to correctly format the date/time
columns of MIDC raw data files.
kwargs : dict
Additional keyword arguments to pass to `pandas.read_csv`
Returns
-------
data: Dataframe
A dataframe with DatetimeIndex localized to the provided timezone.
Notes
-----
The `variable_map` argument should map fields from MIDC data to pvlib
names.
E.g. if a MIDC file contains the variable 'Global Horizontal [W/m^2]',
passing the dictionary below will rename the column to 'ghi' in
the returned Dataframe.
{'Global Horizontal [W/m^2]': 'ghi'}
See the MIDC_VARIABLE_MAP for collection of mappings by site.
For a full list of pvlib variable names see the `Variable Style Rules
<https://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html>`_.
Be sure to check the units for the variables you will use on the
`MIDC site <https://midcdmz.nrel.gov/>`_.
References
----------
.. [1] NREL: Measurement and Instrumentation Data Center
`https://midcdmz.nrel.gov/ <https://midcdmz.nrel.gov/>`_
"""
data = pd.read_csv(filename, **kwargs)
if raw_data:
data = format_index_raw(data)
else:
data = format_index(data)
data = data.rename(columns=variable_map)
return data

image

@kandersolar
Copy link
Member

kandersolar commented Dec 29, 2021

Thanks @williamhobbs, I didn't think to check for existing links when I moved those pages under user_guide in #1173. Looking at the results of $ git grep "pvlib-python\..*/en/", there are several links to update:

  • README.md:Please see the [Installation page](http://pvlib-python.readthedocs.io/en/stable/installation.html) of the documentation for complete instructions.
  • docs/tutorials/irradiance.ipynb: "http://pvlib-python.readthedocs.io/en/latest/clearsky.html\n",
  • pvlib/iotools/midc.py: <https://pvlib-python.readthedocs.io/en/latest/variables_style_rules.html>`_.
  • pvlib/modelchain.py: See https://pvlib-python.readthedocs.io/en/stable/modelchain.html

As an aside, is it ever desirable for a link like this to point to latest? Maybe we should standardize to stable everywhere.

@cwhanse
Copy link
Member

cwhanse commented Dec 29, 2021

we should standardize to stable everywhere.

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants