mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-07-19 09:50:47 +00:00
Debug on taxonomy extraction and CSV conversion
This commit is contained in:
@@ -26,7 +26,7 @@ func (taxonomy *Taxonomy) OrDefault(panicOnNil bool) *Taxonomy {
|
||||
return taxonomy
|
||||
}
|
||||
|
||||
func IsDefaultTaxonomyDefined() bool {
|
||||
func HasDefaultTaxonomyDefined() bool {
|
||||
return __defaut_taxonomy__ != nil
|
||||
}
|
||||
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user