Skip to content

Commit

Permalink
Merge pull request #82 from BlueBrain/checkpoints-allen
Browse files Browse the repository at this point in the history
Brain region: Use Allen notation for the checkpoint path
  • Loading branch information
ilkilic authored Nov 21, 2023
2 parents 90354f8 + 0a8d93f commit f8b2742
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit f8b2742

Please sign in to comment.