Skip to content

Conversation

AlexHeide
Copy link
Contributor

@AlexHeide AlexHeide commented Aug 18, 2025

Description

This PR moves optking's type and value validation for options from Psi4 to pydantic.

Allowed options are detected at compile time. Removes need to sync options. (REVERTED)

Some tests needed to be updated after changes to the IRC code.

User API & Changelog headlines

  • This PR accompanies the 0.4 optking release which includes additional linear coordinate handling and IRC fixes.
  • Alphabetical keywords list has now moved into optking docs page.
  • irc_forward and irc_backward were not being written since 1.7. irc_traj.<pid>.xyz file will now be written for irc jobs and opt_traj.<pid>.xyz file can also be requested for non irc jobs.
  • Setting a coordinate constraint to a whitespace containing string (i.e. set frozen_bend (" ")) no long works. Please use set frozen_bend "" to erase a previously set value.
  • Adds 'opt' to allowed cli test groups

Dev notes & details

  • An embedded python interpreter is used to check optking's pydantic model for fields and the types
    of those fields to be added to the options object. (REVERTED)
  • Some Psi4 specific options are left as module options.
  • Had to replace sphinx substitutions for optking with explicit links.
  • A sign error was hiding the fact that the current forward / backward direction doesn't always match old optking.
  • Addition of linear coordinates during IRC affects termination for HCN. Test updated.
  • Optking is pydantic v1 and v2 ready. optking.op is assigned to v1/optparams or v2/optparams as appropriate given detected pydantic version so updating Psi4's environment shouldn't break anything on optking's end. (Still true but since read_options no longer references optparams, less relevant to Psi devs)
  • Removes python setup.py from optking/Cmakelists.txt. Prepares for removal of setup.py. I'm delaying optkings move to pyproject.toml until after this PR so there'll be a deprecation notice for the time being.

Checklist

Status

  • Ready for review
  • Ready for merge

@JonathonMisiewicz JonathonMisiewicz dismissed their stale review August 19, 2025 14:44

Substantial update.

@AlexHeide
Copy link
Contributor Author

AlexHeide commented Aug 19, 2025

After discussing with Lori, the embedded python interpreter has been removed. I'm not aware of any alternative ways to get OptKing's options from python to the c++ options object, so I've just reverted.

There are a number of new options available to be set in Psi4. I haven't added docstrings because the docs are still pulled directly from optking. I've also removed any value restrictions so that additional keyword values like "STEP_TYPE": "CONJUGATE_GRADIENT" are now available.

@AlexHeide
Copy link
Contributor Author

AlexHeide commented Aug 22, 2025

c-f shows 0.4.2 as latest online, but Psi4 can't find it yet (nor can I find it with a local conda search). Should be good to go if we re-run this in an hour.

Update: conda should be able to find 0.4.2 now

@loriab
Copy link
Member

loriab commented Aug 22, 2025

Hi Alex, I made a change to your branch to collect the ooo package from conda. not sure why it wasn't there before (other than that I was building it from src for a while).

AlexHeide and others added 3 commits August 22, 2025 13:57
optking cf now explicitly sets python_min "3.9". Turn back on CMAKE_INSIST - should fix azure
Copy link
Contributor

@JonathonMisiewicz JonathonMisiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address my confusion over your comment.

Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for the new optking and for the change in plan for options processing!

@loriab loriab added this to the Psi4 1.10 milestone Aug 27, 2025
@loriab loriab added the optking label Aug 28, 2025
@loriab loriab added this pull request to the merge queue Aug 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 28, 2025
@loriab loriab added this pull request to the merge queue Aug 28, 2025
Merged via the queue into psi4:master with commit 6a874e5 Aug 28, 2025
6 checks passed
@loriab loriab mentioned this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants