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

Better model catalog display #12

Closed
miquelduranfrigola opened this issue Mar 23, 2022 · 17 comments
Closed

Better model catalog display #12

miquelduranfrigola opened this issue Mar 23, 2022 · 17 comments
Assignees
Labels
discussion Ideas needed from the community enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@miquelduranfrigola
Copy link
Member

Background

Currently, users can list the catalog of all available ersilia models with the command ersilia catalog. They have the option to list only models that are available on their local computer with ersilia catalog --local.
The current output of these commands is a table printed on the terminal using the tabulate python library.

Requested features

We would like to have a better output, although it is not clear to us what would be the best option. Options we've considered are:

  1. Open a browser tab and display models there.
  2. Continue with tabulate (or similar) and add a multi-page view.
@miquelduranfrigola miquelduranfrigola added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed discussion Ideas needed from the community labels Mar 23, 2022
@sayantani11
Copy link
Contributor

@miquelduranfrigola Would like to give a try!

@miquelduranfrigola
Copy link
Member Author

Hi @sayantani11 thanks for your proactivity as always. Feel free to explore and come up with suggestions here! As you see the current solution is quite raw.

@HarrietMwanza
Copy link

HarrietMwanza commented Apr 1, 2022

Hi @sayantani11 I am an Outreachy applicant and picked this first-time issue to contribute. Please do walk me over what I can help with and how to start

@Lewanja
Copy link

Lewanja commented Apr 1, 2022

Hi @miquelduranfrigola , I am a first time outreachy intern and would like to contribute to this project. Please, guide me through. Where do I start?

@sayantani11
Copy link
Contributor

@miquelduranfrigola In order to understand the issue a bit more, I would like to know what are the problems that are being faced by the current catalog display....and what are the maintainers looking for in the future?

@marliyya
Copy link

marliyya commented Apr 5, 2022

I'm an outrachy applicant and in interested in this problem I will absolutely like to contribute

@miquelduranfrigola
Copy link
Member Author

Hi @sayantani11 I think that tabulate is quite simple and, perhaps, an option that displays in the terminal with a multi-page view would be better. Do you think this is easy to achieve? As the catalog grows, it will be not feasible to display everything in the command line. Suggestions welcome!

As mentioned in issue #126 I would rather discard the website option at the moment since the AirTable is sufficient for now. Also, working on a GUI at the moment (updates soon!) so let's not duplicate efforts.

@anamika-yadav99
Copy link
Contributor

anamika-yadav99 commented Apr 11, 2022

Hi @miquelduranfrigola multi-page view can be implemented using latex_longtable table format which is supported by tabulate. Do you also want to change the formatting of the current catalog table?

@miquelduranfrigola
Copy link
Member Author

Interesting. Can we maybe produce an example of how latex_longtable would look like?

@Deepthi562
Copy link

Deepthi562 commented Apr 11, 2022

@miquelduranfrigola can i work on this? coz it has the tag help wanted.

@miquelduranfrigola
Copy link
Member Author

Hi @Deepthi562 the task was assigned to @sayantani11 a while ago, and I think we are on a good track with this. Do you have any suggestion that would go in the lines of what @anamika-yadav99 and @sayantani11 are discussing?

@anamika-yadav99
Copy link
Contributor

anamika-yadav99 commented Apr 12, 2022

@miquelduranfrigola @sayantani11 latex_longtable would look like a latex table. I'm sorry for not checking it properly. But now after after doing some research I found out that multipage table is only supported in latex_longtable in tabulate . One thing which can be done is adding a function which would slice the table, for say we have 200 models, 25 models in a page is decent size to display. We could slice it into table of 25. (Suggested by maintainers of tabulate astanin/python-tabulate#88 , astanin/python-tabulate#57)
Add a function to cli $ersilia catalog --next which would update the slice index and display the next slice of the table. This could be achieved without changing a lot around in catalog.py. There are other options available such as longtable which uses input in latex format and the table is rendered to display.
There's a lot of customization possible in the existing table format.

  1. The text could be center aligned.
  2. The spacing between two rows should be increased.
  3. The current table format used to display catalog is none. We could use other table format supported by tabulate. I found
    grid and pretty table format to be easily readable .
  4. Column width can be customized , multiline support in the Title column could be also included.
    Present table looks like :
    image

Table using pretty table format:
image

Table using fancy_grid:
image

@miquelduranfrigola
Copy link
Member Author

Hi @anamika-yadav99 this is very good!

  • I like the fancy_grid style with the centering as you suggest.
  • 25 models per page is very reasonable
  • I think your ersilia catalog --next solution is pretty good. Do you think we can also add a ersilia catalog --previous?

@anamika-yadav99
Copy link
Contributor

Hi @miquelduranfrigola . Yes, I can add ersilia catalog --previous as well. But I see this issue has been assigned to @sayantani11 . I'm happy to help her out.

@Nawarrr
Copy link

Nawarrr commented Apr 13, 2022

@miquelduranfrigola @sayantani11 latex_longtable would look like a latex table. I'm sorry for not checking it properly. But now after after doing some research I found out that multipage table is only supported in latex_longtable in tabulate . One thing which can be done is adding a function which would slice the table, for say we have 200 models, 25 models in a page is decent size to display. We could slice it into table of 25. (Suggested by maintainers of tabulate astanin/python-tabulate#88 , astanin/python-tabulate#57) Add a function to cli $ersilia catalog --next which would update the slice index and display the next slice of the table. This could be achieved without changing a lot around in catalog.py. There are other options available such as longtable which uses input in latex format and the table is rendered to display. There's a lot of customization possible in the existing table format.

  1. The text could be center aligned.
  2. The spacing between two rows should be increased.
  3. The current table format used to display catalog is none. We could use other table format supported by tabulate. I found
    grid and pretty table format to be easily readable .
  4. Column width can be customized , multiline support in the Title column could be also included.
    Present table looks like :
    image

Table using pretty table format: image

Table using fancy_grid: image

@anamika-yadav99 This is really good work and I think it will be better than the current catalog.

@miquelduranfrigola I would love to be assigned to help both @anamika-yadav99 and @sayantani11 if that's possible

@miquelduranfrigola
Copy link
Member Author

Hi @Nawarrr thanks for volunteering. I think the issue is well covered by the two of them. We will let you know if we need help, ok?

@miquelduranfrigola
Copy link
Member Author

Closing this issue now as it was resolved in #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Ideas needed from the community enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants