Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: .github Merge Workflow

on:
push:
branches:
- master

jobs:
Common-Merge:
uses: NWChemEx-Project/.github/.github/workflows/common_merge.yaml@master
with:
doc_target: 'Sphinx'
generate_module_docs: false
secrets: inherit
48 changes: 48 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Copyright 2023 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

name: .github Pull Request Workflow

on:
pull_request:
branches:
- master

jobs:
Common-Pull-Request:
uses: NWChemEx-Project/.github/.github/workflows/common_pull_request.yaml@master
with:
config_file: '.github/.licenserc.yaml'
source_dir: ''
compilers: ''
doc_target: 'Sphinx'
secrets: inherit
118 changes: 118 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Copyright 2022 NWChemEx-Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.14)
set(VERSION 1.0.0) #TODO: get from git
project(structurefinder VERSION "${VERSION}" LANGUAGES CXX)

include(FetchContent)
FetchContent_Declare(
nwx_cmake
GIT_REPOSITORY https://github.com/NWChemEx-Project/NWXCMake
)
FetchContent_MakeAvailable(nwx_cmake)
list(APPEND CMAKE_MODULE_PATH "${nwx_cmake_SOURCE_DIR}/cmake")

set(
CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake"
CACHE STRING "" FORCE
)

include(get_cmaize)
include(nwx_versions)

### Options ###
option(BUILD_TESTING "Should we build the tests?" OFF)
option(BUILD_PYBIND11_PYBINDINGS "Use Pybind11 to build Python bindings?" ON)
option(ENABLE_NWCHEM "Should we build supporf for friend: NWChem ?" ON)

## Build StructureFinder's dependencies ##
cpp_find_or_build_dependency(
nwchemex
URL github.com/NWChemEx-Project/NWChemEx
PRIVATE TRUE
VERSION ${NWX_SIMDE_VERSION}
BUILD_TARGET nwchemex
FIND_TARGET nwx::nwchemex
CMAKE_ARGS BUILD_TESTING=OFF
)
Copy link
Member

Choose a reason for hiding this comment

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

Should be SimDE not NWX.

Copy link
Author

Choose a reason for hiding this comment

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

I want to be able use NWChemEx driver modules to get CCSD, MP2 energies once available.

Copy link
Member

Choose a reason for hiding this comment

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

It should still be SimDE. Requiring the user to build NWChemEx adds a lot of build overhead and makes your plugin dependent on literally the entire stack.

That said, building of other plugins is useful for testing, but should be limited to integration testing only. I'll warn you that, to my knowledge, no one has yet tried to use NWChemEx as a dependency for integration testing, so there may be hiccups.

Copy link
Author

Choose a reason for hiding this comment

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

It should still be SimDE. Requiring the user to build NWChemEx adds a lot of build overhead and makes your plugin dependent on literally the entire stack.

Could you clarify? I assume the main role of this repo is to provide geometry optimization, which would require energies and gradients. NWChemEx is the repo that provides access to all plugins that can give those properties. How would I access them if I just use SimDE?

Copy link
Author

Choose a reason for hiding this comment

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

I understand that you mean those dependencies would only be required during testing, but I think a user of this repo would expect to access them directly.

Copy link
Member

Choose a reason for hiding this comment

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

The NWChemEx repo is the one that pulls together all of the functionalities. It's not meant to be used as a dependency of our plugins. This repo will more likely be a dependency of NWChemEx, actually. That way, when someone builds NWChemEx, they will get the Integrals, SCF, ChemCache, the geometry optimization modules here, and any other plugins we associate with it down the line.


if("${NWX_MODULE_DIRECTORY}" STREQUAL "")
message(
FATAL_ERROR "NWX_MODULE_DIRECTORY must be set to the directory "
"where you would like the Python modules installed."
)
endif()


if("${BUILD_TESTING}")
include(CTest)
include(nwx_pybind11)

# override
function(nwx_pybind11_tests npt_name npt_driver)
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need to override? Can we update nwx_pybind11?

if(NOT "${BUILD_PYBIND11_PYBINDINGS}")
return()
endif()

set(_npt_options "")
set(_npt_one_val "")
set(_npt_lists SUBMODULES)
cmake_parse_arguments(
"_npt" "${_npt_options}" "${_npt_one_val}" "${_npt_lists}" ${ARGN}
)

if("${BUILD_TESTING}")
include(CTest)
find_package(Python COMPONENTS Interpreter REQUIRED)

# Build the PYTHONPATH for the test
set(_npt_py_path "PYTHONPATH=${NWX_MODULE_DIRECTORY}")
set(_npt_py_path "${_npt_py_path}:${CMAKE_BINARY_DIR}")
foreach(_npt_submod ${_npt_SUBMODULES})
set(_npt_dep_dir "${CMAKE_BINARY_DIR}/_deps/${_npt_submod}-build")
set(_npt_py_path "${_npt_py_path}:${_npt_dep_dir}")
endforeach()
if(NOT "${NWX_PYTHON_EXTERNALS}" STREQUAL "")
set(_npt_py_path "${_npt_py_path}:${NWX_PYTHON_EXTERNALS}")
endif()

add_test(
NAME "${npt_name}"
COMMAND "${Python_EXECUTABLE}" "${npt_driver}"
)

set_tests_properties(
"${npt_name}"
PROPERTIES ENVIRONMENT "${_npt_py_path}"
)
endif()
endfunction()

#

set(PYTHON_TEST_DIR "${CMAKE_CURRENT_LIST_DIR}/tests/python")

message("calling nwx_pybind11_tests")
nwx_pybind11_tests(
pyStructureFinder_unit_tests
"${PYTHON_TEST_DIR}/unit_tests/test_structurefinder.py"
SUBMODULES nwchemex simde chemist pluginplay parallelzone
)
endif()

install(
DIRECTORY "${python_src_directory}/structurefinder"
DESTINATION "${NWX_MODULE_DIRECTORY}"
)
17 changes: 17 additions & 0 deletions src/python/structurefinder/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

Loading