Skip to content

Commit

Permalink
Merge branch 'master' into new-ob-conformer
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <[email protected]>
  • Loading branch information
ghutchis authored Dec 6, 2023
2 parents eac0dd1 + 20c37b5 commit f26fc97
Show file tree
Hide file tree
Showing 234 changed files with 46,129 additions and 25,273 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ env:
CACHE: -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
SCCACHE_GHA_ENABLED: "true"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.config.name }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ env:
MACOS_TARGET: 10.12
FEATURES: -DUSE_VTK=ON -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF -DUSE_3DCONNEXION=ON

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: ${{ matrix.config.name }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Build Wheels

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Don't build python 2.7, pypy, or 32-bit wheels or Mac arm64 on Py3.8
CIBW_SKIP: "cp36-* cp37-* cp311-* cp38-macosx_arm64 pp* *-musllinux_* *-manylinux_i686 *-win32"
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/codacy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ permissions:

jobs:
codacy-security-scan:
name: Codacy Security Scan
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
name: Codacy Security Scan
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout code
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ on:
schedule:
- cron: '42 6 * * 6'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
QT_VERSION: 5.15.2
FEATURES: -DBUILD_GPL_PLUGINS=ON -DWITH_COORDGEN=OFF
Expand Down
156 changes: 155 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,156 @@
docs/build
.DS_Store
.DS_Store
.vscode
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ include(DetermineVersion)

# Set up our version.
set(AvogadroLibs_VERSION_MAJOR "1")
set(AvogadroLibs_VERSION_MINOR "97")
set(AvogadroLibs_VERSION_PATCH "0")
set(AvogadroLibs_VERSION_MINOR "98")
set(AvogadroLibs_VERSION_PATCH "1")
set(AvogadroLibs_VERSION
"${AvogadroLibs_VERSION_MAJOR}.${AvogadroLibs_VERSION_MINOR}.${AvogadroLibs_VERSION_PATCH}")
find_package(Git)
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ![Avogadro 2][Avogadro2Logo] Avogadro 2

[![Latest Release](https://img.shields.io/github/v/release/openchemistry/avogadrolibs)](https://github.com/OpenChemistry/avogadrolibs/releases) [![BSD License](https://img.shields.io/github/license/openchemistry/avogadrolibs)](https://github.com/OpenChemistry/avogadrolibs/blob/master/LICENSE) [![Build Status](https://img.shields.io/github/actions/workflow/status/openchemistry/avogadrolibs/build_cmake.yml?branch=master)](https://github.com/OpenChemistry/avogadrolibs/actions) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![GitHub contributors](https://img.shields.io/github/contributors/openchemistry/avogadrolibs.svg?style=flat)](https://github.com/OpenChemistry/avogadrolibs/graphs/contributors) [![OpenCollective Backers](https://img.shields.io/opencollective/all/open-chemistry)](https://opencollective.com/open-chemistry)
[![Latest Release](https://img.shields.io/github/v/release/openchemistry/avogadrolibs)](https://github.com/OpenChemistry/avogadrolibs/releases) [![BSD License](https://img.shields.io/github/license/openchemistry/avogadrolibs)](https://github.com/OpenChemistry/avogadrolibs/blob/master/LICENSE) [![Build Status](https://img.shields.io/github/actions/workflow/status/openchemistry/avogadrolibs/build_cmake.yml?branch=master)](https://github.com/OpenChemistry/avogadrolibs/actions) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/44bb12662c564ed8a27ee8a7fd89ed50)](https://app.codacy.com/gh/OpenChemistry/avogadrolibs/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Download Count](https://avogadro.cc/downloads.svg?readme)](https://github.com/OpenChemistry/avogadrolibs/releases) [![Citation Count](https://avogadro.cc/citations.svg?readme)](http://doi.org/10.1186/1758-2946-4-17)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](http://makeapullrequest.com) [![GitHub contributors](https://img.shields.io/github/contributors/openchemistry/avogadrolibs.svg?style=flat&color=0bf)](https://github.com/OpenChemistry/avogadrolibs/graphs/contributors) [![OpenCollective Backers](https://img.shields.io/opencollective/all/open-chemistry)](https://opencollective.com/open-chemistry)

## Introduction

Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ patches for widely used long-term-support OS.

| Version | Supported |
| ------- | ------------------ |
| 1.98.x | :white_check_mark: |
| 1.97.x | :white_check_mark: |
| < 1.97 | :x: |

Expand Down
8 changes: 7 additions & 1 deletion avogadro/calc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ avogadro_headers(Calc
chargemodel.h
chargemanager.h
defaultmodel.h
energycalculator.h
energymanager.h
lennardjones.h
)

target_sources(Calc PRIVATE
chargemodel.cpp
chargemanager.cpp
defaultmodel.cpp
energycalculator.cpp
energymanager.cpp
lennardjones.cpp
)

avogadro_add_library(Calc)

target_link_libraries(Calc
PUBLIC Avogadro::Core)
PUBLIC Avogadro::Core cppoptlib)
10 changes: 4 additions & 6 deletions avogadro/calc/chargemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <algorithm>
#include <memory>


namespace Avogadro::Calc {

ChargeManager& ChargeManager::instance()
Expand Down Expand Up @@ -88,7 +87,7 @@ ChargeManager::ChargeManager()
ChargeManager::~ChargeManager()
{
// Delete the models that were loaded.
for (auto & m_model : m_models) {
for (auto& m_model : m_models) {
delete m_model;
}
m_models.clear();
Expand All @@ -102,7 +101,6 @@ std::set<std::string> ChargeManager::identifiersForMolecule(

// check our models for compatibility
for (auto m_model : m_models) {

// We check that every element in the molecule
// is handled by the model
auto mask = m_model->elements() & molecule.elements();
Expand All @@ -113,8 +111,8 @@ std::set<std::string> ChargeManager::identifiersForMolecule(
return identifiers;
}

MatrixX ChargeManager::partialCharges(
const std::string& identifier, Core::Molecule& molecule) const
MatrixX ChargeManager::partialCharges(const std::string& identifier,
Core::Molecule& molecule) const
{
// first check if the type is found in the molecule
// (i.e., read from a file not computed dynamically)
Expand Down Expand Up @@ -181,4 +179,4 @@ Core::Array<double> ChargeManager::potentials(
return model->potentials(molecule, points);
}

} // namespace Avogadro
} // namespace Avogadro::Calc
14 changes: 2 additions & 12 deletions avogadro/calc/chargemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AVOGADROCALC_EXPORT ChargeManager

/**
* @brief Register a new charge model with the manager.
* @param format An instance of the format to manage, the manager assumes
* @param model An instance of the model to manage, the manager assumes
* ownership of the object passed in.
* @return True on success, false on failure.
*/
Expand All @@ -80,16 +80,6 @@ class AVOGADROCALC_EXPORT ChargeManager
*/
bool removeModel(const std::string& identifier);

/**
* New instance of the model for the specified @p identifier. Ownership
* is passed to the caller.
* @param identifier The unique identifier of the format.
* @return Instance of the format, nullptr if not found. Ownership passes to
* the
* caller.
*/
ChargeModel* newModelFromIdentifier(const std::string& identifier) const;

/**
* Get a list of all loaded identifiers
*/
Expand All @@ -111,7 +101,7 @@ class AVOGADROCALC_EXPORT ChargeManager
* @return atomic partial charges for the molecule, or 0.0 if undefined
*/
MatrixX partialCharges(const std::string& identifier,
Core::Molecule& mol) const;
Core::Molecule& mol) const;

/**
* @return the potential at the point for the molecule, or 0.0 if the model is
Expand Down
9 changes: 5 additions & 4 deletions avogadro/calc/chargemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using Core::Molecule;
namespace Calc {

#ifndef M_PI
#define M_PI 3.14159265358979323846
constexpr double M_PI = 3.14159265358979323846;
#endif

ChargeModel::ChargeModel() : m_dielectric(1.0) {}
Expand All @@ -39,7 +39,7 @@ double ChargeModel::potential(Molecule& mol, const Vector3& point) const
double distance = (positions[i] - point).norm();
if (distance > 0.01) {
// drop small distances to avoid overflow
potential += charges(i,0) / distance;
potential += charges(i, 0) / distance;
}
}

Expand All @@ -52,12 +52,13 @@ Array<double> ChargeModel::potentials(Core::Molecule& mol,
// This is naive and slow, but can be re-implemented by methods
// for batching
Array<double> potentials(points.size(), 0.0);
for(unsigned int i = 0; i < points.size(); ++i)
for (unsigned int i = 0; i < points.size(); ++i)
potentials[i] = potential(mol, points[i]);
return potentials;
}

void ChargeModel::appendError(const std::string& errorString, bool newLine) const
void ChargeModel::appendError(const std::string& errorString,
bool newLine) const
{
m_error += errorString;
if (newLine)
Expand Down
Loading

0 comments on commit f26fc97

Please sign in to comment.