[med-svn] [libbpp-phyl] 01/01: Added patch to remove deprecation warnings.

Julien Dutheil jdutheil-guest at moszumanska.debian.org
Fri Jul 14 12:08:34 UTC 2017


This is an automated email from the git hooks/post-receive script.

jdutheil-guest pushed a commit to branch master
in repository libbpp-phyl.

commit dc0e95c149ecda048f87cd1facb48522800fb8c9
Author: Julien Y. Dutheil <dutheil at evolbio.mpg.de>
Date:   Fri Jul 14 14:07:02 2017 +0200

    Added patch to remove deprecation warnings.
    
    These warnings, generated in loops, might explain why some unit tests
    were failing because of timeout.
---
 debian/patches/remove_deprecated_warnings.patch | 106 ++++++++++++++++++++++++
 debian/patches/series                           |   1 +
 2 files changed, 107 insertions(+)

diff --git a/debian/patches/remove_deprecated_warnings.patch b/debian/patches/remove_deprecated_warnings.patch
new file mode 100644
index 0000000..d8f89f3
--- /dev/null
+++ b/debian/patches/remove_deprecated_warnings.patch
@@ -0,0 +1,106 @@
+diff --git a/src/Bpp/Phyl/Likelihood/AbstractNonHomogeneousTreeLikelihood.h b/src/Bpp/Phyl/Likelihood/AbstractNonHomogeneousTreeLikelihood.h
+index cc1b85a..1bf7a5b 100644
+--- a/src/Bpp/Phyl/Likelihood/AbstractNonHomogeneousTreeLikelihood.h
++++ b/src/Bpp/Phyl/Likelihood/AbstractNonHomogeneousTreeLikelihood.h
+@@ -74,7 +74,7 @@ class AbstractNonHomogeneousTreeLikelihood:
+           siteModelDescriptions_(), index_(0), nbModels_(modelSet->getNumberOfModels())
+         {
+           for (size_t i = 0; i < nbModels_; ++i)
+-            siteModelDescriptions_.push_back(ConstNoPartitionSiteModelDescription(modelSet->getModel(i), modelSet->getNodesWithModel(i)));        
++            siteModelDescriptions_.push_back(ConstNoPartitionSiteModelDescription(modelSet->getSubstitutionModel(i), modelSet->getNodesWithModel(i)));        
+         }
+ 
+       public:
+diff --git a/src/Bpp/Phyl/Likelihood/DRNonHomogeneousTreeLikelihood.cpp b/src/Bpp/Phyl/Likelihood/DRNonHomogeneousTreeLikelihood.cpp
+index dafd301..ccf34e8 100644
+--- a/src/Bpp/Phyl/Likelihood/DRNonHomogeneousTreeLikelihood.cpp
++++ b/src/Bpp/Phyl/Likelihood/DRNonHomogeneousTreeLikelihood.cpp
+@@ -142,7 +142,7 @@ void DRNonHomogeneousTreeLikelihood::setData(const SiteContainer& sites) throw (
+   data_ = PatternTools::getSequenceSubset(sites, *tree_->getRootNode());
+   if (verbose_)
+     ApplicationTools::displayTask("Initializing data structure");
+-  likelihoodData_->initLikelihoods(*data_, *modelSet_->getModel(0)); // We assume here that all models have the same number of states, and that they have the same 'init' method,
++  likelihoodData_->initLikelihoods(*data_, *modelSet_->getSubstitutionModel(0)); // We assume here that all models have the same number of states, and that they have the same 'init' method,
+                                                                      // Which is a reasonable assumption as long as they share the same alphabet.
+   if (verbose_)
+     ApplicationTools::displayTaskDone();
+diff --git a/src/Bpp/Phyl/Likelihood/RNonHomogeneousTreeLikelihood.cpp b/src/Bpp/Phyl/Likelihood/RNonHomogeneousTreeLikelihood.cpp
+index f736bf4..05a4c8c 100644
+--- a/src/Bpp/Phyl/Likelihood/RNonHomogeneousTreeLikelihood.cpp
++++ b/src/Bpp/Phyl/Likelihood/RNonHomogeneousTreeLikelihood.cpp
+@@ -140,7 +140,7 @@ void RNonHomogeneousTreeLikelihood::setData(const SiteContainer& sites) throw (E
+   if (data_) delete data_;
+   data_ = PatternTools::getSequenceSubset(sites, *tree_->getRootNode());
+   if (verbose_) ApplicationTools::displayTask("Initializing data structure");
+-  likelihoodData_->initLikelihoods(*data_, *modelSet_->getModel(0)); //We assume here that all models have the same number of states, and that they have the same 'init' method,
++  likelihoodData_->initLikelihoods(*data_, *modelSet_->getSubstitutionModel(0)); //We assume here that all models have the same number of states, and that they have the same 'init' method,
+                                                                      //Which is a reasonable assumption as long as they share the same alphabet.
+   if (verbose_) ApplicationTools::displayTaskDone();
+ 
+diff --git a/src/Bpp/Phyl/Model/SubstitutionModelSet.h b/src/Bpp/Phyl/Model/SubstitutionModelSet.h
+index fbb6b3c..97a027b 100644
+--- a/src/Bpp/Phyl/Model/SubstitutionModelSet.h
++++ b/src/Bpp/Phyl/Model/SubstitutionModelSet.h
+@@ -247,7 +247,6 @@ public:
+    * @param i Index of the model in the set.
+    * @return A pointer toward the corresponding model.
+    */
+-  
+   const SubstitutionModel* getModel(size_t i) const throw (IndexOutOfBoundsException)
+   {
+     std::cerr << "#warning : SubstitutionModelSet::getModel function is deprecated in Bio++ 2.3.0. Replace it with SubstitutionModelSet::getSubstitutionModel." << std::endl;
+diff --git a/test/test_likelihood_nh.cpp b/test/test_likelihood_nh.cpp
+index b4cd485..1486b80 100644
+--- a/test/test_likelihood_nh.cpp
++++ b/test/test_likelihood_nh.cpp
+@@ -129,11 +129,11 @@ int main() {
+     cout << c1 << ": " << tl.getValue() << "\t" << c2 << ": " << tl2.getValue() << endl;
+       
+     for (size_t i = 0; i < nmodels; ++i) {
+-      cout << modelSet2->getModel(i)->getParameter("theta").getValue() << "\t" << modelSet3->getModel(i)->getParameter("theta").getValue() << endl;
+-      //if (abs(modelSet2->getModel(i)->getParameter("theta").getValue() - modelSet3->getModel(i)->getParameter("theta").getValue()) > 0.1)
++      cout << modelSet2->getSubstitutionModel(i)->getParameter("theta").getValue() << "\t" << modelSet3->getSubstitutionModel(i)->getParameter("theta").getValue() << endl;
++      //if (abs(modelSet2->getSubstitutionModel(i)->getParameter("theta").getValue() - modelSet3->getSubstitutionModel(i)->getParameter("theta").getValue()) > 0.1)
+       //  return 1;
+-      thetasEst1[i] +=  modelSet2->getModel(i)->getParameter("theta").getValue();
+-      thetasEst2[i] +=  modelSet3->getModel(i)->getParameter("theta").getValue();
++      thetasEst1[i] +=  modelSet2->getSubstitutionModel(i)->getParameter("theta").getValue();
++      thetasEst2[i] +=  modelSet3->getSubstitutionModel(i)->getParameter("theta").getValue();
+     }
+   }
+   thetasEst1 /= static_cast<double>(nrep);
+diff --git a/test/test_simulations.cpp b/test/test_simulations.cpp
+index fa97a9c..f4fea6c 100644
+--- a/test/test_simulations.cpp
++++ b/test/test_simulations.cpp
+@@ -104,8 +104,8 @@ int main() {
+ 
+   //Now compare estimated values to real ones:
+   for (size_t i = 0; i < thetas.size(); ++i) {
+-    cout << thetas[i] << "\t" << modelSet2->getModel(i)->getParameter("theta").getValue() << endl;
+-    double diff = abs(thetas[i] - modelSet2->getModel(i)->getParameter("theta").getValue());
++    cout << thetas[i] << "\t" << modelSet2->getSubstitutionModel(i)->getParameter("theta").getValue() << endl;
++    double diff = abs(thetas[i] - modelSet2->getSubstitutionModel(i)->getParameter("theta").getValue());
+     if (diff > 0.1)
+       return 1;
+   }
+@@ -119,7 +119,7 @@ int main() {
+   VectorSiteContainer sites2(seqNames, alphabet);
+   for (unsigned int i = 0; i < n; ++i) {
+     RASiteSimulationResult* result = simulator.dSimulateSite();
+-    unique_ptr<Site> site(result->getSite(*simulator.getSubstitutionModelSet()->getModel(0)));
++    unique_ptr<Site> site(result->getSite(*simulator.getSubstitutionModelSet()->getSubstitutionModel(0)));
+     site->setPosition(static_cast<int>(i));
+     sites2.addSite(*site, false);
+     delete result;
+@@ -136,8 +136,8 @@ int main() {
+ 
+   //Now compare estimated values to real ones:
+   for (size_t i = 0; i < thetas.size(); ++i) {
+-    cout << thetas[i] << "\t" << modelSet3->getModel(i)->getParameter("theta").getValue() << endl;
+-    double diff = abs(thetas[i] - modelSet3->getModel(i)->getParameter("theta").getValue());
++    cout << thetas[i] << "\t" << modelSet3->getSubstitutionModel(i)->getParameter("theta").getValue() << endl;
++    double diff = abs(thetas[i] - modelSet3->getSubstitutionModel(i)->getParameter("theta").getValue());
+     if (diff > 0.1)
+       return 1;
+   }
diff --git a/debian/patches/series b/debian/patches/series
index 0bc967d..771eb4d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 relax_test_timeout.patch
 0001-Decreased-threshold-for-application-to-a-broader-ran.patch
 0002-Fixed-unit-tests-compilation-on-some-platforms.patch
+remove_deprecated_warnings.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/libbpp-phyl.git



More information about the debian-med-commit mailing list