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: add default_values to interface #47

Merged
merged 2 commits into from
Mar 11, 2024
Merged

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 Feb 16, 2024

Codecov Report

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

Project coverage is 34.03%. Comparing base (2a45e9c) to head (7713bc0).

Files Patch % Lines
src/symbol_cache.jl 6.89% 27 Missing ⚠️
src/trait.jl 0.00% 8 Missing ⚠️
src/interface.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
- Coverage   38.17%   34.03%   -4.14%     
==========================================
  Files           7        7              
  Lines         296      332      +36     
==========================================
  Hits          113      113              
- Misses        183      219      +36     

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

Copy link
Contributor

@SebastianM-C SebastianM-C left a comment

Choose a reason for hiding this comment

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

Does the spec says what should be used as keys or is it up to the package that implements this? I was thinking that if we use something that standardized, then the defaults are compatible between packages implementing the interface.

Also, are the default_values something that's supposed to be immutable or not?

@@ -75,6 +75,7 @@ all_variable_symbols(sc::SymbolCache) = variable_symbols(sc)
function all_symbols(sc::SymbolCache)
vcat(variable_symbols(sc), parameter_symbols(sc), independent_variable_symbols(sc))
end
default_values(::SymbolCache) = Dict()
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this create a new dictionary every time we need defaults?

@AayushSabharwal
Copy link
Member Author

Does the spec says what should be used as keys or is it up to the package that implements this?

All SII can say is that the keys are symbolic variables. Whether that's Num, Symbol, BasicSymbolic or something else is up to the implementation, since SII does not know of these

Copy link
Contributor

@SebastianM-C SebastianM-C left a comment

Choose a reason for hiding this comment

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

The mutability of the defaults dictionary is needed for updating the default values?

@AayushSabharwal
Copy link
Member Author

Right now it's somewhat arbitrary. I don't think we'll need it to be mutable in remake or anywhere else, but you mentioned that we should standardize it and mutability offers us more flexibility in the future.

@SebastianM-C
Copy link
Contributor

Yeah, it's nicer if it's mutable, that makes it easier in certain situations.

@ChrisRackauckas ChrisRackauckas merged commit c603e9c into master Mar 11, 2024
9 of 11 checks passed
@ChrisRackauckas ChrisRackauckas deleted the as/model-defaults branch March 11, 2024 12:39
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