-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor model API in terms of "Components". #131
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was
linked to
issues
Sep 14, 2023
The idea is to focus on constructing a stable API now, in a way that does not depend on the internals, so we can completely rewrite them after publication without introducing breaking changes to user code.
- Craft a safe+flexible framework abstracting over the internals: - Stick to the underlying *network* model, rather than matrices/vectors. - Make the construction of an invalid model impossible from the exposed API. - Leave room for future extensions with an open list of model components. - Split tests into successive modules build on top of each other. - Re-expose most of the internal features in terms of this model: - Aliased Dicts. - Foodweb - Functional Response - Multiplex API - Nutrients - Biorates. - Allometry. - Temperature. - Simulation.
Closed
This was referenced Mar 15, 2024
This was referenced Mar 15, 2024
Take this opportunity to simplify/refresh AliasingDicts code.
The ecosystem is too unstable, and it is too frequent that tests break even though no code has changed on our side.
This was referenced Mar 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a big shot attempting to address #114, #122, #84, #73, #74, #54 and #126 at once, while not refactoring the package internals yet so we can settle on a stable API and release the library/paper sooner.
Move all current implementation to an
Internals
submodule, so that none of it is exposed to user anymore. (:scream:)Craft a dedicated framework making sense of the safe concepts of
System
,Component
,Blueprint
,Method
(documentation here).Write a fresh API to re-expose existing internals, but via the above framework :
const Model = Framework.System{Internals.ModelParameters}
.Foodweb
component.FunctionalResponse
components.ProducerGrowth
components.NonTrophicLayer
components.simulate
method.Integrate post-simulation processing features into the above.(see Simulation output utils are absent from components API. #137)Extract/adjust existing documentation from the internals to the main module. (Update doc wrt components API. #135)
Make the use cases work again. (Update use cases wrt components API. #136)
Make the doctests work again.(see Docstrings/Doctests are missing from the component API. #140)I expect this is a good opportunity to design/stabilize the eventual API we want without bothering yet with any refactoring of the
Internals
. To push this PR forward, just focus on how we would like the package to be used :)Example fresh, configurable basic pipeline with the "components" approach:
other examples here