MindTheGap-ERC / CarboKitten.jl

Julia implementation of carbonate platform model
https://mindthegap-erc.github.io/CarboKitten.jl/
GNU General Public License v3.0
0 stars 0 forks source link

entangled watch gives ERROR Expected <class 'dict'> #29

Closed HannoSpreeuw closed 3 months ago

HannoSpreeuw commented 4 months ago

Following the README:

entangled watch

from bash gives

ERROR    Expected <class 'dict'>, got: {'build': {'runners': {'Julia': "julia
                    --project=. --startup-file=no -e 'using DaemonMode; runargs()'
                    {script}", 'Gnuplot': 'gnuplot {script} > $@'}}}
HannoSpreeuw commented 3 months ago

Also, should we include instructions on how to install entangled in the README?

EmiliaJarochowska commented 3 months ago

Maybe a link to Entangled documentation? We also don't include instructions on how to install pipenv in other repos, don't think it needs to be that comprehensive.

HannoSpreeuw commented 3 months ago

Okay, but this repo has a file entangled.toml at top level, so perhaps this needs to be explained in the README.

EmiliaJarochowska commented 3 months ago

Right. But that is only important for development and can go under this section in the README. For regular users this file should not have any effect. So it could be just "see Entangled documentation", or make a link out of this line:

├── entangled.toml      # entangled config

@jhidding this is not needed for just this repo, but do you have a README template for Entangled projects? So one doesn't have to write this anew each time? We can add it to a repo template in MTG as an option if it's more widely used.

HannoSpreeuw commented 3 months ago

@EmiliaJarochowska Good idea to make a link out of that line.

HannoSpreeuw commented 3 months ago

@jhidding I can get entangled watch running if I first comment in

julia --startup-file=no -e 'using DaemonMode; serve()'

Should I update entangled.toml in this way?

Probably not the most elegant solution, because it also gives an error:

ERROR    Could not read config: Expected '=' after a key in a key/value pair (at line 7, column 7)

although it continues running.

Or leave it commented out and add the line

julia --startup-file=no -e 'using DaemonMode; serve()'

to the README just before entangled watch i.e. at the beginning of the Development section.

EmiliaJarochowska commented 3 months ago

This question I cannot answer, it needs to be @jhidding But I have a related one that I can maybe smuggle in here. I tried to reproduce your error but I got other problems because of some conflicting dependencies that entangled uses. Which is perfectly fair, because in CarboKitten's repo there is no virtual environment in which to run python so running this with just the packages that happen to be installed on my computer is likely to give new conflicts each time. Entangled running instructions include poetry though. So what I don't understand, are you @jhidding @HannoSpreeuw @xyl96 running entangled in a poetry environment but not pushing the pyproject.toml file or is there a conflict between project files with Julia or is this just working for you without a venv?

HannoSpreeuw commented 3 months ago

That question is legit; I encountered similar confusion.

We are running a Julia package which is supplemented by a Python package (Entangled) that indeed deserves its own venv, that would be the proper way.

However, that - i.e. an additional pyproject.toml or Pipfile - was a bit too much for me to wrap my head around so I run CarboKitten from a shell in a conda py311 environment, that I also use for other projects. Since Entangled seems to be the only Python package to supplement CarboKitten, I guess I can get away with this slightly sloppy approach.

On the other hand, there is actually nothing wrong with adding (and optionally git tracking) a Pipfile or pyproject.toml to the code base. But you need to remember what all these files are for or rather add a line of text to the README.

EmiliaJarochowska commented 3 months ago

My preference would be to add a python venv to the repo and make it clear this is only for development, so we don't overwhelm potential CarboKitten users. If a combo of a Julia project with a Python venv is a bit too much for you then regular mortals won't be able to use it.

I would still like to bring this question to the attention of @jhidding, together with the potential template: it is sure to be asked for other projects too.

jhidding commented 3 months ago

This question I cannot answer, it needs to be @jhidding But I have a related one that I can maybe smuggle in here. I tried to reproduce your error but I got other problems because of some conflicting dependencies that entangled uses. Which is perfectly fair, because in CarboKitten's repo there is no virtual environment in which to run python so running this with just the packages that happen to be installed on my computer is likely to give new conflicts each time. Entangled running instructions include poetry though. So what I don't understand, are you @jhidding @HannoSpreeuw @xyl96 running entangled in a poetry environment but not pushing the pyproject.toml file or is there a conflict between project files with Julia or is this just working for you without a venv?

I will add a pyproject.toml, that should solve most issues here.

HannoSpreeuw commented 3 months ago

Thanks Johan, perhaps you can add that to the fix_entangled_watch branch that I pushed yesterday.