Skip to content

Commit

Permalink
Merge branch 'devel' into feature_emle
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jul 5, 2024
2 parents dd24ebf + f23de21 commit e51017c
Show file tree
Hide file tree
Showing 356 changed files with 7,427 additions and 1,048 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/choose_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,21 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the desired branch
run: git clone https://github.com/${{ env.REPO }} -b ${{ github.event.inputs.branch }} sire
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging pip-requirements-parser
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
#
- name: Upload Conda package
# Maybe add the logic here that this is a dev package?
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,21 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the devel branch (push to devel)
run: git clone https://github.com/${{ env.REPO }} sire
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging pip-requirements-parser
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
#
- name: Upload Conda package
# Maybe add the logic here that this is a dev package?
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
- { name: "windows", os: "windows-latest", shell: "pwsh" }
- { name: "linux", os: "ubuntu-latest", shell: "bash -l {0}" }
- { name: "macos", os: "macos-latest", shell: "bash -l {0}" }
exclude:
- platform:
{ name: "macos", os: "macos-latest", shell: "bash -l {0}" }
python-version: "3.12" # MacOS can't run 3.12 yet...
environment:
name: sire-build
defaults:
Expand All @@ -50,23 +46,21 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the main branch (push to main)
run: git clone -b main https://github.com/openbiosim/sire sire
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging pip-requirements-parser
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
#
- name: Upload Conda package
# upload to the 'test' channel
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,18 @@ jobs:
python-version: ${{ matrix.python-version }}
activate-environment: sire_build
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true
#
- name: Clone the feature branch (pull request to devel)
run: git clone -b ${{ github.head_ref }} --single-branch https://github.com/${{ env.REPO }} sire
#
- name: Setup Conda
run: mamba install -y -c conda-forge boa anaconda-client packaging pip-requirements-parser
run: conda install -y -c conda-forge conda-build boa anaconda-client packaging pip-requirements-parser
#
- name: Update Conda recipe
run: python ${{ github.workspace }}/sire/actions/update_recipe.py
#
- name: Prepare build location
run: mkdir ${{ github.workspace }}/build
#
- name: Build Conda package using mamba build
run: conda mambabuild -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
- name: Build Conda package using conda build
run: conda build -c conda-forge -c openbiosim/label/dev ${{ github.workspace }}/sire/recipes/sire
34 changes: 23 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@
`Sire <https://sire.openbiosim.org>`__
======================================

.. image:: https://github.com/openbiosim/sire/workflows/Build/badge.svg
:target: https://github.com/openbiosim/sire/actions?query=workflow%3ABuild
:alt: Build status

.. image:: https://anaconda.org/openbiosim/sire/badges/downloads.svg
:target: https://anaconda.org/openbiosim/sire
:alt: Downloads

.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
:target: https://www.gnu.org/licenses/gpl-3.0.en.html
:alt: License
Citation
========

If you use sire in your work, please cite the
`following paper <https://doi.org/10.1063/5.0200458>`__:

.. code-block:: bibtex
@article{10.1063/5.0200458,
author = {Woods, Christopher J. and Hedges, Lester O. and Mulholland, Adrian J. and Malaisree, Maturos and Tosco, Paolo and Loeffler, Hannes H. and Suruzhon, Miroslav and Burman, Matthew and Bariami, Sofia and Bosisio, Stefano and Calabro, Gaetano and Clark, Finlay and Mey, Antonia S. J. S. and Michel, Julien},
title = "{Sire: An interoperability engine for prototyping algorithms and exchanging information between molecular simulation programs}",
journal = {The Journal of Chemical Physics},
volume = {160},
number = {20},
pages = {202503},
year = {2024},
month = {05},
abstract = "{Sire is a Python/C++ library that is used both to prototype new algorithms and as an interoperability engine for exchanging information between molecular simulation programs. It provides a collection of file parsers and information converters that together make it easier to combine and leverage the functionality of many other programs and libraries. This empowers researchers to use sire to write a single script that can, for example, load a molecule from a PDBx/mmCIF file via Gemmi, perform SMARTS searches via RDKit, parameterize molecules using BioSimSpace, run GPU-accelerated molecular dynamics via OpenMM, and then display the resulting dynamics trajectory in a NGLView Jupyter notebook 3D molecular viewer. This functionality is built on by BioSimSpace, which uses sire’s molecular information engine to interconvert with programs such as GROMACS, NAMD, Amber, and AmberTools for automated molecular parameterization and the running of molecular dynamics, metadynamics, and alchemical free energy workflows. Sire comes complete with a powerful molecular information search engine, plus trajectory loading and editing, analysis, and energy evaluation engines. This, when combined with an in-built computer algebra system, gives substantial flexibility to researchers to load, search for, edit, and combine molecular information from multiple sources and use that to drive novel algorithms by combining functionality from other programs. Sire is open source (GPL3) and is available via conda and at a free Jupyter notebook server at https://try.openbiosim.org. Sire is supported by the not-for-profit OpenBioSim community interest company.}",
issn = {0021-9606},
doi = {10.1063/5.0200458},
url = {https://doi.org/10.1063/5.0200458},
eprint = {https://pubs.aip.org/aip/jcp/article-pdf/doi/10.1063/5.0200458/19969848/202503\_1\_5.0200458.pdf},
}
About
=====
Expand Down
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

As we have limited resource, we only support the latest major release
of sire with security updates. For example, if the current version
is 2023.5.0, then only versions 2023.5.0 to 2023.5.X wil have updates,
which will be released as 2023.5.X+1.
is 2024.1.0, then only versions 2024.1.0 to 2024.1.X wil have updates,
which will be released as 2024.1.X+1.

| Version | Supported |
| ------- | ------------------ |
| 2023.5.x | :white_check_mark: |
| < 2023.5.x| :x: |
| 2024.1.x | :white_check_mark: |
| < 2024.1.x| :x: |

## Reporting a Vulnerability

Expand Down
2 changes: 1 addition & 1 deletion corelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ elseif (MSVC)

set ( SIRE_SMALL_FLAGS "/O1" )
set ( SIRE_WARNALL_FLAGS "" )
set ( SIRE_RELEASE_FLAGS "/O2 /GL /Gw" )
set ( SIRE_RELEASE_FLAGS "/O2 /GL /Gw /D_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING" )
set ( SIRE_DEBUG_FLAGS "/Zi" )
set ( SIRE_VISIBILITY_FLAGS "/DSIRE_NO_VISIBILITY_AVAILABLE" )
GET_SIRE_VECTOR_FLAGS( "/openmp:experimental" "/arch:SSE2" "/arch:AVX" "/arch:AVX512" "/arch:NEON" )
Expand Down
4 changes: 4 additions & 0 deletions corelib/src/libs/SireBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ set ( SIREBASE_HEADERS
array2d.hpp
array2d.h
arrayproperty.hpp
atexit.h
booleanproperty.h
chunkedhash.hpp
chunkedvector.hpp
Expand All @@ -46,6 +47,7 @@ set ( SIREBASE_HEADERS
packedarray2d.h
packedarray2d.hpp
packedarrays.h
pagecache.h
pairmatrix.hpp
range.h
ranges.h
Expand Down Expand Up @@ -84,6 +86,7 @@ set ( SIREBASE_SOURCES

array2d.cpp
arrayproperty.cpp
atexit.cpp
booleanproperty.cpp
chunkedhash.cpp
chunkedvector.cpp
Expand All @@ -103,6 +106,7 @@ set ( SIREBASE_SOURCES
meminfo.cpp
numberproperty.cpp
packedarray2d.cpp
pagecache.cpp
parallel.cpp
process.cpp
progressbar.cpp
Expand Down
60 changes: 60 additions & 0 deletions corelib/src/libs/SireBase/atexit.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/********************************************\
*
* Sire - Molecular Simulation Framework
*
* Copyright (C) 2024 Christopher Woods
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For full details of the license please see the COPYING file
* that should have come with this distribution.
*
* You can contact the authors via the website
* at https://sire.openbiosim.org
*
\*********************************************/

#include "SireBase/atexit.h"

#include <vector>

#include <QDebug>

namespace SireBase
{
std::vector<std::function<void()>> clean_up_functions;

void clean_up()
{
for (auto &func : clean_up_functions)
{
try
{
func();
}
catch (...)
{
// we can't raise exceptions now, and shouldn't
// print anything, so just fail silently
}
}
}

void register_clean_up_function(std::function<void()> func)
{
clean_up_functions.push_back(func);
}

} // namespace SireBase
81 changes: 81 additions & 0 deletions corelib/src/libs/SireBase/atexit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/********************************************\
*
* Sire - Molecular Simulation Framework
*
* Copyright (C) 2024 Christopher Woods
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* For full details of the license please see the COPYING file
* that should have come with this distribution.
*
* You can contact the authors via the website
* at https://sire.openbiosim.org
*
\*********************************************/

#ifndef SIREBASE_ATEXIT_H
#define SIREBASE_ATEXIT_H

#include "sireglobal.h"

#include <functional>

SIRE_BEGIN_HEADER

namespace SireBase
{
SIREBASE_EXPORT void clean_up();

SIREBASE_EXPORT void register_clean_up_function(std::function<void()> func);

/** This class makes it easier to register a function to be called
* when the program exits. This is useful for cleaning up resources
* that are allocated during the program's execution.
*
* Simply define your function (should be void func() { ... }) and
* then create a static instance of this class with the function as the
* argument. The constructor will be called at library load
* (static initialisation) and the function will be registered to be
* called at exit.
*
* e.g.
*
* void my_exit_function()
* {
* // clean up code here
* }
*
* static RegisterExitFunction my_exit_function_instance(my_exit_function);
*
*/
class SIREBASE_EXPORT RegisterExitFunction
{
public:
RegisterExitFunction(std::function<void()> func)
{
SireBase::register_clean_up_function(func);
}

~RegisterExitFunction() {}
};

} // namespace SireBase

SIRE_EXPOSE_FUNCTION(SireBase::clean_up);

SIRE_END_HEADER

#endif
Loading

0 comments on commit e51017c

Please sign in to comment.