ersilia-os / ersilia

The Ersilia Model Hub, a repository of AI/ML models for infectious and neglected disease research.
https://ersilia.io
GNU General Public License v3.0
210 stars 145 forks source link

🐕 Batch: Pre-submission lintern #903

Open miquelduranfrigola opened 10 months ago

miquelduranfrigola commented 10 months ago

Summary

Often, small errors like a short title in the metadata will cause the model incorporation workflows to fail. It would be good to identify these errors earlier using a lintern.

Ideally, we would have a command like:

ersilia lint --repo_path $PATH_TO_WIP_MODEL

Objectives

We can potentially check several things in a model repository, including:

I would start with the metadata.json file. Most of the heavy lifting has already been done here: https://github.com/ersilia-os/ersilia/blob/master/ersilia/hub/content/card.py

A potential approach would be:

  1. Create a module called lintern.py under hub/content/
  2. Write a class called Lint with an arbitrary number of methods, including metadata.
  3. Write a CLI command that primarily uses the Lint class to check that everything is correct in the --repo_path folder.

Do the test as part of an earlier workflow. These are not mutually exclusive

Documentation

GemmaTuron commented 3 weeks ago

Is this lint check better suited for ersilia-maintenance? has any work in this direction been done or could this be an entry-level task @miquelduranfrigola and @DhanshreeA ?

miquelduranfrigola commented 3 weeks ago

Given that we have plans to simplify the CLI commands, I would definitely not include a lint command. However, lint functionalities are included (and could be further expanded) in both the test command as well as the ModelInspector class (used in ersilia-maintenance).

We can certainly think of more "tests" or "inspections" to do and come up with a good entry-level task. This is a good idea.

DhanshreeA commented 3 weeks ago

Plus to add to @miquelduranfrigola 's point, ersilia pack also has a lint built in for newer model contributions.

GemmaTuron commented 2 weeks ago

Hi @DhanshreeA Please if this is a good entry level task, open the appropriate issues in ersilia-maintenance repository or wherever appropriate.