-
Notifications
You must be signed in to change notification settings - Fork 3
Introduce Topology to check biomass graph disconnections.
#152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
49e0fad to
32e1e6d
Compare
a90065c to
6154382
Compare
43e3443 to
cb82c5f
Compare
522e2c4 to
bbcd64e
Compare
e4875de to
1245552
Compare
0f165a1 to
b942776
Compare
Topology to check biomass graph disconnections.
|
So, this PR addresses #151 in a very deep way by creating the new The reason to put so much effort into Review welcome @alaindanet @ismael-lajaaiti ;) There is a lot of code so I won't mind if you don't thoroughly scan all of it of course. But if you want to help: please test the feature to check whether it's comfy and whether it corresponds to something that would at least solve #151 :) Entrypoint into the feature:
Feedback welcome! (here or on the channel ;) |
|
Wops! I can reproduce your error with a simple graph indeed: m = default_model(Foodweb([:a => [:b, :c], :b => :c]))
g = m.topology
starving_consumers(m, g)This is a bug in the graph visit implementation. I'm fixing it right now. Thank you for reporting.
BTW are you happy with the default |
Great, thank you for fixing it. 😉
Yes, I like it. In particular, because with this default it is easy to distinguish between species and nutrients. |
|
Thank you for feedback @ismael-lajaaiti :)
I'm not sure we can do much better because the list of possible "interaction types" is open. Today, neither the topology or the model values know about all possible interaction types, and so there is no (simple) way they could make a difference between:
Thus the error message you are seing now. Maybe I can still clarify a little though: Invalid edge type label: :facilitation. Valid labels in this model are :refuge and :trophic. ..?
For the same reason: in principle, anyone could add the interaction type they want to the system by creating their own custom components (although it's (very) not ready yet). So given input like I'm curious though: what would you use this empty matrix for? How come your code needs to request facilitation links in a model without a
Oh, I thought these were guaranteed not to generate such degenerated networks. If they aren't, then of course we could feature that. The algorithm would just be bruteforce like the one to avoid cycles, right? Draw random networks until we find one without this kind of species.
Of course :) My first (modest) contribution was this comment. What I can do on my side is to start keeping track of API changes in a toplevel Unfortunately, I am leaving tonight for three weeks off. What I can do is merge this PR into See you about end of August <3 |
Yes, IMO this is already better!
OK, I see.
First, my reasoning was that a model without a
Yes, and yes. ;)
Enjoy your (well deserved) holidays! 🌴 ☀️ |
eef9415 to
ad4878d
Compare
That is.. very true. They are the same in principle, but they differ in the code because the former does not store extra facilitation data whereas the latter does. This is an unfortunate quirk.. :\ But I'm not sure what to do about it without also stating that "every model is a model with an empty
Okay, I see two approaches in this situations:
Would either be okay ? :) |
ad4878d to
9a5cd54
Compare
|
Hi @alaindanet @ismael-lajaaiti! Following our recent discussion, I shortened verbosity arguments to But it makes us realize that this PR is kind of stalled right now. The blocker was to have someone try the feature and write the associated (science-)documentation. If this is not something you think we can do before landing #139, then one option is to land the feature as part of #139 but without actually documenting it, so it'd be present but not exactly "released", and then maybe report its documentation to #141? |
94f7342 to
eec76ec
Compare
Testing this required defining an equivalence relation among models.
DifferentialEquations seems to have changed its default solver, which made extinction dates non-reproducible?
These values describe the model under a topological perspective: nodes and their neibouhring relations. Nodes and edges are typed into various 'compartments'. Nodes can be "removed" from topologies while leaving tombstones to maintain indices validity. This enables various topological analyses of the model network like `disconnected_components()`, `isolated_producers()` or `starving_consumers()`.
This deep refactoring of the Framework addresses and fixes #139. It fixes the semantics of the components library (*e.g.* `OmegaFromRawEdges` and `OmegaFromAllometry` are *not* two separate components) while making it more flexible and future-proof. Take this opportunity to tick the numerous additional Framework `TODO`s, contributing to polishing the whole library API experience. Summarize changes in CHANGELOG, suggesting to issue v0.3.0.
eec76ec to
243c7fd
Compare
|
Wops, this is an accidental close, yet definitive it seems :( |

Start work on addressing #151.
[STATUS] The feature is complete and about to land on
main. Before documenting it an considering it "released" though:CHANGELOG.mdentry to land this intomainas ourv0.2.1:)