From f5df737536a5c85729e65d60b72050f2ae031e30 Mon Sep 17 00:00:00 2001 From: Stefan Bienert <stefan.bienert@unibas.ch> Date: Tue, 2 Aug 2011 15:34:00 +0200 Subject: [PATCH] Changed names ChainType and Chaindescription to Type and Description for chains --- modules/io/tests/test_mmcif_reader.cc | 10 ++++----- modules/mol/base/doc/entity.rst | 10 ++++----- modules/mol/base/pymod/export_chain.cc | 8 +++---- modules/mol/base/src/chain_base.cc | 8 +++---- modules/mol/base/src/chain_base.hh | 4 ++-- modules/mol/base/src/editor_base.cc | 4 ++-- modules/mol/base/src/impl/chain_impl.cc | 2 +- modules/mol/base/src/impl/chain_impl.hh | 14 ++++++------- modules/mol/base/tests/test_chain.cc | 28 ++++++++++++------------- 9 files changed, 44 insertions(+), 44 deletions(-) diff --git a/modules/io/tests/test_mmcif_reader.cc b/modules/io/tests/test_mmcif_reader.cc index ad669bd7a..577b211fc 100644 --- a/modules/io/tests/test_mmcif_reader.cc +++ b/modules/io/tests/test_mmcif_reader.cc @@ -276,13 +276,13 @@ BOOST_AUTO_TEST_CASE(mmcif_chaintype_setting) mmcif_p.Parse(); ch = eh.FindChain("A"); BOOST_CHECK(ch.IsValid()); - BOOST_CHECK(ch.GetChainType() == CHAINTYPE_POLY); + BOOST_CHECK(ch.GetType() == CHAINTYPE_POLY); ch = eh.FindChain("C"); BOOST_CHECK(ch.IsValid()); - BOOST_CHECK(ch.GetChainType() == CHAINTYPE_POLY); + BOOST_CHECK(ch.GetType() == CHAINTYPE_POLY); ch = eh.FindChain("O"); BOOST_CHECK(ch.IsValid()); - BOOST_CHECK(ch.GetChainType() == CHAINTYPE_WATER); + BOOST_CHECK(ch.GetType() == CHAINTYPE_WATER); } BOOST_MESSAGE(" done."); // negative: no entity description @@ -295,10 +295,10 @@ BOOST_AUTO_TEST_CASE(mmcif_chaintype_setting) mmcif_p.Parse(); ch = eh.FindChain("A"); BOOST_CHECK(ch.IsValid()); - BOOST_CHECK(ch.GetChainType() == CHAINTYPE_UNKNOWN); + BOOST_CHECK(ch.GetType() == CHAINTYPE_UNKNOWN); ch = eh.FindChain("B"); BOOST_CHECK(ch.IsValid()); - BOOST_CHECK(ch.GetChainType() == CHAINTYPE_UNKNOWN); + BOOST_CHECK(ch.GetType() == CHAINTYPE_UNKNOWN); } BOOST_MESSAGE(" done."); diff --git a/modules/mol/base/doc/entity.rst b/modules/mol/base/doc/entity.rst index a68ae0371..a9f6db99e 100644 --- a/modules/mol/base/doc/entity.rst +++ b/modules/mol/base/doc/entity.rst @@ -280,12 +280,12 @@ The Handle Classes want to save them as PDB files This property is read-only. To change the name, use an :class:`XCSEditor`. - + Also available as :meth:`GetName` :type: str - .. attribute:: chain_type + .. attribute:: type Describes the type of the chain. Is one of enum ChainType: @@ -411,11 +411,11 @@ The Handle Classes See :attr:`name` - .. method:: GetChainType() + .. method:: GetType() - See :attr:`chain_type` + See :attr:`type` - .. method:: GetChainDescription() + .. method:: GetDescription() See :attr:`description` diff --git a/modules/mol/base/pymod/export_chain.cc b/modules/mol/base/pymod/export_chain.cc index f524d5d17..5f8dcaa1c 100644 --- a/modules/mol/base/pymod/export_chain.cc +++ b/modules/mol/base/pymod/export_chain.cc @@ -51,8 +51,8 @@ void export_Chain() .def(self_ns::str(self)) .add_property("valid", &ChainBase::IsValid) .def("IsValid", &ChainBase::IsValid) - .def("GetChainType", &ChainBase::GetChainType) - .def("GetChainDescription", &ChainBase::GetChainDescription) + .def("GetType", &ChainBase::GetType) + .def("GetDescription", &ChainBase::GetDescription) ; generic_prop_def<ChainBase>(chain_base); class_<ChainHandle, bases<ChainBase> >("ChainHandle", init<>()) @@ -82,8 +82,8 @@ void export_Chain() .def("GetBondCount", &ChainHandle::GetBondCount) .add_property("residue_count", &ChainHandle::GetResidueCount) .add_property("atom_count", &ChainHandle::GetAtomCount) - .add_property("chain_type", &ChainHandle::GetChainType) - .add_property("description", &ChainHandle::GetChainDescription) + .add_property("chain_type", &ChainHandle::GetType) + .add_property("description", &ChainHandle::GetDescription) .def("InSequence", &ChainHandle::InSequence) .def("Select", select_string, arg("flags")=0) .def("Select", select_query, arg("flags")=0) diff --git a/modules/mol/base/src/chain_base.cc b/modules/mol/base/src/chain_base.cc index 1f5b04cd0..6e534a4dc 100644 --- a/modules/mol/base/src/chain_base.cc +++ b/modules/mol/base/src/chain_base.cc @@ -44,12 +44,12 @@ String ChainBase::GetName() const { return impl_->GetName(); } -ChainType ChainBase::GetChainType() const { - return impl_->GetChainType(); +ChainType ChainBase::GetType() const { + return impl_->GetType(); } -String ChainBase::GetChainDescription() const { - return impl_->GetChainDescription(); +String ChainBase::GetDescription() const { + return impl_->GetDescription(); } void ChainBase::CheckValidity() const { diff --git a/modules/mol/base/src/chain_base.hh b/modules/mol/base/src/chain_base.hh index 5410ada9f..525ad3658 100644 --- a/modules/mol/base/src/chain_base.hh +++ b/modules/mol/base/src/chain_base.hh @@ -63,12 +63,12 @@ public: /// \brief Get the type of a chain. /// /// \return chain type of ChainType - ChainType GetChainType() const; + ChainType GetType() const; /// \brief Get information about a chain. /// /// \return description - String GetChainDescription() const; + String GetDescription() const; const impl::ChainImplPtr& Impl() const { return impl_; diff --git a/modules/mol/base/src/editor_base.cc b/modules/mol/base/src/editor_base.cc index c9fa92bd4..d9f460994 100644 --- a/modules/mol/base/src/editor_base.cc +++ b/modules/mol/base/src/editor_base.cc @@ -85,13 +85,13 @@ void EditorBase::RenameChain(ChainHandle chain, const String& new_name) void EditorBase::SetChainType(ChainHandle chain, const ChainType type) { CheckHandleValidity(chain); - chain.Impl()->SetChainType(type); + chain.Impl()->SetType(type); } void EditorBase::SetChainDescription(ChainHandle chain, const String desc) { CheckHandleValidity(chain); - chain.Impl()->SetChainDescription(desc); + chain.Impl()->SetDescription(desc); } AtomHandle EditorBase::InsertAtom(ResidueHandle res, const String& name, diff --git a/modules/mol/base/src/impl/chain_impl.cc b/modules/mol/base/src/impl/chain_impl.cc index a96ce571c..c04e1ed72 100644 --- a/modules/mol/base/src/impl/chain_impl.cc +++ b/modules/mol/base/src/impl/chain_impl.cc @@ -37,7 +37,7 @@ ChainImpl::ChainImpl(const EntityImplPtr& e, const String& name): name_(name), residue_list_(), in_sequence_(true), - chain_type_(CHAINTYPE_UNKNOWN), + type_(CHAINTYPE_UNKNOWN), description_() {} diff --git a/modules/mol/base/src/impl/chain_impl.hh b/modules/mol/base/src/impl/chain_impl.hh index 31bd36879..546a2ae8d 100644 --- a/modules/mol/base/src/impl/chain_impl.hh +++ b/modules/mol/base/src/impl/chain_impl.hh @@ -51,23 +51,23 @@ public: /// \brief Assign a type to a chain. /// /// \param type chain type of ChainType - void SetChainType(const ChainType type) + void SetType(const ChainType type) { - chain_type_ = type; + type_ = type; } /// \brief Get the type of a chain. /// /// \return chain type of ChainType - ChainType GetChainType() const + ChainType GetType() const { - return chain_type_; + return type_; } /// \brief Assign a description to a chain. /// /// \param desc description - void SetChainDescription(const String desc) + void SetDescription(const String desc) { description_ = desc; } @@ -75,7 +75,7 @@ public: /// \brief Get information about a chain /// /// \return description - String GetChainDescription() const + String GetDescription() const { return description_; } @@ -167,7 +167,7 @@ private: /// \brief whether the residue numbers are in ascending order or not. Used /// to optimize residue by number lookup. bool in_sequence_; - ChainType chain_type_; + ChainType type_; String description_; ///< special aspects of the chain }; diff --git a/modules/mol/base/tests/test_chain.cc b/modules/mol/base/tests/test_chain.cc index b866ecd00..abca07aed 100644 --- a/modules/mol/base/tests/test_chain.cc +++ b/modules/mol/base/tests/test_chain.cc @@ -208,31 +208,31 @@ BOOST_AUTO_TEST_CASE(chain_type) XCSEditor e = eh.EditXCS(); ChainHandle ch1 = e.InsertChain("A"); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_UNKNOWN); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_UNKNOWN); e.SetChainType(ch1, CHAINTYPE_POLY); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY); e.SetChainType(ch1, CHAINTYPE_NON_POLY); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_NON_POLY); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_NON_POLY); e.SetChainType(ch1, CHAINTYPE_WATER); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_WATER); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_WATER); e.SetChainType(ch1, CHAINTYPE_POLY_PEPTIDE_D); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_PEPTIDE_D); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_PEPTIDE_D); e.SetChainType(ch1, CHAINTYPE_POLY_PEPTIDE_L); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_PEPTIDE_L); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_PEPTIDE_L); e.SetChainType(ch1, CHAINTYPE_POLY_DN); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_DN); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_DN); e.SetChainType(ch1, CHAINTYPE_POLY_RN); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_RN); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_RN); e.SetChainType(ch1, CHAINTYPE_POLY_SAC_D); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_SAC_D); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_SAC_D); e.SetChainType(ch1, CHAINTYPE_POLY_SAC_L); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_SAC_L); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_SAC_L); e.SetChainType(ch1, CHAINTYPE_POLY_DN_RN); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_POLY_DN_RN); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_POLY_DN_RN); e.SetChainType(ch1, CHAINTYPE_N_CHAINTYPES); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_N_CHAINTYPES); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_N_CHAINTYPES); e.SetChainType(ch1, CHAINTYPE_UNKNOWN); - BOOST_CHECK(ch1.GetChainType() == CHAINTYPE_UNKNOWN); + BOOST_CHECK(ch1.GetType() == CHAINTYPE_UNKNOWN); } BOOST_AUTO_TEST_CASE(chain_description) @@ -242,7 +242,7 @@ BOOST_AUTO_TEST_CASE(chain_description) ChainHandle ch1 = e.InsertChain("A"); String description = "Very important information"; e.SetChainDescription(ch1, description); - BOOST_CHECK(ch1.GetChainDescription() == description); + BOOST_CHECK(ch1.GetDescription() == description); } BOOST_AUTO_TEST_SUITE_END() -- GitLab