Skip to content
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

fix:no internet git pulling #127

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "py21cmEMU"
version = "1.1.0"
version = "1.1.1"
description = "Emulator of 21cmFAST summaries."
authors = ["Daniela Breitman <[email protected]>"]
license = "MIT"
Expand Down
24 changes: 12 additions & 12 deletions src/py21cmemu/get_emulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get_emu_data(version: str = "latest"):
"git clone -v -- https://huggingface.co/DanielaBreitman/21cmEMU\n"
"Then, ensure that it downloaded fully by running: "
"du -sh 21cmEMU \n"
"The folder should be about 500M. "
"The folder should be about 500M: 250M for the model, 250M for .git. "
"Now copy this folder and its contents "
"over to your other machine and put it in "
" ~/.local/share/py21cmEMU/21cmEMU "
Expand All @@ -54,16 +54,16 @@ def get_emu_data(version: str = "latest"):
repo.remotes.origin.pull()
except Exception as e:
warn(f"Skipping the pulling step. Error received: {e}", stacklevel=2)

versions = sorted(
[tag.name.lower() for tag in repo.tags if tag.name.lower().startswith("v")]
)

if version == "latest":
version = repo.git.checkout("main")
elif version.lower() in versions:
repo.git.checkout(version)
else:
raise ValueError(
f"Version {version} not available. Must be one of {versions}. "
versions = sorted(
[tag.name.lower() for tag in repo.tags if tag.name.lower().startswith("v")]
)

if version == "latest":
version = repo.git.checkout("main")
elif version.lower() in versions:
repo.git.checkout(version)
else:
raise ValueError(
f"Version {version} not available. Must be one of {versions}. "
)
Loading