lingpy / lingpy

Compare 52a87c7 ... +0 ... ed448cb

Coverage Reach
src/lingpy/compare/phylogeny.py src/lingpy/compare/strings.py src/lingpy/compare/lexstat.py src/lingpy/compare/partial.py src/lingpy/compare/_phylogeny/utils.py src/lingpy/compare/_phylogeny/polygon.py src/lingpy/compare/_phylogeny/convex_hull.py src/lingpy/compare/_phylogeny/_settings.py src/lingpy/compare/sanity.py src/lingpy/compare/_structure.py src/lingpy/compare/util.py src/lingpy/algorithm/cython/_calign.py src/lingpy/algorithm/cython/_talign.py src/lingpy/algorithm/cython/_malign.py src/lingpy/algorithm/cython/_cluster.py src/lingpy/algorithm/cython/_misc.py src/lingpy/algorithm/clustering.py src/lingpy/algorithm/_tree.py src/lingpy/algorithm/extra.py src/lingpy/algorithm/cluster_util.py src/lingpy/algorithm/__init__.py src/lingpy/align/multiple.py src/lingpy/align/sca.py src/lingpy/align/_align/confidence.py src/lingpy/align/pairwise.py src/lingpy/align/__init__.py src/lingpy/thirdparty/cogent/tree.py src/lingpy/thirdparty/cogent/newick.py src/lingpy/thirdparty/cogent/__init__.py src/lingpy/thirdparty/linkcomm/link_clustering.py src/lingpy/thirdparty/linkcomm/__init__.py src/lingpy/thirdparty/__init__.py src/lingpy/convert/plot.py src/lingpy/convert/html.py src/lingpy/convert/strings.py src/lingpy/convert/graph.py src/lingpy/convert/tree.py src/lingpy/convert/cldf.py src/lingpy/sequence/sound_classes.py src/lingpy/sequence/ngrams.py src/lingpy/sequence/smoothing.py src/lingpy/sequence/profile.py src/lingpy/sequence/generate.py src/lingpy/sequence/__init__.py src/lingpy/basic/wordlist.py src/lingpy/basic/ops.py src/lingpy/basic/parser.py src/lingpy/basic/tree.py src/lingpy/basic/__init__.py src/lingpy/evaluate/apa.py src/lingpy/evaluate/acd.py src/lingpy/evaluate/alr.py src/lingpy/evaluate/__init__.py src/lingpy/read/qlc.py src/lingpy/read/csv.py src/lingpy/read/starling.py src/lingpy/read/phylip.py src/lingpy/cli.py src/lingpy/data/derive.py src/lingpy/data/model.py src/lingpy/data/ipa/sampa.py src/lingpy/data/__init__.py src/lingpy/meaning/colexification.py src/lingpy/util.py src/lingpy/log.py src/lingpy/settings.py src/lingpy/basictypes.py src/lingpy/config.py src/lingpy/cache.py src/lingpy/__init__.py src/lingpy/_settings.py tests/compare/test_lexstat.py tests/compare/test_compare_strings.py tests/compare/test__phylogeny.py tests/compare/test_phylogeny.py tests/compare/test_partial.py tests/compare/test_sanity.py tests/compare/test__structure.py tests/sequence/test_sound_classes.py tests/sequence/test_ngrams.py tests/sequence/test_smoothing.py tests/sequence/test_generate.py tests/sequence/test_profile.py tests/algorithm/test_cython.py tests/algorithm/test_clustering.py tests/algorithm/test_extra.py tests/algorithm/test__tree.py tests/algorithm/test_cluster_util.py tests/convert/test_strings.py tests/convert/test_plot.py tests/convert/test_cldf_methods.py tests/convert/test_html.py tests/convert/test_cldf.py tests/convert/test_convert_tree.py tests/convert/test_graph.py tests/basic/test_wordlist.py tests/basic/test_ops.py tests/basic/test_parser.py tests/basic/test_tree.py tests/align/test_sca.py tests/align/test_multiple.py tests/align/test_pairwise.py tests/thirdparty/test_cogent.py tests/thirdparty/test_linkcomm.py tests/read/test_csv.py tests/read/test_qlc.py tests/read/test_phylip.py tests/read/test_starling.py tests/evaluate/test_acd.py tests/evaluate/test_apa.py tests/evaluate/test_alr.py tests/test_cli.py tests/test_util.py tests/meaning/test_colexification.py tests/test_basictypes.py tests/test_log.py tests/data/test_derive.py tests/data/test_sound_class_models.py tests/test_config.py tests/test_settings.py tests/test_cache.py tests/conftest.py tests/test_misc.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 3 of 6 files from the diff.

@@ -20,8 +20,8 @@
Loading
20 20
"""
21 21
22 22
__author__ = "Johann-Mattis List, and Robert Forkel (with contributions by Simon J. Greenhill, Tiago Tresoldi, Gereon Kaiping, Steven Moran, Taraka Rama, Johannes Dellert, Frank Nagel, and Peter Bouda, and Taraka Rama)"
23 -
__date__ = "2021-06-07"
24 -
__version__ = "2.6.9.dev0"
23 +
__date__ = "2021-11-26"
24 +
__version__ = "2.6.10.dev0"
25 25
26 26
# We exempt this module from QA, because it only provides import shortcuts.
27 27
# flake8: noqa

@@ -555,6 +555,16 @@
Loading
555 555
556 556
        return paps
557 557
558 +
    def iter_cognates(self, ref, *entries):
559 +
        """Iterate over cognate sets in a wordlist."""
560 +
        for cogid, idxs_ in self.get_etymdict(ref=ref).items():
561 +
            idxs = []
562 +
            for idx in idxs_:
563 +
                if idx:
564 +
                    idxs += idx
565 +
            yield cogid, [idxs]+[
566 +
                    [self[idx, entry] for idx in idxs] for entry in entries]
567 +
558 568
    def iter_rows(self, *entries):
559 569
        """Iterate over the columns in a wordlist.
560 570
        

@@ -103,10 +103,15 @@
Loading
103 103
    etd2 = wordlist.get_etymdict(ref='cogid', entry='ipa',
104 104
                                      modify_ref=abs)
105 105
106 +
106 107
    assert (len(etd1) > len(etd2) and
107 108
            len(set([abs(x) for x in etd1])) == len(etd2))
108 109
    assert len([x for x in etd2 if x < 0]) == 0
109 110
111 +
    # test iter_cognates
112 +
    for cogid, idxs in wordlist.iter_cognates("cogid"):
113 +
        assert len(idxs) == 1
114 +
110 115
    # make "fuzzy" cognate sets
111 116
    wordlist.add_entries('fuzzyid', 'cogid', lambda x: [x])
112 117

Learn more Showing 1 files with coverage changes found.

Changes in src/lingpy/compare/lexstat.py
-2
+2
Loading file...
Files Coverage
src/lingpy 0.02% 87.62%
tests +<.01% 98.86%
Project Totals (123 files) 89.28%
Loading