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

Implements One Call Api #306

Merged
merged 7 commits into from
Apr 26, 2020
Merged

Implements One Call Api #306

merged 7 commits into from
Apr 26, 2020

Conversation

edenhaus
Copy link
Contributor

Implements #301

@csparpa Please give it a look, I have change some parts of the weather.py
Also maybe you have some ideas to test it better.

@edenhaus
Copy link
Contributor Author

Somehow I can't run the integration tests locally.
I always get the following error message:

_____________________________________________________________________________ ERROR collecting tests/integration/weatherapi25/test_integration.py _____________________________________________________________________________
ImportError while importing test module '/home/robert/Documents/github/pyowm/tests/integration/weatherapi25/test_integration.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
weatherapi25/test_integration.py:7: in <module>
    import pyowm.commons.exceptions
../../pyowm/__init__.py:4: in <module>
    from pyowm.owm import OWM
../../pyowm/owm.py:5: in <module>
    from pyowm.agroapi10 import agro_manager
../../pyowm/agroapi10/agro_manager.py:5: in <module>
    from pyowm.agroapi10.imagery import MetaTile, MetaGeoTiffImage, MetaPNGImage, SatelliteImage
../../pyowm/agroapi10/imagery.py:6: in <module>
    from pyowm.commons.tile import Tile
../../pyowm/commons/tile.py:6: in <module>
    from pyowm.utils.geo import Polygon
../../pyowm/utils/geo.py:4: in <module>
    import geojson
E   ModuleNotFoundError: No module named 'geojson'

But geojson is installed... @csparpa Do you have any idea?

@csparpa
Copy link
Owner

csparpa commented Apr 26, 2020

I've fixed the issue with geojson (it was due to Tox not being told to install it)

I've also fixed a few integration tests but be aware that a few more are failing because they refer to locations/resources that are no longer availabile on the OWM API - they've actually been available for a while, then something changed on their side and we began getting 404s

For the moment, just ignore those.

@csparpa csparpa merged commit 313b97c into csparpa:develop Apr 26, 2020
@edenhaus edenhaus deleted the oneCall branch April 26, 2020 13:22
@csparpa
Copy link
Owner

csparpa commented Apr 26, 2020

@edenhaus

Just wanted to thank you for the great job you've done! :)

I've made these tiny changes:

  • fixed your integration test
  • renamed OneCall.one_call_historical method to 'one_call_history' to complain with older PyOWM naming convention
  • added method OneCall.to_geopoint

There is only one thing missing now: a short user-level documentation to help people quickly get started with OneCalls in PyOWM

I've written user-level docs for other PyOWM features ("code recipes") in the past and I ask if you're willing to do the same for the OneCall feature.
You could simply add a markdown file under:

https://github.com/csparpa/pyowm/tree/develop/sphinx/v3

and put the documentation there in plain Markdown syntax (you can take inspiration from the other files in that folder)
Once you create the file you should be able to check the HTML output if you install Sphinx (it's in the dev-requirements.txt file) and run the convenience https://github.com/csparpa/pyowm/blob/develop/scripts/generate_sphinx_docs.sh script to build the docs.

Thanks, let me know if you can make it and any issues you might encounter

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

Successfully merging this pull request may close these issues.

2 participants