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

Set the default repo_path inside the get_model_spec function #110

Merged
merged 3 commits into from
Jul 15, 2021
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
8 changes: 5 additions & 3 deletions xija/get_model_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def temp_directory():
shutil.rmtree(tmpdir, ignore_errors=True)


def get_xija_model_spec(model_name, version=None, repo_path=REPO_PATH,
check_version=False, timeout=5) -> dict:
def get_xija_model_spec(model_name, version=None, repo_path=None,
check_version=False, timeout=5) -> tuple:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a bug fix (correcting the annotated return type)? I originally though that you were changing the return type of the function, but now I don't see that in the diff. same for Line 95.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this a bug fix since it already returns a tuple.

"""
Get Xija model specification for the specified ``model_name``.

Expand Down Expand Up @@ -92,9 +92,11 @@ def get_xija_model_spec(model_name, version=None, repo_path=REPO_PATH,

Returns
-------
dict, str
tuple of dict, str
Xija model specification dict, chandra_models version
"""
if repo_path is None:
repo_path = REPO_PATH
with temp_directory() as repo_path_local:
repo = git.Repo.clone_from(repo_path, repo_path_local)
if version is not None:
Expand Down