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

Brain region: Switch to Allen notation for checkpoint path if no legacy detected #82

Merged
merged 1 commit into from
Nov 21, 2023
Merged
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
9 changes: 8 additions & 1 deletion bluepyemodel/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@
def get_checkpoint_path(metadata, seed=None):
""""""

base_path = f"./checkpoints/{metadata.emodel}/{metadata.iteration}/"
filename = metadata.as_string(seed=seed, use_allen_notation=False)
full_path = f"{base_path}{filename}.pkl"

return f"./checkpoints/{metadata.emodel}/{metadata.iteration}/{filename}.pkl"
# Switch to Allen notation if no previous legacy checkpoint is found
if not Path(full_path).is_file():
filename = metadata.as_string(seed=seed, use_allen_notation=True)
full_path = f"{base_path}{filename}.pkl"

return full_path


def get_legacy_checkpoint_path(checkpoint_path):
Expand Down