Skip to content

length check before return; also explicit error instead of @assert#472

Merged
ChrisRackauckas merged 3 commits into
SciML:masterfrom
daviehh:master
Sep 28, 2025
Merged

length check before return; also explicit error instead of @assert#472
ChrisRackauckas merged 3 commits into
SciML:masterfrom
daviehh:master

Conversation

@daviehh
Copy link
Copy Markdown
Contributor

@daviehh daviehh commented Sep 23, 2025

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

Currently when Tu === eltype(u) && Tt === eltype(t), u, t are returned without the length/size check. This PR moves the check up so incorrect input size are detected correctly. Also changed @assert to cond || error(msg) form since @asserts may be ignored.

@daviehh
Copy link
Copy Markdown
Contributor Author

daviehh commented Sep 23, 2025

it also caught some length mismatches in existing tests, so these are now also changed

@ChrisRackauckas ChrisRackauckas merged commit d39543f into SciML:master Sep 28, 2025
18 of 19 checks passed
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