mirror of
https://github.com/PDB-REDO/dssp.git
synced 2026-06-04 13:44:21 +08:00
Require boost 1.84 or higher for numpy 2
Fix interface to be more compliant with standard concepts
This commit is contained in:
@@ -29,7 +29,9 @@ if(CMAKE_VERSION GREATER_EQUAL 3.30)
|
||||
endif()
|
||||
|
||||
find_package(Python REQUIRED COMPONENTS Interpreter Development)
|
||||
find_package(Boost 1.83 QUIET COMPONENTS python)
|
||||
|
||||
# Boost 1.84 is required since it contains code required to use numpy 2.x
|
||||
find_package(Boost 1.84 QUIET COMPONENTS python)
|
||||
|
||||
if(NOT Boost_FOUND)
|
||||
# boost is a huge project and directly downloading the 'alternate release'
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include <Python.h>
|
||||
|
||||
#include <dssp.hpp>
|
||||
#include <memory>
|
||||
|
||||
struct statistics_wrapper
|
||||
{
|
||||
@@ -42,7 +43,7 @@ class dssp_wrapper
|
||||
std::istream is(&buffer);
|
||||
|
||||
auto f = cif::pdb::read(is);
|
||||
m_dssp.reset(new dssp(f.front(), model_nr, min_poly_proline_stretch_length, calculateSurfaceAccessibility));
|
||||
m_dssp = std::make_shared<dssp>(f.front(), model_nr, min_poly_proline_stretch_length, calculateSurfaceAccessibility);
|
||||
}
|
||||
|
||||
dssp_wrapper(const dssp_wrapper &) = default;
|
||||
@@ -83,7 +84,7 @@ class dssp_wrapper
|
||||
iterator(const iterator &i) = default;
|
||||
iterator &operator=(const iterator &i) = default;
|
||||
|
||||
reference operator*() { return residue_info_handle(m_current); }
|
||||
reference operator*() { return {m_current}; }
|
||||
pointer operator->() { return &m_current; }
|
||||
|
||||
iterator &operator++()
|
||||
@@ -126,12 +127,12 @@ class dssp_wrapper
|
||||
// Custom exceptions
|
||||
struct AttributeError : std::exception
|
||||
{
|
||||
const char *what() const throw() { return "AttributeError exception"; }
|
||||
[[nodiscard]] const char *what() const noexcept override { return "AttributeError exception"; }
|
||||
};
|
||||
|
||||
struct TypeError : std::exception
|
||||
{
|
||||
const char *what() const throw() { return "TypeError exception"; }
|
||||
[[nodiscard]] const char *what() const noexcept override { return "TypeError exception"; }
|
||||
};
|
||||
|
||||
// Set python exceptions
|
||||
|
||||
Reference in New Issue
Block a user