-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
WIP: Add road weather station parser #528
WIP: Add road weather station parser #528
Conversation
… into add_road_weather_station_parser # Conflicts: # wetterdienst/provider/dwd/index.py
Codecov Report
@@ Coverage Diff @@
## main #528 +/- ##
==========================================
- Coverage 90.96% 87.88% -3.08%
==========================================
Files 85 99 +14
Lines 5255 5958 +703
Branches 441 484 +43
==========================================
+ Hits 4780 5236 +456
- Misses 368 605 +237
- Partials 107 117 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hi Daniel, nice work! I specifically like that everything is contained within a single package namespace, With kind regards, |
Dear @meteoDaniel , thanks for working on this data integration! Just some notes:
I will try out the new api one of the following days. Thanks so far. Cheers, |
… into add_road_weather_station_parser
First of all I am still confused because I had to remove some caches before I was able to run my code again. Did not know where these changes come from. Nevertheless I added a tiny function to generalize the dictionaries into a dataframe. Next issue:
My ide is to add that information to the metadata because I think these information are constant over time. What do you think ? Best regards from holidays in porto by the way :P |
I will try to add the meta information into the meta dataframe for the next step. |
edited Dear @meteoDaniel , for the correct usage of pdbufr we have to find a way to defined ECCODES_DIR for the different possible installation paths. I'm not yet sure if there's a way to do that but probably best would be to ask for ECCODES_DIR environment variable. Otherwise I've been googling a bit about the road weather data and found not too much BUT [1] https://www.dwd.de/DE/leistungen/opendata/hilfe.html |
Dear @gutzbenj ,I will go on with this task. Your suggestion with the file list is very good. thanks for the effort to check this out. The ECCODES_DIR env could be set via a specific Docker image and we will add another part in the documentation to explain what to do to use this new API. |
today I was able to work on that project again. As @gutzbenj mentioned, I have implemented the download of the stations lists to create a metaindex within the class. Please tell me whats next ;) Actually I would like to use the Other todo's:
|
Here is the Dockerfile i used to create an image with eccodes FROM python:3.8.6-slim
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
RUN set -ex \
&& apt update \
&& apt install -y apt-transport-https curl git libeccodes0 wget
RUN apt-get -y dist-upgrade && apt-get update
RUN wget https://cmake.org/files/v3.20/cmake-3.20.1.tar.gz
RUN tar -xzvf cmake-3.20.1.tar.gz
WORKDIR cmake-3.20.1/
RUN apt-get update && apt-get install --fix-missing -yqq libssl-dev build-essential
RUN ./bootstrap
RUN make -j$(nproc) && make install
WORKDIR /
RUN apt-get install -y gfortran protobuf-compiler
RUN curl https://confluence.ecmwf.int/download/attachments/45757960/eccodes-2.21.0-Source.tar.gz?api=v2 -o /tmp/eccodes-2.21.0-Source.tar.gz
RUN tar -xzf /tmp/eccodes-2.21.0-Source.tar.gz
RUN ls -lrt /
RUN mkdir build \
&& cd build \
&& cmake /eccodes-2.21.0-Source -DCMAKE_INSTALL_PREFIX=/usr/local/share/eccodes \
&& make install
RUN apt-get -yqq install autoconf libtool musl-dev
RUN ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1
RUN curl https://opendata.dwd.de/weather/lib/bufr/bufrtables_ecCodes-local-dwd.tar.bz2 -o /tmp/bufrtables_ecCodes-local-dwd.tar.bz2
RUN tar -xjf /tmp/bufrtables_ecCodes-local-dwd.tar.bz2
COPY ./requirements.txt /opt/requirements.txt
RUN pip3 install -r /opt/requirements.txt
ENV PYTHONPATH /app
ENV ECCODES_DEFINITION_PATH /usr/local/share/eccodes/share/eccodes/definitions
ENV ECCODES_DIR /usr/local/share/eccodes
ENV BUFR_DUMP_PATH /usr/local/share/eccodes/bin/bufr_dump
WORKDIR /app |
Dear @meteoDaniel , your totally fine using the
Is there a certain problem with implementing the class? I hope that I have annotated everything with enough text? Cheers |
Dear @meteoDaniel , you can now simply embed ECCODES_DIR into wetterdienst Settings. Should we together walk through the creation of a new API? This would be a good point for me to write down some documentation on how to approach that. |
Dear @gutzbenj and @amotl this is a first draft of road weather download and parsing for issue #518.
Here are some notes:
api.py
.ThreadPoolExecutor
is not a real parallel process, it uses threading. You have to useProcessPoolExecutor
to spread the task over CPU cores.I am looking forward to your first thoughts and feedback.