FormingWorlds / PROTEUS

Coupled atmosphere-interior framework to simulate the temporal evolution of rocky planets.
https://fwl-proteus.readthedocs.io
Apache License 2.0
12 stars 1 forks source link

Include warnings for user to update the code to modules latest versions #240

Closed EmmaPostolec closed 5 days ago

EmmaPostolec commented 4 weeks ago

Hi, as I mentioned during the PROTEUS meeting this morning, proteus.py crashes when running the default configuration file: $ proteus start --config input/default.toml I 'git pulled' the main branch on my local computer to make sure I'm up to date, but it still crashes (see the proteus_00.log file attached for more details). The KeyError is "mass".

Let me know if you have any idea how to fix this :)

proteus_00.log

nichollsh commented 4 weeks ago

Have you updated your Mors to the latest version? This could be related to some of the changes Laurent made last week.

EmmaPostolec commented 4 weeks ago

Ah good point thanks @nichollsh ! I just did it and it works perfectly fine. I will think about it next time so I don't open a new issue for this. :)

nichollsh commented 4 weeks ago

Glad this helped @EmmaPostolec! I had a similar problem too, so figured it might be the same thing. I wonder if it's possible to add a warning for the user if they haven't updated something.

EmmaPostolec commented 4 weeks ago

Yes, it would definitely be useful to anyone working on the code (especially new users like Bsc or Msc students) I think !

EmmaPostolec commented 4 weeks ago

Should I reopen this issue and suggest this idea as a code improvement ? @nichollsh

timlichtenberg commented 4 weeks ago

Yes, this seems like a good idea.

nichollsh commented 4 weeks ago

Another similar thing to do would be to print the module configuration to the log. This makes sure the user is aware of what they are using, and also is useful for knowing what configuration was used for a run.

EmmaPostolec commented 4 weeks ago

Nice ! So the goal would be to include warning for the user to update his code to the latest version of Proteus. One way to do it is first by printing the module configuration to the log file while running proteus.py as @nichollsh suggested.

timlichtenberg commented 1 week ago

Has this been resolved by on of the PRs?

nichollsh commented 1 week ago

It has been somewhat addressed by adding logging statements regarding the module environment. Maybe we could add an automated check for when the code needs updating? Something like proteus update in the CLI, which polls PyPI for the latest versions and notifies the user if something newer is available. @stefsmeets would something like this be possible?

stefsmeets commented 1 week ago

I'm happy to pick this up and see what we can do about it. Some codes have a doctor subcommand which does something like this.