ersilia icon indicating copy to clipboard operation
ersilia copied to clipboard

🐛 Bug: Notebook conversion in workflow

Open miquelduranfrigola opened this issue 1 year ago • 10 comments

Describe the bug.

Automated workflows are failing due to an issue in the Colab Notebook workflow: https://github.com/ersilia-os/ersilia/actions/runs/7048990424/job/19186425834

@megamanics : Do you know what may be happening here? Thanks!

Describe the steps to reproduce the behavior

No response

Expected behavior.

No response

Screenshots.

No response

Operating environment

GitHub Actions Ubuntu

Additional context

No response

miquelduranfrigola avatar Dec 01 '23 12:12 miquelduranfrigola

it looks like it started with this commit: https://github.com/ersilia-os/ersilia/commit/2f3c038fb2ebab81a4da5c97929287d009071e64

Image

Image

Try reverting this version to narrow down the source of the problem?

megamanics avatar Dec 12 '23 18:12 megamanics

This is useful, thanks! @GemmaTuron do we still need levenshtein? Perhaps we have it as optional?

miquelduranfrigola avatar Dec 15 '23 20:12 miquelduranfrigola

I have removed the levenshtein dependency (it was not really necessary) but unfortunately this did not solve the issue. I have decided to remove the workflow step related to the notebook working with Python API. It is somewhat redundant with the CLI step. I am unsure what was going on, in my opinion, it is related to the notebook conversion command.

miquelduranfrigola avatar Dec 19 '23 08:12 miquelduranfrigola

Hi @miquelduranfrigola

I don't understand, the point of this action was to test the Python API command, the CLI was just an addition, so if anything the CLI is what should be removed.

GemmaTuron avatar Dec 19 '23 08:12 GemmaTuron

I don't think the issue is with the conversion command, since this works fine for the notebook run with the CLI commands. The issue is quite simple: we need to install pandas so that the output can be parsed

try:
    import pandas as pd
except ModuleNotFoundError:
    pd = None
File ~/miniconda3/envs/ersilia/lib/python3.10/site-packages/ersilia/core/model.py:212, in ErsiliaModel._api_runner_return(self, api, input, output, batch_size)
    210 def _api_runner_return(self, api, input, output, batch_size):
    211     if output == "pandas" and pd is None:
--> 212         raise Exception
    213     if output == "json":
    214         R = []

GemmaTuron avatar Dec 19 '23 09:12 GemmaTuron

I've tried simply by adding pandas to the installs, it works in my local but for some reason it does not in the workflow file? https://github.com/ersilia-os/ersilia/actions/runs/7260232462/workflow

GemmaTuron avatar Dec 19 '23 10:12 GemmaTuron

Yes, I do not manage to solve this issue either, @GemmaTuron . For now, I have commented out the API

miquelduranfrigola avatar Jan 02 '24 15:01 miquelduranfrigola

Hi @GemmaTuron - I am apparently unable to solve this issue. Should we seek help?

miquelduranfrigola avatar Jan 03 '24 21:01 miquelduranfrigola

@miquelduranfrigola please see my comments regarding pandas in #928 If we make it a requirement of Ersilia I think the problem will be solved.

GemmaTuron avatar Jan 04 '24 06:01 GemmaTuron

I am ok with having pandas as a dependency.

miquelduranfrigola avatar Jan 04 '24 07:01 miquelduranfrigola