Skip to content

fix change of var for sys with no equations #3620

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

Merged
merged 1 commit into from
May 11, 2025

Conversation

aml5600
Copy link
Contributor

@aml5600 aml5600 commented May 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

In the case were a system had no equations, like with RealInput/Output, performing map(transform, get_eqs(sys)) would return Any[], because it seemed like the type from transform(ex) couldn't be deduced. This small addition ensures that typeof(ex) === typeof(transform(ex)) and solves this issue. A small test is added which would fail prior to the change.

@aml5600
Copy link
Contributor Author

aml5600 commented May 10, 2025

Also, it seemed like with JuliaFormatter v2.1.2 fails, and changes many files, with: using JuliaFormatter, ModelingToolkit; format(joinpath(dirname(pathof(ModelingToolkit)), ".."))

@ChrisRackauckas ChrisRackauckas merged commit fafb47b into SciML:master May 11, 2025
34 of 45 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.

2 participants