CLN: eliminate assert in favor of AssertionError GH2057

PTF
Merge pull request #3023 from y-p/no_asserts

Continuing #2057, s/assert/raise AssertionError/g