Skip to content

get_*_dense_index() do not return expected value? #164

@alaindanet

Description

@alaindanet

get_producers_dense_index() and get_consumers_dense_index() do not return the expected values.

While get_producers_sparse_index() and get_consumers_sparse_index() return the right indices.

vegan = Foodweb([:ours => :plant])
m = default_model(vegan)

# Ours is one, plant is two
julia> get_species_names(m)
2-element EcologicalNetworksDynamics.SpeciesNames:
 :ours
 :plant

# *_dense_index is wrong
julia> get_producers_dense_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :plant => 1
julia> get_producers_sparse_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :plant => 2
vegan = Foodweb([0 0; 0 1]);
m = default_model(vegan, Species([:plant, :ours]));

# Plant is one, ours is two
julia> get_species_names(m)
2-element EcologicalNetworksDynamics.SpeciesNames:
 :plant
 :ours

# *_dense_index is wrong
julia> get_consumers_dense_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :ours => 1

julia> get_consumers_sparse_index(m)
OrderedCollections.OrderedDict{Symbol, Int64} with 1 entry:
  :ours => 2

It is a very minor issue I guess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions