OpenEnergyPlatform / open-MaStR

A collaborative software to download the energy database Marktstammdatenregister (MaStR)

Home Page:https://open-mastr.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

wok77 opened this issue Β· comments

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
  •    url = gen_url(now)
       r = requests.get(url, stream=True)
    

PR-Assignee

Reviewer

  • πŸ™ Follow the Reviewer Guidelines
  • πŸ™ Provided feedback and show sufficient appreciation for the work done

Workflow checklist

@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!

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

This is merged to develop.