CobayaSampler / cobaya

Code for Bayesian Analysis
http://cobaya.readthedocs.io/en/latest/
Other
122 stars 125 forks source link

Python invocation not doing anything #350

Closed HTJense closed 2 months ago

HTJense commented 4 months ago

I referred before in #348 that invocation of python -m cobaya run instead of cobaya-run was not working in 3.9 (due to setup problems on our cluster, the latter doesn't always seem to work in our case).

This commit seems to be designed to re-create the invocation option through python, and the comment in the main file indicates that python -m cobaya <command> [args] should have the same effect as cobaya-<command> [args].

This seems however, not to be the case, and using python -m cobaya <command> appears to have no effect at all.

Example steps to reproduce:

  1. python -m pip install cobaya==3.4.1
  2. python -m cobaya run -h
  3. python -m pip install cobaya==3.5
  4. python -m cobaya run -h

Step 2 will produce a help message as output for v3.4.1, whereas step 4 will not do so for v3.5, despite the code of the main file indicating that it should. Similar actions such as attempting to run a yaml file will cause the program to exit gracefully without running any code, it seems.

JesusTorrado commented 4 months ago

Thanks for the report! I'd swear I tested it thoroughly with 3.9 and 3.11, including the -h command. But obviously not... Will fix soon. Is your test above for 3.9?

HTJense commented 4 months ago

We encountered this error on 3.9.2 (on our cluster, where we initially found that trying to run chains did nothing), and the example above provided no output for me in version 3.10.12 (on my work device).

cmbant commented 3 months ago

Probably just missing call to run_command, try https://github.com/CobayaSampler/cobaya/commit/374b6f31cf3e05a5ccab57ae2df8ccfb93537866 ?

cmbant commented 2 months ago

Closing assuming OK, please reopen if not.