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

Ersilia Catalog Bug when no models are available #1175

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

dzumii
Copy link
Contributor

@dzumii dzumii commented Jun 26, 2024

Description
When you try to run ersilia catalog --local but no models are available locally, instead of telling you there is no local model available, it outputs an error:

Changes Made
-updated the local method to return an empty catalogue_table if no models are found.
-updated the catalogue command to print a message when the catalogue_table has no data

Status
"No local model is available. Please fetch a model by running 'ersilia fetch ...'" is returned when you run ersilia catalog --local and no local model is available

Related to #1072

@@ -1,6 +1,7 @@
import click

from . import ersilia_cli
from .. import echo
Copy link
Member

Choose a reason for hiding this comment

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

Where are we using this after the import?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! I was only trying something out,forgot to remove it

@@ -43,15 +45,25 @@ def catalog(local=False, file_name=None, browser=False, more=False):
mc.airtable()
return
if local:
catalog_table = mc.local()
Copy link
Member

Choose a reason for hiding this comment

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

I like your use of storing mc.local and mc.hub into a catalog_table variable. Could we maybe rewrite this whole bit as:

catalog_table = mc.local() if local else mc.hub()

if file_name is None:
    catalog = catalog_table.as_json()
else:
    catalog_table.write(file_name)
    catalog = None

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright

@DhanshreeA
Copy link
Member

LGTM!

@DhanshreeA DhanshreeA merged commit c3b4151 into ersilia-os:master Jun 26, 2024
16 checks passed
@dzumii dzumii deleted the no-local-model-fix branch July 30, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants