Skip to content

Commit

Permalink
Merge pull request #24 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
New installation, and bug fix for optimization of atoms
  • Loading branch information
seamm authored Oct 23, 2023
2 parents e219f86 + 8e7c0b3 commit c4fce67
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 33 deletions.
7 changes: 6 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
History
=======

2023.8.23 -- Fix for installation of Psi4
* Psi4 is now available on CondaForge, so install from there if requested.
* Psi4 crashes if asked to optimize and atom, so change to doing a single point
energy is optimization is requested for and atom.

2023.8.22 -- Enhancement of orbital plots
* Added structure to the orbital plots
* Fixed a bug if the default nouber of cores was not 'available'
* Fixed a bug if the default number of cores was not 'available'

2023.6.4 -- Enhancements
* Added thermochemistry substep to compute the vibrational and other corrections for
Expand Down
5 changes: 3 additions & 2 deletions psi4_step/data/seamm-psi4.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: seamm-psi4
channels:
- psi4
- conda-forge
- conda-forge/label/libint_dev
dependencies:
- geometric
- python
# Executables, etc.
- psi4
- psi4-rt
# - psi4-rt
34 changes: 4 additions & 30 deletions psi4_step/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

"""Setup and run Psi4"""

import json
import logging
from pathlib import Path

Expand Down Expand Up @@ -74,6 +73,10 @@ def get_input(self, calculation_type="optimize"):
directory = Path(self.directory)
directory.mkdir(parents=True, exist_ok=True)

# Check for atoms and bypass optimization
if configuration.n_atoms == 1:
return super().get_input()

# references = self.parent.references

P = self.parameters.current_values_to_dict(
Expand Down Expand Up @@ -136,32 +139,3 @@ def get_input(self, calculation_type="optimize"):
lines.append(super().get_input(calculation_type=calculation_type))

return "\n".join(lines)

def analyze_sv(self, indent="", data={}, out=[]):
"""Parse the output and generating the text output and store the
data in variables for other stages to access
"""
# Read in the results from json
directory = Path(self.directory)
json_file = directory / "properties.json"
if json_file.exists():
with json_file.open() as fd:
data = json.load(fd)

# Put any requested results into variables or tables
self.store_results(
data=data,
create_tables=self.parameters["create tables"].get(),
)

text = "The calculated energy is {Eelec:.6f} Ha."
else:
data = {}
text = (
"\nThere are no results from Psi4. Perhaps it "
f"failed? Looking for {str(json_file)}."
)
printer.normal(__(text, **data, indent=self.indent + 4 * " "))
raise RuntimeError(text)

printer.normal(__(text, **data, indent=self.indent + 4 * " "))

0 comments on commit c4fce67

Please sign in to comment.