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

Enhanced Model catalog display #238

Merged
merged 4 commits into from
Apr 27, 2022

Conversation

anamika-yadav99
Copy link
Contributor

@anamika-yadav99 anamika-yadav99 commented Apr 16, 2022

Issue #12
I have improved the model display according to discussion in comment #12 (comment)

I have added a function to slice the catalog table into table of 15. Table size of 25 was huge.
I have also added ersilia catalog --next and ersilia catalog --previous in cli which displays the next and previous table consequently.
I have done so by storing a variable called counter in an auxiliary file which is initialized to 1 everytime ersilia catalog is called. Whenever ersilia catalog --next is called the counter is updated by 1 and displays the next table. Vise versa happens in ersilia catalog --previous. Counter is decreased by 1.
Implementing this was a little tricky due to all the corner cases of reaching the last table or ersilia catalog --previous on the 1st table. So, I have set the value of counter to 1 every time the table is on the 1st page. The user is informed about the last page table. The counter is decreased by 2 when on the last page in order to not display the same page. I hope all the corner cases are covered.

This is how it looks. Table size of only 5 was used here because ersilia hub has only 21 models, which made it hard to check for the corner cases:
image

image

image

@Rufaida98
Copy link
Contributor

@anamika-yadav99 nicely done 💯

@anamika-yadav99
Copy link
Contributor Author

anamika-yadav99 commented Apr 19, 2022

There were a 2 bugs before. Which I have fixed now.

  1. The counter would keep updating even after the table was ended which returned error on command ersilia catalog --previous and also if user did ersilia catalog --next
  2. The initialize function was run even when --next or --previous command were used.

image
image
image

@miquelduranfrigola Could you please review this and give me your feedbacks

@anamika-yadav99
Copy link
Contributor Author

@anamika-yadav99 nicely done 💯

Thanks @Rufaida98

Copy link
Member

@miquelduranfrigola miquelduranfrigola left a comment

Choose a reason for hiding this comment

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

This looks very good! Approving

@miquelduranfrigola miquelduranfrigola merged commit e620986 into ersilia-os:master Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants