Skip to content

registered function unit fix #3002

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Merged
merged 4 commits into from
Aug 30, 2024
Merged

Conversation

isaacsas
Copy link
Member

Closes SciML/Catalyst.jl#1035

In recent MTK versions registered functions have non-unit coefficients when using get_units, i.e.

mm(X, v, K) = v * X / (X + K)
mm2(X, v, K) = v * X / (X + K)
Symbolics.@register_symbolic mm2(X, v, K)
@parameters t [unit=u"s"] K [unit=u"mol/m^3"] v [unit=u"(m^6)/(s*mol^2)"]
@variables X(t) [unit=u"mol/m^3"]
mmunits = MT.get_unit(mm(X, v, K))         # 1.0 m⁶ s⁻¹ mol⁻²
mm2units = MT.get_unit(mm2(X, v, K))     # 0.5 m⁶ s⁻¹ mol⁻²

This seems to fix the issue.

@isaacsas
Copy link
Member Author

@ChrisRackauckas should be good to go if tests pass.

@isaacsas isaacsas closed this Aug 30, 2024
@isaacsas isaacsas reopened this Aug 30, 2024
@ChrisRackauckas ChrisRackauckas merged commit e0cbb9b into SciML:master Aug 30, 2024
40 of 46 checks passed
@isaacsas isaacsas deleted the unit_fix branch August 30, 2024 19:38
@isaacsas
Copy link
Member Author

@ChrisRackauckas can we get a bugfix release now so that Catalyst CI passes again? I'd like to run it through and then release a Catalyst version that is Symbolics 6 compatible.

No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test for units currently broken
2 participants