Repository navigation
Allow arbitrary storage for ContrastsMatrix and other contrasts breakage - #273
Conversation
| struct ContrastsMatrix{C <: AbstractContrasts, M <: AbstractMatrix, T, U} | ||
| matrix::M |
There was a problem hiding this comment.
Any particular reason to put M in second position? Putting it at the end would avoid breakage.
There was a problem hiding this comment.
my thinking here (near as I can reconstruct it at this point) was that we're already doing a breaking release, and this position puts it in a place where you can specify it without needing to specify the other parameters.
There was a problem hiding this comment.
OK so you suppose it will be more common to specify M than T or U?
There was a problem hiding this comment.
yeah definitely. those are only there to make the contrast lookup type stable/inferrable
| levels === nothing && | ||
| throw(ArgumentError("kwarg `levels` must be specified for HypothesisCoding")) | ||
| labels === nothing && | ||
| throw(ArgumentError("kwarg `labels` must be specified for HypothesisCoding")) |
There was a problem hiding this comment.
Maybe just dropping the default value nothing would be enough, as the error message is quite explicit?
| struct ContrastsMatrix{C <: AbstractContrasts, M <: AbstractMatrix, T, U} | ||
| matrix::M |
There was a problem hiding this comment.
OK so you suppose it will be more common to specify M than T or U?
| mat = StatsModels.contrasts_matrix(contrasts, 1, 4) | ||
| spmat = sparse(mat) |
This makes a few breaking changes that we've planned for a while (fixes #175):
M<:AbstractMatrixtoContrastsMatrixwhich can now use anyAbstractMatrixto represent the contrasts (with tests forSparseMatrixCSCstorage)labels=andlevels=kwargs forHypothesisCodingmandatoryContrastsCodingand removes the corresponding deprecation warning.base=kwarg forSeqDiffCodingI did not implement "more specific termnames" because I anticipate that being an enormous bikeshed 😂