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

Sort station observations at lower layer; Add latest observation #72

Merged
merged 8 commits into from Mar 13, 2022
Merged

Sort station observations at lower layer; Add latest observation #72

merged 8 commits into from Mar 13, 2022

Conversation

lymanepp
Copy link
Collaborator

@lymanepp lymanepp commented Mar 2, 2022

Sort station observations to work around API bug weather-gov/api#474

@MatthewFlamm
Copy link
Owner

This is probably the right place for this. Should we revert the changes in #60?

pynws/nws.py Outdated Show resolved Hide resolved
@lymanepp
Copy link
Collaborator Author

lymanepp commented Mar 3, 2022

This is probably the right place for this. Should we revert the changes in #60?

I noticed the test case, but I was a little confused that the Nws class was returning them out-of-order. I didn't think to look at the higher layer. It makes sense to me to have it in all layers (i.e., revert some of the changes in #60).

@lymanepp
Copy link
Collaborator Author

lymanepp commented Mar 3, 2022

I added a method to retrieve the latest station observation to the API. Let me know what you think.

Note that I continued the general convention where the method name matches the NWS URI.

@MatthewFlamm
Copy link
Owner

I added a method to retrieve the latest station observation to the API. Let me know what you think.

Note that I continued the general convention where the method name matches the NWS URI.

LGTM. Thanks!

@MatthewFlamm
Copy link
Owner

This still LGTM if you are still OK with the ordering of the forecasts. We need to clean up conflicts before merging.

@lymanepp
Copy link
Collaborator Author

This still LGTM if you are still OK with the ordering of the forecasts. We need to clean up conflicts before merging.

The forecast ordering matches your original workaround in simple_nws.py. Now that it's handled in the lower layer, I removed the sorting from simple_nws.py. I fixed the merge conflicts.

Copy link
Owner

@MatthewFlamm MatthewFlamm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing the duplicated sort. One last comment and it is good to go.

pynws/raw_data.py Outdated Show resolved Hide resolved
@MatthewFlamm MatthewFlamm changed the title Sort station observations to work around API bug Sort station observations at lower layer; Add latest observation Mar 13, 2022
@MatthewFlamm MatthewFlamm merged commit 61db51f into MatthewFlamm:master Mar 13, 2022
@MatthewFlamm
Copy link
Owner

Thanks!

@lymanepp lymanepp deleted the obs-out-of-order branch March 13, 2022 15:57
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.

None yet

2 participants