-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Categories for extension types via __getattr___ #7921
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
All tests seem to pass with it on 4.3; I still need to double check a couple things. It does change things in many places; so the best would be to integrate it in the early phase of 4.3.2 before it rots away. Early feedback welcome! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:4
The patch passes all tests with sage 4.3 + sage-combinat patches merged in 4.3.1 on my machine. I'll run sage -t -long tonight and report. |
comment:5
Hi Robert; I improved a bit TestSuite to catch more. Should I add a second patch to this one, |
This comment has been minimized.
This comment has been minimized.
Reviewer: Robert Bradshaw |
comment:6
Robert: please let me know if I should open a separate ticket for the second patch. Florent can probably review it if this can save you some time. |
Attachment: categories_testsuite-nt.patch.gz Patch 2: stronger category tests |
comment:7
The attribute lookup code looks good. Most of the other changes are minor, though changing loads/dumps to running tests is an independent change is seems. sage/groups/group.pyx
Groups are not yet converted over to the new coercion model, and are a mess in general. In sage/modular/abvar/abvar.py, you removed the method but kept the docstring floating there. Those tests should be kept, but probably not put there. sage/modules/free_module.py - It'd be good to test the category of non-vector space. Could you explain the changes to sage/structure/sage_object.pyx? |
comment:8
I didn't look much at the second patch, but this should almost certainly be a second ticket. |
comment:9
Replying to @robertwb:
Ok, will do. Florent volunteered to review it, since it's mostly about testsuites and categories. |
comment:10
Replying to @robertwb:
Well, I actually only added 2/3 of them, mostly as an attempt to catch possible introduced issues. The others were already there, and needed to be updated due to all the new (often failing) tests coming from categories.
Ok. Shouldn't this def be removed, so as not to prevent groups inheriting from Group to progressively get converted to the coercion model? Sure, that should be a separate patch. As for the comment above: I just can't prevent myself from adding comments in the code when I stumble on strange stuff. I can remove it if you prefer.
Oops, fixed.
Done.
I improved the description on top of the patch, including a comment about this. |
comment:11
Replying to @nthiery:
This is now #8001 (darn, missed, that was sooo close from #8000!) |
comment:12
Replying to @nthiery:
OK.
Eventually, for sure.
No, comments like this are good. I was just somewhat answering your question.
Thanks. Look forward to being able to do stuff like this. On a somewhat related note, you might be interested in the binop decorator at #383. |
comment:13
Thanks Robert for the quick review! I am looking forward feedback from practical uses :-) Thanks also for the pointer to #383 |
Rebased and updated one doctest for 4.3.1 + micro fix in the primer. Apply only this one. |
Merged: sage-4.3.2.alpha0 |
comment:14
Attachment: trac_7921-categories_for_extension_types-nt.patch.gz |
comment:15
I have a question regarding this old ticket. The following fails:
The reason for this is that
I get a
Anyway, I'm getting the feeling that such inheritance does not happen anywhere (partly because most element classes are extension classes). The methods from the element_class are available anyway (just like for extension classes). So is it safe to remove this check from
into
|
comment:16
Replying to @saraedum:
If it's not an extension type, it really should inherit Most likely the issue here is that the category is not specified
Most of my bread and butter element classes are not extension
Please don't: so far failures here have always pointed to actual bugs. Cheers, |
comment:17
Thanks for your explanation. |
With this patch, all parents and elements can inherit code from categories, even extension types. This includes in particular
generic tests (see TestSuite(...).run()):
It is to be expected that this will catch bugs in many places in the library. To start with, see #7922, #7929, #7945, #7946
See patch description for details.
Patch also available on the sage-combinat server, with a +category guard: http://combinat.sagemath.org/hgwebdir.cgi/patches/file/tip/trac_7921-categories_for_extension_types-nt.patch
CC: @sagetrac-sage-combinat @mwhansen @robertwb @roed314
Component: categories
Author: Nicolas M. Thiéry
Reviewer: Robert Bradshaw
Merged: sage-4.3.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/7921
The text was updated successfully, but these errors were encountered: