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

check dimensions for multiple setters #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hexaeder
Copy link

@hexaeder hexaeder commented Jun 3, 2024

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

fixes #82

Technically breaking? But I personally would consider the old behaviour a bug.

@hexaeder
Copy link
Author

hexaeder commented Jun 17, 2024

Instead of changing from map to broadcast, it would also be fine to check the sizes explicitly

if size(ms.setters) != size(val)
    throw(DimensionMismatch("Cannot set variables of size $(size(ms.setters)) to values of size $(size(val))."))
end

My point about the bug is the silent dropping of setters/values rather than the missing broadcast behavior.

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.

setu does not perform any sizecheck
1 participant