Closed rouille closed 2 years ago
We might want to update Pipfile.lock
. Also, looks like wget
is only installed as part of zenodo_get
, so we should add that explicitly (otherwise it will be removed when the lock file is regenerated). I also noticed the wget
package hasn't been updated since 2015, but.. if it works, that's probably fine.
We might want to update
Pipfile.lock
. Also, looks likewget
is only installed as part ofzenodo_get
, so we should add that explicitly (otherwise it will be removed when the lock file is regenerated). I also noticed thewget
package hasn't been updated since 2015, but.. if it works, that's probably fine.
Would you recommend using urllib
instead?
We might want to update
Pipfile.lock
. Also, looks likewget
is only installed as part ofzenodo_get
, so we should add that explicitly (otherwise it will be removed when the lock file is regenerated). I also noticed thewget
package hasn't been updated since 2015, but.. if it works, that's probably fine.Would you recommend using
urllib
instead?
I'm about to say the same thing since it's in STL.
We might want to update
Pipfile.lock
. Also, looks likewget
is only installed as part ofzenodo_get
, so we should add that explicitly (otherwise it will be removed when the lock file is regenerated). I also noticed thewget
package hasn't been updated since 2015, but.. if it works, that's probably fine.Would you recommend using
urllib
instead?
We can do this with requests too:
def _wget(url, filename, size=None):
with requests.get(url, stream=True) as r:
r.raise_for_status()
if size is None:
size = r.headers.get("Content-Length")
with open(filename, "wb") as f:
with tqdm(
unit="B",
unit_scale=True,
unit_divisor=1024,
miniters=1,
total=size,
) as pbar:
for chunk in r.iter_content(chunk_size=8192):
f.write(chunk)
pbar.update(len(chunk))
We might want to update
Pipfile.lock
. Also, looks likewget
is only installed as part ofzenodo_get
, so we should add that explicitly (otherwise it will be removed when the lock file is regenerated). I also noticed thewget
package hasn't been updated since 2015, but.. if it works, that's probably fine.Would you recommend using
urllib
instead?We can do this with requests too:
def _wget(url, filename, size=None): with requests.get(url, stream=True) as r: r.raise_for_status() if size is None: size = r.headers.get("Content-Length") with open(filename, "wb") as f: with tqdm( unit="B", unit_scale=True, unit_divisor=1024, miniters=1, total=size, ) as pbar: for chunk in r.iter_content(chunk_size=8192): f.write(chunk) pbar.update(len(chunk))
Done
We might want to update
Pipfile.lock
. Also, looks likewget
is only installed as part ofzenodo_get
, so we should add that explicitly (otherwise it will be removed when the lock file is regenerated). I also noticed thewget
package hasn't been updated since 2015, but.. if it works, that's probably fine.
The update of the Pipfile.lock
will be taken care of in a separate PR as some tests fail due to an updated version of pandas
Pull Request doc
Purpose
Build the
Zenodo
class around the Zenodo Rest API to efficiently handle data coming from different record. Partially addresses #687.What the code is doing
Testing
Manual testing.
Where to look
Zenodo
class inpowersimdata.network.zenodo
moduleTUB
class located in thepowersimdata.network.europe_tub.model
modulezenodo_get
package from Pipfile and requirements.txtUsage Example/Visuals
We can now do that:
Time estimate
30min