Skip to content
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

mtk_to_si no longer defined/exported with new functionality. #279

Closed
TorkelE opened this issue Feb 1, 2024 · 5 comments
Closed

mtk_to_si no longer defined/exported with new functionality. #279

TorkelE opened this issue Feb 1, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@TorkelE
Copy link
Member

TorkelE commented Feb 1, 2024

Simple MWE:

using StructuralIdentifiability
mtk_to_si # ERROR: UndefVarError: `mtk_to_si` not defined
using ModelingToolkit
mtk_to_si # ERROR: UndefVarError: `mtk_to_si` not defined

I think this was caused by the latest update.

Currently, this is breaking tests in Catalyst, hence I discovered it: https://github.com/SciML/Catalyst.jl/actions/runs/7743939220/job/21116510775?pr=776

I checked the source code. I am not really sure, but when I make extensions I do not put export statements in the extension file. Instead, I create a mtk_to_si function (without methods) in the main file, and then add methods to that in the extension. E.g. in Catalyst's HomotopyContinuation extension I have this in Catalyst.jl

# HomotopyContinuation
function hc_steady_states end
export hc_steady_states

and this in homotopy_continuation_extension.jl

function Catalyst.hc_steady_states(rs::ReactionSystem, ps; filter_negative=true, neg_thres=-1e-20, u0=[], kwargs...)
    ss_poly = steady_state_polynomial(rs, ps, u0)
    sols = HC.real_solutions(HC.solve(ss_poly; kwargs...))
    reorder_sols!(sols, ss_poly, rs)
    return (filter_negative ? filter_negative_f(sols; neg_thres) : sols)
end

This might be worth a try.

@TorkelE TorkelE added the bug Something isn't working label Feb 1, 2024
@pogudingleb
Copy link
Collaborator

@TorkelE
Thanks for reporting the issue and suggesting an elegant solution!
It did not occur to me that I can still have the function definition, I will do this right away.

@TorkelE
Copy link
Member Author

TorkelE commented Feb 1, 2024

I actually just finished a PR for it, see: #280
(but feel welcome to just do your own solution)

I encountered another problem there which might need checking as well.

Yes, I struggled quite a bit when I wrote the extensions. They work, but it is not super intuitive, and there are no good descriptions of how to do it.

@TorkelE
Copy link
Member Author

TorkelE commented Feb 1, 2024

If you haven't already, could you tag a new release so that Catalyst could use it for the tests?

@pogudingleb
Copy link
Collaborator

Sure, this is not version 0.5.3

@TorkelE
Copy link
Member Author

TorkelE commented Feb 1, 2024

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants