Skip to content

Commit e336b3e

Browse files
committed
doc clean up
1 parent f3bebbe commit e336b3e

File tree

1 file changed

+42
-57
lines changed

1 file changed

+42
-57
lines changed

pvlib/tmy.py

Lines changed: 42 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Import TMY2 and TMY3 data.
2+
Import functions for TMY2 and TMY3 data files.
33
"""
44

55
import logging
@@ -25,33 +25,31 @@ def readtmy3(filename=None, coerce_year=None, recolumn=True):
2525
'''
2626
Read a TMY3 file in to a pandas dataframe.
2727
28-
Read a TMY3 file and make a pandas dataframe of the data. Note that values
29-
contained in the metadata dictionary are unchanged from the TMY3 file (i.e. units
28+
Note that values contained in the metadata dictionary are
29+
unchanged from the TMY3 file (i.e. units
3030
are retained). In the case of any discrepencies between this
31-
documentation and the TMY3 User's Manual ([1]), the TMY3 User's Manual
31+
documentation and the TMY3 User's Manual [1], the TMY3 User's Manual
3232
takes precedence.
3333
3434
Parameters
3535
----------
36-
3736
filename : None or string
38-
If None, attempts to use an interactive file browser.
37+
If None, attempts to use a Tkinter file browser.
3938
A string can be a relative file path, absolute file path,
4039
or url.
4140
4241
coerce_year : None or int
43-
If supplied, the year of the data will be coerced to this input.
42+
If supplied, the year of the data will be set to this value.
4443
4544
recolumn : bool
4645
If True, apply standard names to TMY3 columns.
47-
Typically this resulsts in stripping the units from the column name.
46+
Typically this results in stripping the units from the column name.
4847
49-
5048
Returns
5149
-------
52-
50+
Tuple of the form (data, metadata).
51+
5352
data : DataFrame
54-
5553
A pandas dataframe with the columns described in the table below.
5654
For more detailed descriptions of each component, please consult
5755
the TMY3 User's Manual ([1]), especially tables 1-1 through 1-6.
@@ -62,6 +60,8 @@ def readtmy3(filename=None, coerce_year=None, recolumn=True):
6260
Notes
6361
-----
6462
63+
The returned structures have the following fields.
64+
6565
=============== ====== ===================
6666
key format description
6767
=============== ====== ===================
@@ -251,73 +251,58 @@ def _recolumn(tmy3_dataframe, inplace=True):
251251
return tmy3_dataframe.rename(columns=mapping, inplace=True)
252252

253253

254-
255-
#########################
256-
#
257-
# TMY2 below
258-
#
259-
#########################
260-
261-
262254

263255
def readtmy2(filename):
264256
'''
265-
Read a TMY2 file in to a DataFrame
257+
Read a TMY2 file in to a DataFrame.
266258
267-
Note that valuescontained in the DataFrame are unchanged from the TMY2
268-
file (i.e. units are retained). Time/Date and Location data imported from the
259+
Note that values contained in the DataFrame are unchanged from the TMY2
260+
file (i.e. units are retained). Time/Date and location data imported from the
269261
TMY2 file have been modified to a "friendlier" form conforming to modern
270262
conventions (e.g. N latitude is postive, E longitude is positive, the
271263
"24th" hour of any day is technically the "0th" hour of the next day).
272264
In the case of any discrepencies between this documentation and the
273-
TMY2 User's Manual ([1]), the TMY2 User's Manual takes precedence.
274-
275-
If a filename is not provided, the user will be prompted to browse to
276-
an appropriate TMY2 file.
265+
TMY2 User's Manual [1], the TMY2 User's Manual takes precedence.
277266
278267
Parameters
279268
----------
280-
filename : string
281-
282-
an optional argument which allows the user to select which
283-
TMY2 format file should be read. A file path may also be necessary if
284-
the desired TMY2 file is not in the working path. If filename
285-
is not provided, the user will be prompted to browse to an
286-
appropriate TMY2 file.
269+
filename : None or string
270+
If None, attempts to use a Tkinter file browser.
271+
A string can be a relative file path, absolute file path,
272+
or url.
287273
288274
Returns
289275
-------
276+
Tuple of the form (data, metadata).
277+
278+
data : DataFrame
279+
A dataframe with the columns described in the table below.
280+
For a more detailed descriptions of each component, please consult
281+
the TMY2 User's Manual ([1]), especially tables 3-1 through 3-6, and
282+
Appendix B.
290283
291-
TMYData : DataFrame
292-
293-
A dataframe, is provided with the following components. Note
294-
that for more detailed descriptions of each component, please consult
295-
the TMY2 User's Manual ([1]), especially tables 3-1 through 3-6, and
296-
Appendix B.
297-
298-
meta : struct
299-
300-
A struct containing the metadata from the TMY2 file.
284+
metadata : dict
285+
The site metadata available in the file.
301286
302287
Notes
303288
-----
304289
305-
The structures have the following fields
290+
The returned structures have the following fields.
306291
307-
============================ ============================================================
308-
meta Field
309-
============================ ============================================================
310-
meta.SiteID Site identifier code (WBAN number), scalar unsigned integer
311-
meta.StationName Station name, 1x1 cell string
312-
meta.StationState Station state 2 letter designator, 1x1 cell string
313-
meta.SiteTimeZone Hours from Greenwich, scalar double
314-
meta.latitude Latitude in decimal degrees, scalar double
315-
meta.longitude Longitude in decimal degrees, scalar double
316-
meta.SiteElevation Site elevation in meters, scalar double
317-
============================ ============================================================
292+
============= ==================================
293+
key description
294+
============= ==================================
295+
SiteID Site identifier code (WBAN number)
296+
StationName Station name
297+
StationState Station state 2 letter designator
298+
SiteTimeZone Hours from Greenwich
299+
latitude Latitude in decimal degrees
300+
longitude Longitude in decimal degrees
301+
SiteElevation Site elevation in meters
302+
============= ==================================
318303
319304
============================ ==========================================================================================================================================================================
320-
TMYData Field Meaning
305+
TMYData field description
321306
============================ ==========================================================================================================================================================================
322307
index Pandas timeseries object containing timestamps
323308
year
@@ -399,7 +384,7 @@ def readtmy2(filename):
399384
for TMY2s". NREL 1995.
400385
'''
401386

402-
if filename is None: #If no filename is input
387+
if filename is None:
403388
try:
404389
filename = _interactive_load()
405390
except:

0 commit comments

Comments
 (0)