Browse Source

Revert "added PersonCollection.get_coparents_recursively"

This reverts commit fe01ce2145cdbf3e45a74b141d86d085675af0fd.
Fabian Peter Hammerle 4 years ago
parent
commit
234416f1ba
2 changed files with 0 additions and 30 deletions
  1. 0 2
      CHANGELOG.md
  2. 0 28
      yamily/__init__.py

+ 0 - 2
CHANGELOG.md

@@ -5,7 +5,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ## Unreleased
-### Added
-- `PersonCollection.get_coparents_recursively(person)`
 
 ## 0.1.0 - 2020-01-02

+ 0 - 28
yamily/__init__.py

@@ -280,34 +280,6 @@ class PersonCollection:
                     coparents.add(coparent)
         return coparents
 
-    def get_coparents_recursively(
-        self, parent: typing.Union[Person, str]
-    ) -> typing.Set[Person]:
-        """
-        >>> c = PersonCollection()
-        >>> child_a = Person("child-a")
-        >>> child_a.father = Person("father")
-        >>> child_a.mother = Person("mother-a")
-        >>> c.add_person(child_a)
-        Person(child-a)
-        >>> child_b = Person("child-b")
-        >>> child_b.father = Person("father")
-        >>> child_b.mother = Person("mother-b")
-        >>> c.add_person(child_b)
-        Person(child-b)
-        >>> sorted(c.get_coparents_recursively("mother-a"), key=lambda p: p.identifier)
-        [Person(father), Person(mother-a), Person(mother-b)]
-        >>> c.get_coparents_recursively("child-a")
-        set()
-        """
-        coparents = self.get_coparents(parent)
-        last_len = None
-        while len(coparents) != last_len:
-            for coparent in set(coparents):
-                coparents.update(self.get_coparents(coparent))
-            last_len = len(coparents)
-        return coparents
-
     def __iter__(self) -> "PersonCollection":
         """
         >>> c = PersonCollection()