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

fix: fix complete not properly expanding systems #3168

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

AayushSabharwal
Copy link
Member

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

Add any other context about the problem here.

if (eqs = equations(sys)) isa Vector &&
any(eq -> eq isa Equation && isconnection(eq.lhs), eqs)
eqs = equations(sys)
if eqs isa AbstractArray && eltype(eqs) <: Equation
Copy link
Member

Choose a reason for hiding this comment

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

What's a case where it's not a vector?

Copy link
Member Author

Choose a reason for hiding this comment

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

OptimizationSystem. equations(sys) returns the objective.

Copy link
Member

Choose a reason for hiding this comment

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

but is there any case that is an abstractarray that's not a vector?

Copy link
Member Author

Choose a reason for hiding this comment

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

JumpSystem stores it in an ArrayPartition, which is an AbstractVector but we don't want to expand_connections on that, and it would fail eltype <: Equation anyway.

@ChrisRackauckas ChrisRackauckas merged commit 2c694b5 into SciML:master Oct 30, 2024
30 of 39 checks passed
@AayushSabharwal AayushSabharwal deleted the as/fix-complete branch October 30, 2024 16:37
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