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

Add Wetterdienst UI #398

Merged
merged 23 commits into from
Apr 3, 2021
Merged

Add Wetterdienst UI #398

merged 23 commits into from
Apr 3, 2021

Conversation

amotl
Copy link
Member

@amotl amotl commented Mar 31, 2021

Hi there,

this patch brings in the code from the wetterdienst-ui repository [1] contributed by @meteoDaniel. Thank you very much!

As outlined within #347 (comment), I finally have been able to take the time to bring this code to the main code base and adjust it to be compatible with the recent improvements to the Wetterdienst Python API on behalf of ec2de30.

On top of that, with 0e42cf7, I added software tests based on the dash.testing infrastructure.

This patch is not completely ready yet, that's why I am submitting it as a preliminary draft. More details about what has to be added and fixed are summarized at the "Backlog" section below. The patch should be ready to go.

With kind regards,
Andreas.

[1] https://github.com/earthobservations/wetterdienst-ui


Backlog

Edit: Resolved.

  • Currently, the test test_ui::test_app_data_values fails, because I haven't been able to investigate the root cause yet. However, the newly introduced improved log messages will aid us with debugging this issue.
  • Because the dash.testing infrastructure is running on Selenium, it needs a Browser (Firefox) and its corresponding Geckodriver package installed on the machine running the tests. We will have to adjust both the CI setup on GHA as well as the developer documentation with corresponding instructions to / how to install those prerequisites.

@amotl amotl force-pushed the collab/wetterdienst-ui branch 11 times, most recently from cbafad7 to b2e5296 Compare March 31, 2021 21:32
@@ -299,6 +299,18 @@ def __init__(

self.tidy = tidy

log.info(
Copy link
Member

Choose a reason for hiding this comment

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

We may as well move this to the .query() method and use the str/repr representation of the class.

Copy link
Member Author

@amotl amotl Apr 2, 2021

Choose a reason for hiding this comment

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

Do you mean wetterdienst.core.scalar.values.ScalarValuesCore.__str__? Well, while I might be not be fully understanding it, currently it looks like this would have no way to see the whole picture like the provider.

I clearly believe that this logging function is at the right place here because it covers both requests for stations and values, which is what I was aiming at.

parameter=DwdObservationDataset(parameter),
resolution=DwdObservationResolution(time_resolution),
period=DwdObservationPeriod(period_type),
tidy=False,
Copy link
Member

@gutzbenj gutzbenj Mar 31, 2021

Choose a reason for hiding this comment

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

I guess we should try and go via tidy here and use .groupby to create the json response. This would leave us the option to also plot the quality of the data later on. Maybe we can also create another output format for ValuesResult, that is meant to be used for the ui only?

Copy link
Member Author

@amotl amotl Apr 2, 2021

Choose a reason for hiding this comment

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

I believe, for the first iteration, it will be fine. Pandas data frames in non-tidy format work just perfectly here. Another variant should be added carefully, maybe within another iteration.

If you want to continue working on this, you will now have a reasonable test suite at hand, which helps tremendously.

@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #398 (a6a6319) into main (87dbfff) will increase coverage by 0.30%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
+ Coverage   88.31%   88.62%   +0.30%     
==========================================
  Files          74       79       +5     
  Lines        3577     3735     +158     
  Branches      377      396      +19     
==========================================
+ Hits         3159     3310     +151     
- Misses        329      335       +6     
- Partials       89       90       +1     
Flag Coverage Δ
unittests 88.62% <90.90%> (+0.30%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
wetterdienst/cli.py 70.43% <ø> (ø)
wetterdienst/core/scalar/result.py 88.88% <0.00%> (ø)
wetterdienst/ui/library.py 76.47% <76.47%> (ø)
wetterdienst/ui/app.py 91.30% <91.30%> (ø)
wetterdienst/core/core.py 91.30% <100.00%> (ø)
wetterdienst/core/scalar/request.py 81.96% <100.00%> (+0.14%) ⬆️
wetterdienst/provider/dwd/forecast/api.py 74.74% <100.00%> (ø)
wetterdienst/provider/dwd/observation/api.py 87.89% <100.00%> (+2.10%) ⬆️
wetterdienst/provider/eccc/observation/api.py 85.52% <100.00%> (ø)
wetterdienst/ui/layout/main.py 100.00% <100.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 87dbfff...a6a6319. Read the comment docs.

Copy link
Member

@gutzbenj gutzbenj left a comment

Choose a reason for hiding this comment

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

Thanks Andreas for your work on bringing this into the main respository! I will try to dive deeper into this the upcoming weekend.

@amotl amotl force-pushed the collab/wetterdienst-ui branch 6 times, most recently from 1c3b90b to 46bdef5 Compare April 2, 2021 01:18
@amotl
Copy link
Member Author

amotl commented Apr 2, 2021

Currently, the test test_ui::test_app_data_values fails.

Fixed with 5fd6b1e. Also, 46bdef5 adds some documentation.

@amotl amotl marked this pull request as ready for review April 2, 2021 01:37
@amotl amotl requested a review from gutzbenj April 2, 2021 01:37
@amotl amotl force-pushed the collab/wetterdienst-ui branch 5 times, most recently from ef0b532 to d07fc15 Compare April 2, 2021 22:57
meteoDaniel and others added 23 commits April 3, 2021 15:35
We didn't get any sensible responses by using this system. Maybe we
should use LGTM instead. However, let's just deactivate this now.
Along the lines, improve some more documents within the "Usage" section.
Also, add annotations to Figure elements in order to signal "empty data"
@amotl amotl force-pushed the collab/wetterdienst-ui branch from d07fc15 to a6a6319 Compare April 3, 2021 13:36
@amotl amotl merged commit d9c693c into main Apr 3, 2021
@amotl amotl deleted the collab/wetterdienst-ui branch April 3, 2021 14:15
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.

3 participants