On Fri, 10 Sept 2021 at 02:02, Aaron Meurer <asmeu...@gmail.com> wrote:
>
> On Thu, Sep 9, 2021 at 6:07 PM Oscar Benjamin
> <oscar.j.benja...@gmail.com> wrote:
> >
> > You can see another example in the release notes where I wrote:
> >
> > - The (internal) PolyMatrix class has been changed and now requires
> >    generators to be provided on construction. (#21441 by @oscarbenjamin)
> >
> > Here I need to clarify that the class is internal. I have definitely
> > seen people trying to use this class though so even though it is
> > internal someone is using it for something. There have been changes to
> > it that are not at all compatible. The SymPy docs don't make clear
> > what's internal or not though and regardless people will just go into
> > the code and use whatever they find if they think it is the right
> > thing:
> > https://stackoverflow.com/a/58124273/9450991
>
> To be fair, I think there is some expectation that if you dig up some
> random undocumented class from a codebase that it is probably not
> really public API. People still use private APIs even when they know
> they are private if it's the only thing that can solve their problem.
> I'm not saying we shouldn't be clear about this, especially given the
> discussions around backwards compatibility breaks, but the main signal
> I would take from this is that something like this would be useful to
> have in the public API, even if it isn't this specific class.

Well PolyMatrix is now just a wrapper around DomainMatrix which is
documented and has well-defined behaviour. So DomainMatrix can be used
directly although it is less convenient.

Someone could take PolyMatrix and make it work better but I think that
actually what is needed is a Matrix class that can be used in place of
both PolyMatrix and normal Matrix. Basically a wrapper around
DomainMatrix where you can specify the domain but it has the
convenient usability of the other Matrix classes (e.g. element access
gives Expr).

So far I've been focussing on uniting/removing matrix classes rather
than adding new ones though. As of 1.9 the RawMatrix and NewMatrix
classes are removed (DomainMatrix used instead) and PolyMatrix,
Matrix, ImmutableMatrix, SparseMatrix and ImmutableSparseMatrix are
all just wrappers around the DomainMatrix class. None of those changes
affects public API but introducing a new public matrix class is a
significant API change that should be considered carefully because it
could lead to a lot of user confusion.

Actually I just realised that RawMatrix is not actually removed. It's
not used anywhere any more but it's still there although it will give
a DeprecationWarning. That's another example of overthinking these
things: adding a DeprecationWarning for a broken internal undocumented
class that barely works and that no one should be using.

--
Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxT7yZMPRYhZbXHdjSCA%3Do74YSnj_3WUwC5jhZFwxHqXrg%40mail.gmail.com.

Reply via email to