Skip to content

Conversation

@jlheflin
Copy link
Contributor

Is this pull request associated with an issue(s)?
No.

Description
Adds a beginning branch for adding PyBerny as an option for optimizing a chemical system geometry.

TODOs
Implement ModuleManager so that modules can be loaded

@CLAassistant
Copy link

CLAassistant commented Jun 14, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@ryanmrichard ryanmrichard left a comment

Choose a reason for hiding this comment

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

Have you tried building this? Based on what's here, I suspect the build will fail.

Take a look at https://github.com/NWChemEx/FriendZone. In particular, try to mirror its file structure (notably the C++/Python split).

You also need a test for your function see here for an example of how to add one to the build system.

jlheflin and others added 6 commits June 18, 2024 09:24
make lowercase to avoid problems on case-insensitive filesystems.
I'd add your toolchain to the .gitignore. We've talked about at some point having a repo with some starter toolchains, but for now we're not checking them in to any repos.
Copy link
Member

@jwaldrop107 jwaldrop107 left a comment

Choose a reason for hiding this comment

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

A couple of comments regarding documentation and workflows.

@ryanmrichard
Copy link
Member

@jlheflin your current error is because you're depending on friendzone for your module. Modules shouldn't directly depend on other modules/functionality found in other plugins. Instead they should depend on property types. For now, what I would do is write a function which loops over the XYZ you get back from PyBerny and directly fill that in to a ChemicalSystem object.

@ryanmrichard
Copy link
Member

@jwaldrop107 and I discussed some options for making a more reusable solution, but let's tackle that later.

Comment on lines 67 to 71
nwx_pybind11_tests(
py_${PROJECT_NAME}
"${${PROJECT_NAME}_PYTHON_TEST_DIR}/unit_tests/test_${PROJECT_NAME}.py"
SUBMODULES simde chemist pluginplay parallelzone
)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nwx_pybind11_tests(
py_${PROJECT_NAME}
"${${PROJECT_NAME}_PYTHON_TEST_DIR}/unit_tests/test_${PROJECT_NAME}.py"
SUBMODULES simde chemist pluginplay parallelzone
)
cmaize_find_or_build_dependency(
nwchemex
URL github.com/NWChemEx/NWChemEx
BUILD_TARGET nwchemex
FIND_TARGET nwx::nwchemex
CMAKE_ARGS BUILD_TESTING=OFF
)
nwx_pybind11_tests(
py_${PROJECT_NAME}
"${${PROJECT_NAME}_PYTHON_TEST_DIR}/unit_tests/test_${PROJECT_NAME}.py"
DEPENDS nwchemex
SUBMODULES simde chemist pluginplay parallelzone friendzone chemcache nwchemex
)

Try this for your CI error. Your unit test depends on NWChemEx (which also means it's technically an integration test) so you need to install NWChemEx and link to it.

Copy link
Member

@ryanmrichard ryanmrichard left a comment

Choose a reason for hiding this comment

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

I'm going to recommend breaking this into two PRs. In PR put all the infrastructure required to get the repo working. Having a library that prints "hello world" and a test checking the result is fine. The second PR then adds the Pyberny stuff. The LJ stuff is presumably taken care of by Felix's PR.

@ryanmrichard
Copy link
Member

Disregard my last suggestion. One PR is fine. I thought there was more to PyBerny than there is.

@jlheflin
Copy link
Contributor Author

jlheflin commented Feb 7, 2025

The GitHub Workflow is showing that the full ChemCache is being built, is this due to having chemcache in the CMakeLists.txt for the nwx_pybind11_tests submodules? I'm pretty sure we don't need the full ChemCache to test this.

Edit: I went ahead and stopped the workflow from completing to avoid anything that might get result in a charge. ChemCache already takes forever on my system, I'm sure this would result in a 2 day endeavor.

@jwaldrop107
Copy link
Member

The full ChemCache is being built because it is brought in as a dependency of NWChemEx, which defaults to using the generated_data branch. This behavior is control by this CMake option. The simple solution is to add BUILD_FULL_CHEMCACHE=OFF to the find_or_build call for NWX here

@jlheflin
Copy link
Contributor Author

jlheflin commented Feb 7, 2025

Docs are for boats. Also unsure of how to resolve the SimDE dependency issue.

config_file: '.github/.licenserc.yaml'
source_dir: ''
compilers: '["gcc-11", "clang-14"]'
doc_target: 'structure_finder_cxx_api'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
doc_target: 'structure_finder_cxx_api'
doc_target: ''

Try this. You don't have C++ source, so there's no reason to call Doxygen.

Also, the point of git commit messages are to: record what you did, and provide succinct updates to others following the development. If you want to be cheeky that's fine, but try to make them somewhat descriptive.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I will also add better commit messages in the future.

CMakeLists.txt Outdated
Comment on lines 55 to 57
# Builds C++ API documentation
include(nwx_cxx_api_docs)
nwx_cxx_api_docs("${${PROJECT_NAME}_INC_DIR}" "${${PROJECT_NAME}_SRC_DIR}")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Builds C++ API documentation
include(nwx_cxx_api_docs)
nwx_cxx_api_docs("${${PROJECT_NAME}_INC_DIR}" "${${PROJECT_NAME}_SRC_DIR}")

No C++ docs to build.

@ryanmrichard
Copy link
Member

What is this PR waiting on?

@jlheflin
Copy link
Contributor Author

I think this is r2g. I double checked the tests and it tests PyBerny and is based on the optimization of H2, and returns the energy. For now it is fine, but I will need to start another pull request to develop a property type that returns an energy and a chemical system with the resulting coordinates.

@jlheflin jlheflin marked this pull request as ready for review February 14, 2025 17:11
@ryanmrichard ryanmrichard merged commit 32e63eb into master Feb 14, 2025
5 checks passed
@ryanmrichard ryanmrichard deleted the pyberny_addition branch February 14, 2025 17:13
@jwaldrop107
Copy link
Member

🚀 [bumpr] Bumped! New version:v0.0.1

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

Successfully merging this pull request may close these issues.

5 participants