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 guesses for Real*Input and Real*Output #291

Merged
merged 2 commits into from
Apr 29, 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.

Copy link

codecov bot commented Apr 29, 2024

Codecov Report

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

Project coverage is 0.00%. Comparing base (37faf7b) to head (7b38a53).

Files Patch % Lines
src/Blocks/utils.jl 0.00% 22 Missing ⚠️
src/Blocks/sources.jl 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #291       +/-   ##
==========================================
- Coverage   61.53%   0.00%   -61.54%     
==========================================
  Files          46      33       -13     
  Lines        1448    1630      +182     
==========================================
- Hits          891       0      -891     
- Misses        557    1630     +1073     

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

@AayushSabharwal AayushSabharwal marked this pull request as draft April 29, 2024 12:03
end
ODESystem(Equation[], t, [u...], []; name = name, guesses = [u => u_start])
ODESystem(Equation[], t, [u], []; name = name, guesses = [u => u_start])
Copy link
Contributor

Choose a reason for hiding this comment

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

If I as a user pass u_start=1 I want that to be true, not only a guess. I wonder if these u_start are needed at all?

Copy link
Member

Choose a reason for hiding this comment

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

You should be able to change the guess. Why would this be a direct value instead of a guess? The value is set by the variable that defines the input and the function that defines the output, any default here would just be an extra equation causing an overconstrained system. Indeed if someone sets a default then it should be true, but why would it be normal to set an overconstrained system with inputs and outputs? We can make that another kwarg that is nothing by default?

Copy link
Contributor

Choose a reason for hiding this comment

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

The keyword is u_start, don't you think users expect this variable start at the value provided?

Copy link
Member

Choose a reason for hiding this comment

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

it should probably just be renamed guess and deprecate the old name.

Copy link
Contributor

Choose a reason for hiding this comment

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

that would be much less confusing

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer if we stop using the word "default" as well in favor of either "start" or "initial", but that's a discussion for another time and place :P

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 7b38a53

@AayushSabharwal AayushSabharwal marked this pull request as ready for review April 29, 2024 14:17
@ChrisRackauckas
Copy link
Member

Is this failure known?

@AayushSabharwal
Copy link
Member Author

It's fixed in SciML/ModelingToolkit.jl#2677

@ChrisRackauckas ChrisRackauckas merged commit 05f718d into SciML:main Apr 29, 2024
4 of 9 checks passed
@AayushSabharwal AayushSabharwal deleted the as/fix-realio-guesses branch April 29, 2024 16:58
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