Skip to content

Don't download data from ourselves #44

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

Closed
duboism opened this issue Apr 11, 2025 · 4 comments · Fixed by #49
Closed

Don't download data from ourselves #44

duboism opened this issue Apr 11, 2025 · 4 comments · Fixed by #49

Comments

@duboism
Copy link
Contributor

duboism commented Apr 11, 2025

Tutorials 2.3 and 2.3 download data... from this repository. This is useless since the data are checkout out (in fact, those data represent roughly 50% of the size of the repository).

I see 2 options (by ascending level of complexity):

  1. Keep the data in the repository and just open them
  2. Don't put the data in the repository but store them somewhere (and download them) eventually through Git LFS
  3. Include the data in the archive but not in the repository (this way, no need to download them at runtime)

Solution 2 and 3 are more satisfying but harder to do. I feel solution 1 is enough.

@martinberoiz
Copy link
Contributor

I agree that for users working on local laptops that have the repo checked out, downloading them again is silly, but I'm worried about how would it work on Colab or mybinder.

I tried opening the file in Colab without downloading it first (I don't know where it's stored) and it didn't work for me.
I tried doing file_name = "PyCBC_T2_1.gwf" and file_name = "./Data/PyCBC_T2_1.gwf", both didn't work.

If we find a way to make it work online I think it's a good idea.

@martinberoiz
Copy link
Contributor

A possible solution may be adding:

if os.path.exists(f"./Data/{file_name}"):
    file_name = "./Data/.."
else:
    # download the file
    ...
    file_name = ...

The above is just pseudo code, hopefully it's clear enough.

Also, maybe we should be careful with OS paths because we may have students working on Windows (i.e. use os.path.join everywhere)

@duboism
Copy link
Contributor Author

duboism commented Apr 11, 2025

You're absolutely right, I forgot about Colab :) Silly me!

The solution you propose is fine but I would just download the file in the Data directory (creating it if needed). I might open a PR on this on Monday.

@duboism
Copy link
Contributor Author

duboism commented Apr 15, 2025

See #49.

@duboism duboism linked a pull request Apr 15, 2025 that will close this issue
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 a pull request may close this issue.

2 participants