ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 15 Nov 2019 20:48:37 +0100Parentmethods for subcategories obtained from Functorial Constructionshttps://ask.sagemath.org/question/48765/parentmethods-for-subcategories-obtained-from-functorial-constructions/In a related question to
https://ask.sagemath.org/question/48756/do-covariant-constructions-commute-with-withbasis/
I have a category `Cs` which implements the axiom `FinitelyGeneratedAsCs`. I want to define parent methods for graded objects of `Cs`. Some of these apply for all objects, some only for the finitely generated ones. If I have a design sketched as
<pre><code>
class Cs(Category_over_base_ring):
class Subcategorymethods:
def Graded(self):
return GradedModules.category_of(self)
def FinitelyGenerate(self):
return self._with_axiom("FinitelyGeneratedAsCs")
class Graded(GradedModulesCategory):
class ParentMethods:
def some_method_for_all_parents(self)
class FinitelyGeneratedAsCs(CategoryWithAxiom_over_base_ring):
class Graded(GradedModulesCategory):
class ParentMethods:
def some_method_only_for_fg_graded_parents(self):
</code></pre>
Then I receceive
<pre><code>sage: Cs(QQ).FinitelyGenerated().Graded()
TypeError: Graded() takes exactly 1 argument (2 given)
</code></pre>
If I however implement `Graded` as an axiom, say `FakeGraded` then I can set up parent methods as described above (just need to add a call to `self._with_axiom('FakeGraded')` in the appropriate place. I thought however that to have better integration with other parts of Sage I should implement Graded as the functorial construction in `GradedModulesCategory` but I'm hitting the above error. Fri, 15 Nov 2019 20:48:37 +0100https://ask.sagemath.org/question/48765/parentmethods-for-subcategories-obtained-from-functorial-constructions/