Dear all,
I have a problem with the interaction of `TestSuite` and some_elements. Let me illustrate the problem by example. Below is the definition of `_test_graded_components`, which looks reasonable. However, for some `SetsWithGrading`, the grading set' `some_elements` yields degrees which are way too large.
E.g., AtomicSpecies("X") is graded by `IntegerVectors(1)`, where `some_elements` yields the first 100 integers. Constructing `AtomicSpecies("X").graded_component([8])` takes already a few seconds.
Is the intention to make `graded_component` always return a lazy set?
Martin
def _test_graded_components(self, **options):
r"""
Test that some graded components of ``self`` are parent with
initialized category and that the parent has a properly implemented
``grading()`` method.
EXAMPLES::
sage: SetsWithGrading().example()._test_graded_components()
"""
tester = self._tester(**options)
for grade in self.grading_set().some_elements():
G = self.graded_component(grade)
if self in EnumeratedSets():
tester.assertIn(G, EnumeratedSets())
else:
tester.assertIn(G, Sets())
for elt in G.some_elements():
tester.assertEqual(self.grading(elt), grade)