OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)
https://open-mastr.readthedocs.io/en/latest/
GNU Affero General Public License v3.0
88 stars 19 forks source link

The issue is that the download of yesterday's xml file does not call gen_url with the new variable now #533

Closed wok77 closed 5 months ago

wok77 commented 5 months ago

First: This is a great project and having MaStR as SQL database is very useful for various analysis questions.

I just wanted to download the latest dataset and as it was a few hours after midnight, I ran into the following problem: The file for today is not yet available, but the mechanism to download the file from yesterday did not work (as it did not generated a new URL).

In line 130 (branch: develop) of utils_download_bulk.py 'now' is calculated for yesterday, but the new URL is not generated using gen_url(now) before starting the download.

Adding the missing call to gen_url solves the problem:

     now = time.localtime(time.mktime(now) - (24 * 60 * 60)) # subtract 1 day from the date

PR-Assignee

Reviewer

Workflow checklist

wok77 commented 5 months ago

@FlorianK13 This is my first contribution and pull request. Not sure how I can assign the PR-Assignee and Review. Can you please support. Thanks!

FlorianK13 commented 5 months ago

Hi @wok77, thanks for your PR. I'll have a look at it today.

FlorianK13 commented 5 months ago

This is merged to develop.