Пример #1
0
    def _to_xml(self):

        df = self.ui.table_include.model().dataframe()
        include_common = self.ui.check_include_common.isChecked()

        fgdc_taxonomy = taxonomy.gen_taxonomy_section(
            keywords=list(df.item),
            tsns=list(df.tsn),
            include_common_names=include_common)

        return fgdc_taxonomy
Пример #2
0
    def _to_xml(self):
        df = self.ui.table_include.model().dataframe()
        include_common = self.ui.check_include_common.isChecked()
        unique_id = tuple([tuple(df.tsn), include_common])

        if unique_id not in self.xml_lookup:
            fgdc_taxonomy = taxonomy.gen_taxonomy_section(keywords=list(df.item),
                        tsns=list(df.tsn), include_common_names=include_common)
            self.xml_lookup[unique_id] = fgdc_taxonomy

        return self.xml_lookup[unique_id]
Пример #3
0
def test_gen_fgdc_taxonomy():
    fgdc_taxonomy = taxonomy.gen_fgdc_taxoncl(tsns=[180694])
    assert fgdc_taxonomy.tag == "taxoncl"
    assert fgdc_taxonomy.getchildren()[1].text == "Animalia"

    # Add a plant, so that the top level is Domain==Eukaryota
    fgdc_taxonomy = taxonomy.gen_fgdc_taxoncl(tsns=[180694, 183437])
    assert fgdc_taxonomy.getchildren()[1].text == "Eukaryota"

    # Add a bacteria, so that the top level is Domain==Life
    fgdc_taxonomy = taxonomy.gen_fgdc_taxoncl(tsns=[180694, 183437, 951930])
    assert fgdc_taxonomy.getchildren()[1].text == "Life"

    fgdc_taxonomy = taxonomy.gen_taxonomy_section(keywords=["test", "test2"],
                                                  tsns=[180694, 183437])
    assert fgdc_taxonomy.tag == "taxonomy"
Пример #4
0
def test_gen_fgdc_taxonomy():
    fgdc_taxonomy = taxonomy.gen_fgdc_taxoncl(tsns=[180694])
    assert fgdc_taxonomy.tag == 'taxoncl'
    assert fgdc_taxonomy.getchildren()[1].text == 'Animalia'

    # Add a plant, so that the top level is Domain==Eukaryota
    fgdc_taxonomy = taxonomy.gen_fgdc_taxoncl(tsns=[180694, 183437])
    assert fgdc_taxonomy.getchildren()[1].text == 'Eukaryota'

    # Add a bacteria, so that the top level is Domain==Life
    fgdc_taxonomy = taxonomy.gen_fgdc_taxoncl(tsns=[180694, 183437, 951930])
    assert fgdc_taxonomy.getchildren()[1].text == 'Life'

    fgdc_taxonomy = taxonomy.gen_taxonomy_section(keywords=['test', 'test2'],
                                                  tsns=[180694, 183437])
    assert fgdc_taxonomy.tag == 'taxonomy'