Repository navigation
Migrate _parse_bsrn and _parse_epw logic into read_bsrn and read_epw - #2934
Closed
DresdenGman wants to merge 2 commits into
Closed
DresdenGman wants to merge 2 commits into
DresdenGman wants to merge 2 commits into
Conversation
Member
|
Closing this since the contributing guidelines have not been followed. Will consider re-opening if compliance is achieved. Core guidelines were also highlighted to you in #2932 (see #2932 (comment)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2469
Summary
As proposed in #2469, the parsing logic from the deprecated public
parse_bsrnandparse_epwfunctions still sat in the private helpers_parse_bsrnand_parse_epw, leavingbsrn.pyandepw.pystructured differently from the otheriotoolsmodules and duplicating documentation. This PR moves that logic intoread_bsrnandread_epwand deletes the private helpers. (The deprecated public functions were already removed in v0.16.0, so the helpers had no callers outside these two modules — 4 call sites in total.)Changes
pvlib/iotools/bsrn.py: moved the body of_parse_bsrnverbatim intoread_bsrn; updatedget_bsrnto callread_bsrnwith the in-memory buffer (a pathread_bsrnalready supports); removed_parse_bsrnand its duplicated docstring.pvlib/iotools/epw.py: inlined the body of_parse_epwintoread_epw; updated the HTTP branch to build aStringIOand go through_file_context_managerlike the other input paths; removed_parse_epwand its duplicated docstring.fbuf→f); the dispatch around them (get_bsrn, andread_epw's HTTP branch) is what changed. Behavior is unchanged.docs/sphinx/source/whatsnew/v0.16.2.rst: added a maintenance entry.Tests
test_bsrn.py+test_epw.pygave 10 passed / 3 skipped before this change (the skips are the credential-gated remote BSRN tests) and give the same results after it.coerce_year=2015, and viaStringIO) were compared before vs. after — DataFrame value hashes, shapes, and metadata fingerprints are identical in every case. Downstream checks: theLocation.from_epwtest passes andtest_pvgis.py(which callsread_epwinternally) is 29 passed.get_bsrnis exercised end-to-end against a mocked FTP connection returning the sample gzip bytes — the result is value-identical to the localread_bsrnpath, and a spy check confirmsread_bsrnis called exactly once with the buffer and with a non-defaultlogical_recordsforwarded verbatim;read_epwis exercised through a mockedurlopen, value-identical to the local path, including forwarding ofcoerce_year.