Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot automatically choose optimizer #29

Open
crow02531 opened this issue Oct 21, 2024 · 0 comments
Open

Cannot automatically choose optimizer #29

crow02531 opened this issue Oct 21, 2024 · 0 comments

Comments

@crow02531
Copy link

crow02531 commented Oct 21, 2024

When running ml.optimize_geometry(model=mymodel, initial_molecule=initmol) it complaints AttributeError: 'optimize_geometry' object has no attribute 'program'. And when I inspected into simulations.py/optimize_geometry.__init__ I found that:

        if program != None:
            self.program = program
        else:
            if "GAUSS_EXEDIR" in os.environ: self.program = 'Gaussian'
            else:
                try:
                    import geometric
                    self.program = 'geometric'
                # try:
                #     import ase
                #     self.program = 'ASE'
                except:
                    try: import scipy.optimize
                    except: raise ValueError('please set $GAUSS_EXEDIR or install geometric or install scipy')

        # some codes doing nothing to 'self.program'

        if self.program.casefold() == 'Gaussian'.casefold(): self.dump_trajectory_interval = 1 # Gaussian optimizer needs traj file to get the optimization trajectory
        if self.program.casefold() == 'geometric'.casefold(): self.dump_trajectory_interval = 1

which undoubtedly crashed if program was not provided explicitly and "Gaussian" or "geometric" was not installed.

PS: my version is 3.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant