Replies: 1 comment 1 reply
-
Hi @RRiva , This is an interesting point, and not something we've really grappled with before. I'm glad you've found a solution that works, but I agree that it would be nice to provide better support for this. The idea of doing an overhaul of how the solvers work has been something we've kicked around for some time, and I like your suggestions. Essentially, I think we could attach the solver handle to the I'm going to add this to the list of ideas for FLORIS v5 (still very much in the "ideas" phase, not yet even in prototyping). Thanks for the suggestion here---I'll bring it up with the core development group and hope to make some improvements on this front in a future release. I'll certainly keep this discussion updated with any progress we make on this front. Misha |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, for a work I've had to modify the solvers embedded in Floris. No big changes, I've just added 3 lines that improve the flow field for my use case. Since I'm developing a package, how do I make sure that its users will use the modified solvers?
Ideal option (not possible)
The user writes the new solver name in the configuration file, and tells Floris where to find it. This is not possible because in
floris.core.core
there is no room for custom solvers, but it might be fixed by adopting a plugin architecture.Easy monkey patch (also not possible)
The user replaces the solver module with a custom one at any point during the workflow.
This doesn't work because
floris.core.core
imports the function names (likeempirical_gauss_solver
) and therefore loses contact with the original module.Difficult monkey patch (it works, but it's not nice at all)
Before loading Floris, the user replaces the solver module with the custom one
Since it is essential that Floris is loaded after the monkey patch, I've had to move all the imports in the original solver module inside the functions.
Conclusion
Needless to say, the last approach works, but feels hacky and will force me to carefully check the solver module at every new release.
Beta Was this translation helpful? Give feedback.
All reactions