grimme-lab / CENSO

CENSO - Commandline ENergetic SOrting of Conformer Rotamer Ensembles
https://xtb-docs.readthedocs.io/en/latest/CENSO_docs/censo.html
GNU General Public License v3.0
25 stars 10 forks source link

"unrecognized argument" error #56

Closed johnwkeller54 closed 4 weeks ago

johnwkeller54 commented 1 month ago

I am getting a "censo: error: unrecognized arguments: ./crest_conformers.xyz" when I run censo per the following:

$ cd $ python3.12 -m censo -inp ./crest_conformers.xyz

FrancescoTalotta commented 1 month ago

Hello I have got the same error. I believe there are some problems with the cml_parser.py. To let it work I commented out some lines in the cml_parser.py file:

    #if not check_soft_requirements(args):
    #    raise argparse.ArgumentError(
    #        # None, "One of the soft requirements ('-inp', '-chrg', '-u') not met."
    #        None,
    #        "You must provide an input file via '-i'.")
johnwkeller54 commented 1 month ago

Hi, I did that and still gives same error.

FrancescoTalotta commented 1 month ago

Did you recompile the code with pip install . ?

johnwkeller54 commented 1 month ago

Yes:

$ python3.12 -m pip install . ... Successfully built censo Installing collected packages: censo Attempting uninstall: censo Found existing installation: censo 2.0.2.dev4+g06f5d36 Uninstalling censo-2.0.2.dev4+g06f5d36: Successfully uninstalled censo-2.0.2.dev4+g06f5d36 Successfully installed censo-2.0.2.dev4+g06f5d36.d20241002

lines 529-533 of cml_parser.py:

#if not check_soft_requirements(args):
#    raise argparse.ArgumentError(
#        # None, "One of the soft requirements ('-inp', '-chrg', '-u') not met."
#        None,
#        "You must provide an input file via '-inp'.")

JK

johnwkeller54 commented 1 month ago

Repeated install, edit cml_parser.py, re-compile with python3.11. Same result.

FrancescoTalotta commented 1 month ago

Hello, that's how I perform a calculation with the new version:

censo -i $geom -c 2 -s acetonitrile -O 4 --maxcores 16 > $CurrDir/censo.out

I use the -i option for the geometry

adamhorvath99 commented 1 month ago

I have the same issue

johnwkeller54 commented 1 month ago

Dear Developers: If censo is broken, please fix it or tell us how to modify it. If censo is not broken, please provide more detailed directions for running a basic censo calculation.

If I run "python3.12 -m censo -h" I get help messages which include "-i, --help INP Relative path to ensemble.."

If I use "python3.12 -m censo -i crest_conformers.xyz > censo.out" I get the error message "You must provide an input file via '-inp'."

If I use "python3.12 -m censo -inp crest_conformers.xyz > censo.out" I get the error message "...censo: error: unrecognized arguments: crest_conformers.xyz"

Why is censo not accepting my input??

John

drmewes commented 1 month ago

Not the developer, but I had a brief glance at the code for argparse() in cml_parser.py.

What I can see there is that input is accepted as "-i" and "--input", but not as "-inp", so yes, the help is faulty (I guess this is a conflict resulting from the 1.2 -> 2.0 rewrite). Here is the function:

groups[0].add_argument( "-i", "--input", dest="inp", type=str, help="Relative path to ensemble file, e.g. crest_conformers.xyz ", )

And the error is thrown in:

`if not check_soft_requirements(args): raise argparse.ArgumentError(

None, "One of the soft requirements ('-inp', '-chrg', '-u') not met."

        None,
        "You must provide an input file via '-inp'.")`

You can try "--input", but I fear sth else is wrong, maybe having to do with the way how you call it... Have you tried -input "crest_conformers.xyz"?

I am sure the developers will soon take a look and fix the issue. Cheers, Jan

lmseidler commented 1 month ago

Hi everyone and sorry for the late answer. The please check out the newest commit in the main branch. For the new version, it is required to give and input file via -i or --inp and the maximum number of cores CENSO is allowed to work with via --maxcores. The last version unfortunately included a fairly confusing error message. Hope this resolves the issue.

Leopold

johnwkeller54 commented 1 month ago

OK! that works now! The 10-6-2024 version was installed. The command to for a basic job was python3.12 - m censo --input "crest_conformers.xyz" --maxcores 4 > censo.out Thank you Leopold, Jan, Adam, and Francesco