Skip to content

Conversation

DhairyaLGandhi
Copy link
Member

@DhairyaLGandhi DhairyaLGandhi commented Sep 10, 2025

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Closes #3913

Add any other context about the problem here.

@DhairyaLGandhi
Copy link
Member Author

@asinghvi17 can you try this out for your MWE please

@DhairyaLGandhi DhairyaLGandhi changed the title chore: improve printing of uninitialized variables Improve Printing of Uninitialized Variables Sep 10, 2025
src/utils.jl Outdated
Else returns the variable as-is.
"""
function underscore_to_D(v::AbstractVector, sys)
maps = get_schedule(sys).dummy_sub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be gated behind isscheduled(sys) so that printing the error doesn't error if the system isn't mtkcompiled? It could also use the string manipulation "hack" discussed earlier in that case (or if the inverse map doesn't have the appropriate entry, as is the case for algebraic variables)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that error check happen earlier (ie before we get this far in the problem construction). Also note that any variables not in the schedule get passed through as is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problems do not require the system to be mtkcompiled.

Also note that any variables not in the schedule get passed through as is.

Yeah, but we can still print them better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is added back in f137b1a

Copy link
Member

@AayushSabharwal AayushSabharwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs tests to make sure the error prints correctly both with and without simplification, and on a DAE where it tries to print the derivative of an algebraic variable.

@DhairyaLGandhi
Copy link
Member Author

Added the test

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.

FMU variable names cannot be typed
2 participants