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

feat: accept additional metadata in diff2term #1104

Merged

Conversation

ven-k
Copy link
Contributor

@ven-k ven-k commented Mar 28, 2024

This can be useful in passing metadata defined upstream; for example units defined in MTK.

With this PR: k_t's unit will be 1.0 s⁻¹

using ModelingToolkit
using ModelingToolkit: t, D, get_unit, value, VariableUnit
@variables k(t)
get_unit(diff2term(value(D(k)), Dict(VariableUnit => get_unit(D(k)))))  # returns 1.0 s⁻¹

This can be useful in passing metadata defined upstream; for example units defined in MTK.
@ven-k ven-k marked this pull request as draft March 28, 2024 08:36
@ven-k ven-k marked this pull request as ready for review March 28, 2024 08:59
@ChrisRackauckas
Copy link
Member

Needs tests

@ven-k
Copy link
Contributor Author

ven-k commented Apr 3, 2024

Due to ParameterizedFunctions, MTK@8 is resolved in the downstream tests. Hence, the tests use Unitful and not the DynamicQuantities.

@codecov-commenter
Copy link

codecov-commenter commented Apr 3, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 76.10%. Comparing base (79c4e92) to head (d32e23d).
Report is 142 commits behind head on master.

Files Patch % Lines
src/utils.jl 66.66% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1104      +/-   ##
==========================================
- Coverage   77.07%   76.10%   -0.98%     
==========================================
  Files          32       35       +3     
  Lines        3533     3678     +145     
==========================================
+ Hits         2723     2799      +76     
- Misses        810      879      +69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ChrisRackauckas ChrisRackauckas merged commit 5c2b2fc into JuliaSymbolics:master Apr 7, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants