Skip to content
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

TMY loading improvements #7

Merged
merged 8 commits into from
Mar 11, 2015
Merged

TMY loading improvements #7

merged 8 commits into from
Mar 11, 2015

Conversation

wholmgren
Copy link
Member

Adds ability to open TMY3 files via a url.

Closes #5

Cleans up some other aspects of the module including unneeded imports, slightly improved documentation.

Not yet ready for merging as it still needs new tests and coerce_year is not yet implemented.

@wholmgren
Copy link
Member Author

I added an underscore to the start of all tmy functions except for readtmy2 and readtmy3. As a result, those underscored functions will no longer appear in the docs. I set up rtfd on my branch to preview the change:

http://wholmgren-pvlib-python-new.readthedocs.org/en/tmyurl/pvlib.html#module-pvlib.tmy

I think that I've now added tests for all of the new behavior and I've implemented coerce_year, so it's ready for @Calama-Consulting @bmu and anybody else to review the changes.

Note that the year coercion is disabled by default. I chose this behavior because I think that this follows the principle of least surprise.

@bmu
Copy link
Contributor

bmu commented Mar 1, 2015

Pandas uses to check, if there is a connection to the internet before doing tests that need such a connection (I think these tests are skiped in such a case). As an example see this test for the use of the decorator and here for definition.

Maybe we can direclty use this decorator for our tests.

@wholmgren
Copy link
Member Author

Good point. I added the pandas @network decorator and tested it with and without an internet connection. Here's the output when I turned off my laptop's wifi...

(pvlib-3.4.3) william-holmgrens-macbook-pro:pvlib-python holmgren$ nosetests pvlib/test/test_tmy.py -v
pvlib.test.test_tmy.test_readtmy3 ... ok
pvlib.test.test_tmy.test_readtmy3_recolumn ... ok
pvlib.test.test_tmy.test_readtmy3_norecolumn ... ok
pvlib.test.test_tmy.test_readtmy3_coerce_year ... ok
pvlib.test.test_tmy.test_readtmy3_no_coerce_year ... ok
pvlib.test.test_tmy.test_readtmy2 ... ok
pvlib.test.test_tmy.test_readtmy3_remote ... SKIP: Skipping test due to lack of connectivity and error <urlopen error [Errno 8] nodename nor servname provided, or not known>

----------------------------------------------------------------------
Ran 7 tests in 13.865s

OK (SKIP=1)

@wholmgren wholmgren mentioned this pull request Mar 9, 2015
@wholmgren
Copy link
Member Author

Updated to fix a documentation issue mentioned in #16.

Anything else to do here before merging?

@bmu
Copy link
Contributor

bmu commented Mar 11, 2015

Looks good. I think this can be merged. Should I merge or wait for other comments?

@wholmgren
Copy link
Member Author

I think you can go ahead and merge this one.

bmu added a commit that referenced this pull request Mar 11, 2015
TMY loading improvements
@bmu bmu merged commit e24d1c9 into pvlib:master Mar 11, 2015
@wholmgren wholmgren deleted the tmyurl branch March 11, 2015 23:19
@bmu bmu added this to the 0.1 milestone Mar 12, 2015
@dacoex
Copy link
Contributor

dacoex commented Mar 12, 2015

Shall we add standard readers for typical data providers such as:

OK, maybe this is more a candidate for a separate model like pylib.io

@bmu
Copy link
Contributor

bmu commented Mar 12, 2015

I would like to have these readers too, but I think you should open a new issue and propose this.
Should be something for a later version.

@dacoex dacoex mentioned this pull request Mar 12, 2015
@dacoex
Copy link
Contributor

dacoex commented Mar 12, 2015

@bmu done, see the reference to issue #29

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

Successfully merging this pull request may close these issues.

Add automated TMY pulls
3 participants