A good first step might be to ban new circular imports, but that means
that e.g. parent structures and their element classes would need to be
defined in the same files for things like
class FooElement(...):
pass
class Foo(...):
Element = FooElement
to work. And I'm sure that's not the only widespread antipattern that
will be uncovered.
--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/7c3e1653-b279-9f43-03e8-3f03c682fdf8%40orlitzky.com.
I propose the following goal for Sage 9.3.
Le 04/05/2020 à 02:27, Michael Orlitzky a écrit :
> On 5/3/20 8:09 PM, Matthias Koeppe wrote:
>> I propose the following goal for Sage 9.3.
>>
>> Modularize sagelib so that individual parts of it can be built and run
>> with a much smaller set of libraries.
>
> it's going to be difficult given the widespread use of
> lazy_import to create circular references. We're probably looking at a
> lot of refactoring before any useful modules can be excised.
>
> A good first step might be to ban new circular imports, but that means
> that e.g. parent structures and their element classes would need to be
> defined in the same files
The category framework can not really be separated from the
Parent/Element/CategoryObject (e.g. coercion is involved in
comparisons and binary operations).
And the former can not
live without the integers (e.g. the output of .cardinality()
expects an integer).
More dramatically, in sage.categories
bimodules imports QQ, RR
classical_crystals imports SR
finite_coxeter_groups imports QQbar
One can try to not populate the whole category system.
Given the current status of the library, I don't think this
is reasonable to state it as a milestone goal. But still, it
is desirable to introduce modularity. Starting with a
sage-core / sage-rest would be nice.
In general I worry about rules that prevent us from breaking up large source files into pieces.
I propose the following goal for Sage 9.3.Modularize sagelib so that individual parts of it can be built and run with a much smaller set of libraries.In particular, create a package "sage_objects" that makes Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available.
I propose the following goal for Sage 9.3.Modularize sagelib so that individual parts of it can be built and run with a much smaller set of libraries.In particular, create a package "sage_objects" that makes Sage objects, the element/parent framework, categories, the coercion system and the related metaclasses available. This package would, for example, not provide or know about integers, polynomials, or matrices (thus avoiding all the dependencies on the various libraries implementing these). Ideally it would only have a build dependency on Cython and no runtime dependencies.(Doctesting sage_objects would still need more of Sage, but some it could also be done by mocking instead of with the real classes.)