From 672b99c61ea3dbd23e618f28586d7399b0650558 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 8 Jan 2024 14:03:36 -0800 Subject: [PATCH 01/10] Add 2.20.1 version info --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 7329e21c3b..4e2200b98e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.20.0 +2.20.1 From d6a7331a62223a19bb2184fb8f061e8380e37f10 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 20 Dec 2023 13:19:29 -0800 Subject: [PATCH 02/10] Don't try to get elapsed time of a skipped test In Python 3.12.1, tests that are entirely skipped never called startTest(), so we can't calculate an elapsed time. Just report zero in this case. --- modules/test/pyext/src/__init__.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/test/pyext/src/__init__.py b/modules/test/pyext/src/__init__.py index 44cd9c1a4f..017ecc3869 100644 --- a/modules/test/pyext/src/__init__.py +++ b/modules/test/pyext/src/__init__.py @@ -801,14 +801,20 @@ def startTest(self, test): test.start_time = datetime.datetime.now() def _test_finished(self, test, state, detail=None): - delta = datetime.datetime.now() - test.start_time - try: - pv = delta.total_seconds() - except AttributeError: - pv = (float(delta.microseconds) - + (delta.seconds + delta.days * 24 * 3600) * 10**6) / 10**6 - if pv > 1: - self.stream.write("in %.3fs ... " % pv) + if hasattr(test, 'start_time'): + delta = datetime.datetime.now() - test.start_time + try: + pv = delta.total_seconds() + except AttributeError: + pv = (float(delta.microseconds) + + (delta.seconds + + delta.days * 24 * 3600) * 10**6) / 10**6 + if pv > 1: + self.stream.write("in %.3fs ... " % pv) + else: + # If entire test was skipped, startTest() may not have been + # called, in which case start_time won't be set + pv = 0 if detail is not None and not isinstance(detail, str): detail = self._exc_info_to_string(detail, test) test_doc = self.getDescription(test) From 500dcbdb076d3fab7534806213e4b7de2fb72636 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 21 Dec 2023 08:54:19 -0800 Subject: [PATCH 03/10] Make sure to get latest RMF --- tools/rpm/IMP-copr.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/rpm/IMP-copr.spec.in b/tools/rpm/IMP-copr.spec.in index 8176bb2977..95dd0043dc 100644 --- a/tools/rpm/IMP-copr.spec.in +++ b/tools/rpm/IMP-copr.spec.in @@ -82,7 +82,7 @@ BuildRequires: cmake >= 2.8 %global our_cmake cmake %endif BuildRequires: boost-devel >= 1.53 -BuildRequires: RMF-devel +BuildRequires: RMF-devel >= 1.6 %if 0%{?with_python3} BuildRequires: python3-ihm Requires: python3-ihm From ef2db5a56b0b0a62d8ba47c65021a150ebb58d53 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Sat, 23 Dec 2023 11:12:16 -0800 Subject: [PATCH 04/10] Get latest sampcon --- modules/sampcon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sampcon b/modules/sampcon index 29f2523277..f2974eb40f 160000 --- a/modules/sampcon +++ b/modules/sampcon @@ -1 +1 @@ -Subproject commit 29f252327772d218dcb4b76e0cf522493e2bb24c +Subproject commit f2974eb40fcc61b7581514e64f8e985dae299e43 From 618ae7a5ecb66fd2b6e134d9b7b4f7ca24cbde19 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 3 Jan 2024 11:14:50 -0800 Subject: [PATCH 05/10] Update copyright year --- README.md | 2 +- doc/manual/licenses.md | 2 +- modules/kernel/src/utility.cpp | 4 ++-- tools/debian/copyright | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 5aba1317a2..b518a54979 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ new shell. Copyright and License information ================================= -IMP is Copyright 2007-2023 IMP Inventors. The IMP Inventors are +IMP is Copyright 2007-2024 IMP Inventors. The IMP Inventors are Andrej Sali, Ben Webb, Daniel Russel, Keren Lasker, Dina Schneidman, Javier Velázquez-Muriel, Friedrich Förster, Elina Tjioe, Hao Fan, Seung Joong Kim, Yannick Spill, Riccardo Pellarin. diff --git a/doc/manual/licenses.md b/doc/manual/licenses.md index ab42a85cd4..3951f08b58 100644 --- a/doc/manual/licenses.md +++ b/doc/manual/licenses.md @@ -1,7 +1,7 @@ Copyright and licenses {#licenses} ====================== -%IMP is Copyright 2007-2023 %IMP Inventors. The %IMP Inventors are +%IMP is Copyright 2007-2024 %IMP Inventors. The %IMP Inventors are Andrej Sali, Ben Webb, Daniel Russel, Keren Lasker, Dina Schneidman, Javier Velázquez-Muriel, Friedrich Förster, Elina Tjioe, Hao Fan, Seung Joong Kim, Yannick Spill, Riccardo Pellarin. diff --git a/modules/kernel/src/utility.cpp b/modules/kernel/src/utility.cpp index 72e61ed45f..f164e324f4 100644 --- a/modules/kernel/src/utility.cpp +++ b/modules/kernel/src/utility.cpp @@ -2,7 +2,7 @@ * \file utility.cpp * \brief Various general useful functions for IMP. * - * Copyright 2007-2023 IMP Inventors. All rights reserved. + * Copyright 2007-2024 IMP Inventors. All rights reserved. * */ @@ -37,7 +37,7 @@ std::string get_unique_name(std::string name) { } std::string get_copyright() { - return "Copyright 2007-2023 IMP Inventors"; + return "Copyright 2007-2024 IMP Inventors"; } IMPKERNEL_END_NAMESPACE diff --git a/tools/debian/copyright b/tools/debian/copyright index c54b3e3b59..6743dc39be 100644 --- a/tools/debian/copyright +++ b/tools/debian/copyright @@ -2,7 +2,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: imp Source: https://integrativemodeling.org/ -Copyright: 2007-2023 IMP Inventors +Copyright: 2007-2024 IMP Inventors License: LGPL-2+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by From ce6b3ace43c5c5827fce88e67b9831858f081004 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Wed, 3 Jan 2024 11:15:31 -0800 Subject: [PATCH 06/10] Get latest sampcon --- modules/sampcon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/sampcon b/modules/sampcon index f2974eb40f..af5ae311b5 160000 --- a/modules/sampcon +++ b/modules/sampcon @@ -1 +1 @@ -Subproject commit f2974eb40fcc61b7581514e64f8e985dae299e43 +Subproject commit af5ae311b55af2236f6469a41428feb3afaf339e From ebe33d27ae980b269e04120458e83ef638847e53 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 4 Jan 2024 08:54:33 -0800 Subject: [PATCH 07/10] Don't use template parameter in method SWIG 4.2 substitutes the template parameters in template specializations, so will replace "D" here with "-1", resulting in invalid C++. Use a different variable name. --- modules/algebra/pyext/IMP_algebra.vector.i | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/algebra/pyext/IMP_algebra.vector.i b/modules/algebra/pyext/IMP_algebra.vector.i index 5fa4702cfb..c0c94e4888 100644 --- a/modules/algebra/pyext/IMP_algebra.vector.i +++ b/modules/algebra/pyext/IMP_algebra.vector.i @@ -103,21 +103,21 @@ IMP_SWIG_ALGEBRA_VALUE_D(IMP::algebra, Vector); %extend IMP::algebra::VectorD<-1> { double __getitem__(int index) const { - int D = self->get_dimension(); - if (index >= 0 && index < D) { + int dim = self->get_dimension(); + if (index >= 0 && index < dim) { return self->operator[](index); - } else if (index <= -1 && index >= -(D)) { - return self->operator[](index + D); + } else if (index <= -1 && index >= -(dim)) { + return self->operator[](index + dim); } else { throw IMP::IndexException("VectorD index out of range"); } } void __setitem__(int index, double val) { - int D = self->get_dimension(); - if (index >= 0 && index < D) { + int dim = self->get_dimension(); + if (index >= 0 && index < dim) { self->operator[](index) = val; - } else if (index <= -1 && index >= -(D)) { - self->operator[](index + D) = val; + } else if (index <= -1 && index >= -(dim)) { + self->operator[](index + dim) = val; } else { throw IMP::IndexException("VectorD assignment index out of range"); } From d4c666717740b6285f8ac0b9699c6ab2936d1e72 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 4 Jan 2024 08:58:12 -0800 Subject: [PATCH 08/10] Remove namespace from %templates SWIG 4.2 will complain about incorrect scope for %template instantiations if we wrap them in a namespace. Fully qualify the class names instead. --- modules/algebra/pyext/swig.i-in | 20 ++++++++------------ modules/atom/pyext/swig.i-in | 25 +++++++++---------------- modules/core/pyext/swig.i-in | 17 ++++++----------- modules/em2d/pyext/swig.i-in | 20 ++++++++------------ 4 files changed, 31 insertions(+), 51 deletions(-) diff --git a/modules/algebra/pyext/swig.i-in b/modules/algebra/pyext/swig.i-in index 6fb55e1ec2..3e3ddd3064 100644 --- a/modules/algebra/pyext/swig.i-in +++ b/modules/algebra/pyext/swig.i-in @@ -235,21 +235,17 @@ IMP_SWIG_ALGEBRA_FUNCTION_DS_D(Vector, get_vertices, UnitSimplex); IMP_SWIG_ALGEBRA_FUNCTION_D_DD(Vector, get_increasing_from_embedded, UnitSimplex, Vector); IMP_SWIG_ALGEBRA_FUNCTION_D_DD(Vector, get_embedded_from_increasing, UnitSimplex, Vector); -namespace IMP { - namespace algebra { - %template(_AxisAnglePair) ::std::pair,double>; +%template(_AxisAnglePair) std::pair,double>; - %template(get_transformation_aligning_first_to_second) get_transformation_aligning_first_to_second >, IMP::Vector > >; - // rotation operations +%template(get_transformation_aligning_first_to_second) IMP::algebra::get_transformation_aligning_first_to_second >, IMP::Vector > >; - %template(_RotatedVector3DAdjoint) ::std::pair,IMP::algebra::VectorD<4> >; - %template(_ComposeRotation3DAdjoint) ::std::pair,IMP::algebra::VectorD<4> >; +// rotation operations +%template(_RotatedVector3DAdjoint) std::pair,IMP::algebra::VectorD<4> >; +%template(_ComposeRotation3DAdjoint) std::pair,IMP::algebra::VectorD<4> >; - %template(_Transformation3DAdjoint) ::std::pair,IMP::algebra::VectorD<3> >; - %template(_TransformedVector3DAdjoint) ::std::pair,std::pair,IMP::algebra::VectorD<3> > >; - %template(_ComposeTransformation3DAdjoint) ::std::pair,IMP::algebra::VectorD<3> >,std::pair,IMP::algebra::VectorD<3> > >; - } -} +%template(_Transformation3DAdjoint) std::pair,IMP::algebra::VectorD<3> >; +%template(_TransformedVector3DAdjoint) std::pair,std::pair,IMP::algebra::VectorD<3> > >; +%template(_ComposeTransformation3DAdjoint) std::pair,IMP::algebra::VectorD<3> >,std::pair,IMP::algebra::VectorD<3> > >; %inline %{ double get_rmsd_transforming_first(IMP::algebra::Transformation3D tr, diff --git a/modules/atom/pyext/swig.i-in b/modules/atom/pyext/swig.i-in index d8d02d220f..303605b6f9 100644 --- a/modules/atom/pyext/swig.i-in +++ b/modules/atom/pyext/swig.i-in @@ -247,24 +247,17 @@ IMP_SWIG_NESTED_SEQUENCE_TYPEMAP(IMP::atom::AtomType, IMP::atom::AtomTypes, IMP: %template(_ALoopStatisticalBase) IMP::score_functor::DistancePairScore; %template(_BLoopStatisticalBase) IMP::score_functor::DistancePairScore< IMP::score_functor::Statistical< IMP::atom::LoopStatisticalType,false,true,false > >; %template(_OrientedSoapBase) IMP::score_functor::DistancePairScoreWithCache; -namespace IMP { - namespace atom { - %template(_SPSFTB) ::IMP::score_functor::DistancePairScore >; - %template(_SPSTF) ::IMP::core::StatisticalPairScore< IMP::atom::ProteinLigandType, true, false>; - %template(_SPSFT) ::IMP::core::StatisticalPairScore< IMP::atom::DopeType, false, true>; - %template(_SPSFTL) ::IMP::core::StatisticalPairScore< IMP::atom::LoopStatisticalType, false, true>; - } -} +%template(_SPSFTB) ::IMP::score_functor::DistancePairScore >; +%template(_SPSTF) ::IMP::core::StatisticalPairScore< IMP::atom::ProteinLigandType, true, false>; +%template(_SPSFT) ::IMP::core::StatisticalPairScore< IMP::atom::DopeType, false, true>; +%template(_SPSFTL) ::IMP::core::StatisticalPairScore< IMP::atom::LoopStatisticalType, false, true>; %include "IMP/atom/protein_ligand_score.h" -namespace IMP { - namespace atom { - // swig has random, perplexing issues if these are higher in the file - %template(AtomType) ::IMP::Key; - %template(ResidueType) ::IMP::Key; - %template(ChainType) ::IMP::Key; - } -} +// swig has random, perplexing issues if these are higher in the file +%template(AtomType) ::IMP::Key; +%template(ResidueType) ::IMP::Key; +%template(ChainType) ::IMP::Key; + %include "IMP/atom/element.h" %include "IMP/atom/Atom.h" %include "IMP/atom/Residue.h" diff --git a/modules/core/pyext/swig.i-in b/modules/core/pyext/swig.i-in index 66c71046b5..406f480fc1 100644 --- a/modules/core/pyext/swig.i-in +++ b/modules/core/pyext/swig.i-in @@ -379,17 +379,12 @@ IMP::Restraint *create_restraint(IMP::PairScore *ps, IMP::ParticlePair pp) { } %} -namespace IMP { - namespace core { - %template(TruncatedHarmonicLowerBound) ::IMP::core::TruncatedHarmonic; - %template(TruncatedHarmonicUpperBound) ::IMP::core::TruncatedHarmonic; - %template(TruncatedHarmonicBound) ::IMP::core::TruncatedHarmonic; - // swig screws up on scopes, I can't be bothered to fix it - //%template(show_named_hierarchy) show<::IMP::core::Name>; - %template(ParticleType) ::IMP::Key; - - } -} +%template(TruncatedHarmonicLowerBound) ::IMP::core::TruncatedHarmonic; +%template(TruncatedHarmonicUpperBound) ::IMP::core::TruncatedHarmonic; +%template(TruncatedHarmonicBound) ::IMP::core::TruncatedHarmonic; +// swig screws up on scopes, I can't be bothered to fix it +//%template(show_named_hierarchy) show<::IMP::core::Name>; +%template(ParticleType) ::IMP::Key; IMP_SWIG_GENERIC_OBJECT_TEMPLATE(IMP::core, AttributeSingletonScore, generic_attribute_singleton_score, UnaryFunction); IMP_SWIG_GENERIC_OBJECT_TEMPLATE(IMP::core, BoundingBox3DSingletonScore, bounding_box_3d_singleton_score, UnaryFunction); diff --git a/modules/em2d/pyext/swig.i-in b/modules/em2d/pyext/swig.i-in index 56b9c0e61f..e961444064 100644 --- a/modules/em2d/pyext/swig.i-in +++ b/modules/em2d/pyext/swig.i-in @@ -99,22 +99,18 @@ IMP_SWIG_DECORATOR(IMP::em2d, ProjectionParameters, ProjectionParametersList); // %include "IMP/em2d/TemplateFinder.h" -namespace IMP { - namespace em2d { - %template(ResultAlign2D) - ::std::pair< IMP::algebra::Transformation2D,double >; +%template(ResultAlign2D) + ::std::pair< IMP::algebra::Transformation2D,double >; // %template(VectorOfInts) ::std::vector< IMP::Ints >; // %template(VectorOfFloats) ::std::vector< IMP::Floats >; - %template(_do_hierarchical_clustering_single_linkage) - ::IMP::em2d::do_hierarchical_agglomerative_clustering; - %template(_do_hierarchical_clustering_complete_linkage) - ::IMP::em2d::do_hierarchical_agglomerative_clustering; - %template(_do_hierarchical_clustering_average_distance_linkage) - ::IMP::em2d::do_hierarchical_agglomerative_clustering; - } -} +%template(_do_hierarchical_clustering_single_linkage) + ::IMP::em2d::do_hierarchical_agglomerative_clustering; +%template(_do_hierarchical_clustering_complete_linkage) + ::IMP::em2d::do_hierarchical_agglomerative_clustering; +%template(_do_hierarchical_clustering_average_distance_linkage) + ::IMP::em2d::do_hierarchical_agglomerative_clustering; %pythoncode %{ do_hierarchical_clustering_single_linkage = _do_hierarchical_clustering_single_linkage From 070e1f6c2cf07bfc4b9d226bfe85d165658059b4 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Thu, 4 Jan 2024 17:49:46 -0800 Subject: [PATCH 09/10] Fix oriented soap_score crash with multiple models We call the SOAP score directly and not via a scoring function, so don't update the Model (and its caches). This causes a crash due to using invalid cached data when using multiple models read from a file. Call Model.update() ourselves to fix this. --- modules/integrative_docking/src/internal/soap_score.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/integrative_docking/src/internal/soap_score.cpp b/modules/integrative_docking/src/internal/soap_score.cpp index 2d24b30c26..1c613250ca 100644 --- a/modules/integrative_docking/src/internal/soap_score.cpp +++ b/modules/integrative_docking/src/internal/soap_score.cpp @@ -81,6 +81,9 @@ double oriented_soap_score(const IMP::score_functor::OrientedSoap* soap_score, grid[grid_index].push_back(j); } + // Since we are not using a ScoringFunction we must update the Model + // ourselves so that everything is up to date (e.g. caches) + model->update(); // score soap_score->check_cache_valid(model); double score = 0.0; @@ -122,6 +125,10 @@ double oriented_soap_score(const IMP::score_functor::OrientedSoap* soap_score, coordinates.push_back(IMP::core::XYZ(model, pis[i]).get_coordinates()); } + // Since we are not using a ScoringFunction we must update the Model + // ourselves so that everything is up to date (e.g. caches) + model->update(); + soap_score->check_cache_valid(model); float distance_threshold = soap_score->get_distance_threshold(); float distance_threshold2 = distance_threshold * distance_threshold; From 1423e5dc13c522c7b935b7549e729afd4ba16c89 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 8 Jan 2024 14:01:34 -0800 Subject: [PATCH 10/10] Prepare for 2.20.1 release --- ChangeLog.md | 6 ++++++ tools/rpm/IMP-copr.spec.in | 3 +++ tools/rpm/IMP.spec.in | 3 +++ 3 files changed, 12 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 7cc5858a06..6e5de0923c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,6 +1,12 @@ ChangeLog {#changelog} ========= +# 2.20.1 - 2024-01-16 # {#changelog_2_20_1} +- Bugfix: fix `soap_score` crash when scoring multiple models with an + orientation-dependent SOAP score. +- Bugfix: allow building with SWIG 4.2. +- Bugfix: various fixes for Python 3.12. + # 2.20.0 - 2023-12-21 # {#changelog_2_20_0} - The Windows .exe installer now supports Python 3.7 through 3.12. - RPM packages for IMP for RedHat Linux (and clones such as Alma or Rocky) diff --git a/tools/rpm/IMP-copr.spec.in b/tools/rpm/IMP-copr.spec.in index 95dd0043dc..a141795f09 100644 --- a/tools/rpm/IMP-copr.spec.in +++ b/tools/rpm/IMP-copr.spec.in @@ -514,6 +514,9 @@ export PYTHONPATH=%{buildroot}%{_libdir}/python${py2_ver}/site-packages %endif %changelog +* Tue Jan 16 2024 Ben Webb 2.20.1-1 +- 2.20.1 release. + * Thu Dec 21 2023 Ben Webb 2.20.0-1 - 2.20.0 release. diff --git a/tools/rpm/IMP.spec.in b/tools/rpm/IMP.spec.in index e99098ad10..a9ba5d4d28 100644 --- a/tools/rpm/IMP.spec.in +++ b/tools/rpm/IMP.spec.in @@ -539,6 +539,9 @@ find ${RPM_BUILD_ROOT}%{_prefix}/share/IMP/tools -name '*.py' -exec perl -pi -e %endif %changelog +* Tue Jan 16 2024 Ben Webb 2.20.1-1 +- 2.20.1 release. + * Thu Dec 21 2023 Ben Webb 2.20.0-1 - 2.20.0 release.