From 2d18e252612edecd4116553bdcf5e96fdb08ab33 Mon Sep 17 00:00:00 2001 From: Ben Webb Date: Mon, 16 Nov 2020 16:27:24 -0800 Subject: [PATCH] Squashed 'modules/pmi/' changes from 6473c8307f..d722206661 d722206661 Only make things flexible if asked for 10646dc022 Work around cmake 3.18.3 bug 625dca7985 Migrate to travis-ci.com git-subtree-dir: modules/pmi git-subtree-split: d7222066612e0a8bb11726345a88bf24a89e15a8 --- modules/pmi/CMakeLists.txt | 4 ++++ modules/pmi/README.md | 2 +- modules/pmi/pyext/src/macros.py | 15 +++++++-------- modules/pmi/test/test_topology_input.py | 12 +++++------- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/modules/pmi/CMakeLists.txt b/modules/pmi/CMakeLists.txt index c84d77f587..080d7ea834 100644 --- a/modules/pmi/CMakeLists.txt +++ b/modules/pmi/CMakeLists.txt @@ -7,6 +7,10 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) cmake_policy(SET CMP0058 NEW) endif(POLICY CMP0058) + if(POLICY CMP0053) + cmake_policy(SET CMP0053 NEW) + endif(POLICY CMP0053) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/tools) set(SWIG_EXECUTABLE swig CACHE STRING "Swig program") diff --git a/modules/pmi/README.md b/modules/pmi/README.md index 07cf7b2d37..8c36a29a68 100644 --- a/modules/pmi/README.md +++ b/modules/pmi/README.md @@ -1,6 +1,6 @@ \brief Python classes to represent, score, sample and analyze models. -[![Build Status](https://travis-ci.org/salilab/pmi.svg?branch=develop)](https://travis-ci.org/salilab/pmi) +[![Build Status](https://travis-ci.com/salilab/pmi.svg?branch=develop)](https://travis-ci.com/salilab/pmi) [![codecov](https://codecov.io/gh/salilab/pmi/branch/develop/graph/badge.svg)](https://codecov.io/gh/salilab/pmi) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bcced071b3f541449d723a774ea09026)](https://www.codacy.com/app/salilab/pmi?utm_source=github.com&utm_medium=referral&utm_content=salilab/pmi&utm_campaign=Badge_Grade) diff --git a/modules/pmi/pyext/src/macros.py b/modules/pmi/pyext/src/macros.py index f869efd8b8..3369ea80e2 100644 --- a/modules/pmi/pyext/src/macros.py +++ b/modules/pmi/pyext/src/macros.py @@ -757,15 +757,14 @@ def execute_macro(self, max_rb_trans=4.0, max_rb_rot=0.04, max_bead_trans=4.0, m if dname not in domains_in_rbs: if domain.pdb_file != "BEADS": warnings.warn( - "Making %s flexible. This will likely distort " - "the structure. It is strongly recommended to " - "make PDB domains rigid, or use BEADS instead " - "of a PDB file for flexible regions." % dname, - IMP.pmi.StructureWarning) - # Make both "atomic" (i.e. initialized from a PDB file) - # and "non-atomic" (i.e. beads) regions flexible + "No rigid bodies set for %s. Residues read from " + "the PDB file will not be sampled - only regions " + "missing from the PDB will be treated flexibly. " + "To sample the entire sequence, use BEADS instead " + "of a PDB file name" % dname, + IMP.pmi.StructureWarning) self.dof.create_flexible_beads( - self._domain_res[nstate][dname], + self._domain_res[nstate][dname][1], max_trans=max_bead_trans) # add super rigid bodies diff --git a/modules/pmi/test/test_topology_input.py b/modules/pmi/test/test_topology_input.py index b657c0283c..254d135b42 100644 --- a/modules/pmi/test/test_topology_input.py +++ b/modules/pmi/test/test_topology_input.py @@ -107,17 +107,15 @@ def test_flexible(self): with warnings.catch_warnings(record=True) as cw: warnings.simplefilter("always") root_hier, dof = bs.execute_macro() - # Both domains (one a PDB, one beads) should be flexible - # There should be 12 flexible beads: - # Residues 1, 2, 5, 6 (taken from the PDB file) + # Both domains (missing regions from PDB, one beads) should be flexible + # There should be 6 flexible beads: # Beads 3, 4, 7, 8, 9, 10 - # Resolution=10 fragments 1-2, 5-6 - self.assertEqual(len(dof.get_movers()), 12) + self.assertEqual(len(dof.get_movers()), 6) self.assertEqual(len(dof.get_rigid_bodies()), 0) - self.assertEqual(len(dof.get_flexible_beads()), 12) + self.assertEqual(len(dof.get_flexible_beads()), 6) # One warning should be emitted, for the PDB domain w, = cw - self.assertIn("Making Prot1..0 flexible. This will likely distort", + self.assertIn("No rigid bodies set for Prot1..0.", str(w.message)) self.assertIs(w.category, IMP.pmi.StructureWarning)