Debug on taxonomy extraction and CSV conversion

This commit is contained in:
Eric Coissac
2025-07-07 15:29:40 +02:00
parent 8d53d253d4
commit 43b285587e
6 changed files with 39 additions and 17 deletions

View File

@@ -26,7 +26,7 @@ func (taxonomy *Taxonomy) OrDefault(panicOnNil bool) *Taxonomy {
return taxonomy
}
func IsDefaultTaxonomyDefined() bool {
func HasDefaultTaxonomyDefined() bool {
return __defaut_taxonomy__ != nil
}

View File

@@ -28,21 +28,22 @@ func NewITaxon() *ITaxon {
// Iterator creates a new ITaxon iterator for the TaxonSet.
// It starts a goroutine to send Taxon instances from the set to the iterator's source channel.
func (set *TaxonSet) Iterator() *ITaxon {
i := NewITaxon()
return set.Sort().Iterator()
// i := NewITaxon()
go func() {
for _, t := range set.set {
taxon := &Taxon{
Taxonomy: set.taxonomy,
Metadata: nil,
Node: t,
}
i.Push(taxon)
}
close(i.source)
}()
// go func() {
// for _, t := range set.set {
// taxon := &Taxon{
// Taxonomy: set.taxonomy,
// Metadata: nil,
// Node: t,
// }
// i.Push(taxon)
// }
// close(i.source)
// }()
return i
// return i
}
// Iterator creates a new ITaxon iterator for the TaxonSlice.

View File

@@ -386,7 +386,7 @@ func (taxonomy *Taxonomy) InsertPathString(path []string) (*Taxonomy, error) {
if err != nil {
return nil, err
}
root.SetName(scientific_name, "scientificName")
root.SetName(scientific_name, "scientific name")
}
var current *Taxon