8000 Add encoding parameter to read_tmy3 by AdamRJensen · Pull Request #1737 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add encoding parameter to read_tmy3 #1737

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

Merged
merged 21 commits into from
May 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add encoding=None to function def line
  • Loading branch information
AdamRJensen committed May 26, 2023
commit 1dafb829e99d8e2608ba00bae9a9f61821bcc2ee
3 changes: 2 additions & 1 deletion pvlib/iotools/tmy.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
}


def read_tmy3(filename, coerce_year=None, map_variables=None, recolumn=None):
def read_tmy3(filename, coerce_year=None, map_variables=None, recolumn=None,
encoding=None):
"""Read a TMY3 file into a pandas dataframe.

Note that values contained in the metadata dictionary are unchanged
Expand Down
3 changes: 2 additions & 1 deletion pvlib/tests/iotools/test_tmy.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ def test_solaranywhere_tmy3(solaranywhere_index):
# The SolarAnywhere TMY3 format specifies midnight as 00:00 whereas the
# NREL TMY3 format utilizes 24:00. The SolarAnywhere file is therefore
# included to test files with 00:00 timestamps are parsed correctly
data, meta = tmy.read_tmy3(TMY3_SOLARANYWHERE, encoding='iso-8859-1')
data, meta = tmy.read_tmy3(TMY3_SOLARANYWHERE, encoding='iso-8859-1',
map_variables=False)
pd.testing.assert_index_equal(data.index, solaranywhere_index)
assert meta['USAF'] == 0
assert meta['Name'] == 'Burlington United States'
Expand Down
0