Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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
77 changes: 53 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,60 @@
*.tmp
*.autosave
*.bak
*~
*.py[cod]
*.so
*.cfg
!.isort.cfg
!setup.cfg
*.orig
*.log
*.pot
__pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*
.DS_Store

# These are directories used by IDEs for storing settings
.idea/
.vscode/

# These are common Python virtual enviornment directory names
venv/
docs/venv/

# This is where Jupyter/IPython store backup files
.ipynb_checkpoints/

# Byte-compiled Python
__pycache__/

# These are common build directory names
build*/
docs/build
docs/source/_build
docs/doxyoutput
docs/source/api
*-build-*/
_build/
Debug/
Release/
.ropeproject
.project
.pydevproject
.settings
.idea
.vscode
tags

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info

# Unittest and coverage
htmlcov/*
.coverage
.coverage.*
.tox
junit*.xml
coverage.xml
.pytest_cache/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/source/api/*
!docs/source/api/modules.rst
docs/source/_rst/*
docs/build/*
cover/*
MANIFEST

# Per-project virtualenvs
*venv*/
.conda*/
.python-version

# Users commonly store their specific CMake settings in a toolchain file
toolchain.cmake
Expand All @@ -50,4 +79,4 @@ cache.db
uuid.db

# This is a generated file
src/python/friendzone/friends.py
# src/python/friendzone/friends.py
2 changes: 1 addition & 1 deletion .licenserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ header:
- docs/source/bibliography/*.bib
- docs/source/nitpick_exceptions
- version.txt
- cmake/friends.py.in
- build/
- venv/

comment: never
20 changes: 3 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,9 @@ include(get_cmaize)
include(nwx_cxx_api_docs)

### Files and Paths ###
set(friends_template "${CMAKE_CURRENT_LIST_DIR}/cmake/friends.py.in")
set(python_src_directory "${CMAKE_CURRENT_LIST_DIR}/src/python")

# # Doxygen docs
if("${ONLY_BUILD_DOCS}")
# If we are only building the docs, we need to produce friends.py here
configure_file(
"${friends_template}"
"${python_src_directory}/friendzone/friends.py"
@ONLY
)
endif()
nwx_cxx_api_docs("${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/include")

### Options ###
Expand All @@ -47,6 +38,7 @@ cmaize_option_list(
BUILD_PYBIND11_PYBINDINGS ON "Use Pybind11 to build Python bindings?"
ENABLE_EXPERIMENTAL_FEATURES OFF "Build features which are not 1.0-ed yet?"
ENABLE_NWCHEM ON "Should we build support for friend: NWChem ?"
ENABLE_MOLSSI ON "Build support for the MolSSI interface?"
ENABLE_ASE ON "Build support for the Atomic Simulation Environment?"
)

Expand All @@ -70,18 +62,12 @@ set(

## Find friends ##
include(ase)
include(molssi)
include(nwchem)

## Configure file with enabled friends ##
configure_file(
"${friends_template}" # Input file
"${python_src_directory}/friendzone/friends.py" # Output file
@ONLY # Only replace @ variables
)

#TOOD: Replace cmaize_add_library when it supports Python
add_library(${PROJECT_NAME} INTERFACE)
target_link_libraries(${PROJECT_NAME} INTERFACE simde ase nwchem)
target_link_libraries(${PROJECT_NAME} INTERFACE simde ase molssi nwchem)

if("${BUILD_TESTING}")
include(CTest)
Expand Down
40 changes: 0 additions & 40 deletions cmake/friends.py.in

This file was deleted.

38 changes: 38 additions & 0 deletions cmake/molssi.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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.

include_guard()

if("${BUILD_PYBIND11_PYBINDINGS}")
include(python/python)

#[[[ Determines if the MolSSI Python interface are installed.
#
# At present FriendZone can not install
#]]
function(find_molssi)
assert_python_module("qcelemental")
message("Found qcelemental: ${QCELEMENTAL_FOUND}")
assert_python_module("qcengine")
message("Found qcengine: ${QCENGINE_FOUND}")
assert_python_module("networkx")
message("Found networkx: ${NETWORKX_FOUND}")
endfunction()

if("${ENABLE_MOLSSI}")
find_molssi()
endif()
endif()

add_library(molssi INTERFACE)
5 changes: 0 additions & 5 deletions cmake/nwchem.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,12 @@
include_guard()

if("${BUILD_PYBIND11_PYBINDINGS}")
include(python/python)

#[[[ Determines if NWChem and the necessary Python interface are installed.
#
# At present FriendZone can not install
#]]
function(find_nwchem)
find_program(NWCHEM_FOUND nwchem REQUIRED)
assert_python_module("qcelemental")
assert_python_module("qcengine")
assert_python_module("networkx")
message("Found nwchem: ${NWCHEM_FOUND}")
endfunction()

Expand Down
91 changes: 91 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright 2025 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.

# This file defines the pip-installable Python package.

[build-system]
requires = ["setuptools>=46.1.0", "setuptools_scm[toml]>=5"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# For smarter version schemes and other configuration options,
# check out https://github.com/pypa/setuptools_scm
version_scheme = "no-guess-dev"

# To create a pip-installable package that uses CMake in the backend,
# scikit-build-core is used as the build backend, recommended by Pybind11.
#
# scikit-build-core: https://scikit-build-core.readthedocs.io/en/latest/
# Pybind11 scikit-build-core example: https://github.com/pybind/scikit_build_example
# [build-system]
# requires = ["scikit-build-core>=0.11", "pybind11>=3.0"]
# build-backend = "scikit_build_core.build"


[project]
name = "friendzone"
license = "Apache-2.0"
license-files = ["LICENSE"]
description = "Provides SimDE compatible APIs so that NWChemEx can play nicely with its friends."
readme = "README.md"
authors = [
{ name = "zachcran", email = "[email protected]" },
{ name = "jwaldrop107", email = "[email protected]" },
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Private :: Do Not Upload",
]
# Dynamic project attributes
#
# Set the project version dynamically according to git tags.
# Git tag version info: https://github.com/pypa/setuptools-scm/blob/fb261332d9b46aa5a258042d85baa5aa7b9f4fa2/README.rst#default-versioning-scheme
dynamic = ["version"]
# NOTE: Invisible dependency for now until Python bindings at SimDE are
# packaged properly and available here
# dependencies = ["simde"]


[tool.setuptools]
# Cannot automatically find the friendzone namespace so we set it here
package-dir = { "" = "src/python" }

# Optional dependencies represent optional features that can be enabled
# during installation
# Example: pip install friendzone[ase]
[project.optional-dependencies]
ase = ["ase"]
molssi = ["qcengine", "qcelemental", "networkx"]

# Dependency groups are optional dependencies that are not intented to appear
# after packaging, usually used to help with testing or development
# Example: pip install . --group dev
[dependency-groups]
test = ["pytest"]
dev = [{ include-group = "test" }]

[tool.pytest.ini_options]
minversion = "8.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = ["error", "ignore::pytest.PytestCacheWarning"]
testpaths = ["tests"]
9 changes: 3 additions & 6 deletions src/python/friendzone/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@
# limitations under the License.

from .nwx2ase import load_ase_modules
from .nwx2qcelemental import load_qcelemental_modules
from .nwx2qcengine import load_qcengine_modules
from .nwx2molssi import load_molssi_modules


def load_modules(mm):
"""Loads the collection of all modules provided by Friendzone. This function
calls the various friend specific module loading functions, including:

* `load_ase_modules`
* `load_qcengine_modules`
* `load_qcelemental_modules`
* `load_molssi_modules`

Note some and/or all of these may be no-ops depending on what friends were
enabled.
Expand All @@ -32,5 +30,4 @@ def load_modules(mm):
:type mm: pluginplay.ModuleManager
"""
load_ase_modules(mm)
load_qcengine_modules(mm)
load_qcelemental_modules(mm)
load_molssi_modules(mm)
Loading