Skip to content

check dimensions for multiple setters#83

Open
hexaeder wants to merge 2 commits into
SciML:masterfrom
hexaeder:hw/multiplesetters
Open

check dimensions for multiple setters#83
hexaeder wants to merge 2 commits into
SciML:masterfrom
hexaeder:hw/multiplesetters

Conversation

@hexaeder

@hexaeder hexaeder commented Jun 3, 2024

Copy link
Copy Markdown

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 hexaeder force-pushed the hw/multiplesetters branch from 9448031 to cefe510 Compare June 14, 2024 14:08
@hexaeder

hexaeder commented Jun 17, 2024

Copy link
Copy Markdown
Author

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