From 245f6375842606e82c8e6c1a458ac40bf83ff6df Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 21 Feb 2026 10:25:52 -0500 Subject: [PATCH] mjo/clan/clan_operator.py: undo _is_clan() hack And just like that, it starts working for no reason. --- mjo/clan/clan_operator.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mjo/clan/clan_operator.py b/mjo/clan/clan_operator.py index a738d22..9f689e5 100644 --- a/mjo/clan/clan_operator.py +++ b/mjo/clan/clan_operator.py @@ -1,13 +1,6 @@ from sage.categories.map import Map from sage.categories.modules_with_basis import ModulesWithBasis -def _is_clan(x): - r""" - I'm sure there's a great reason why this basic functionality - doesn't work, but I don't have the time to waste right now. - """ - return any( str(c).startswith("Category of clans") - for c in x.categories() ) class ClanOperator(Map): r""" @@ -38,9 +31,12 @@ class ClanOperator(Map): """ def __init__(self, domain, codomain, mat): - if not _is_clan(domain): + from mjo.clan.clan import Clans + + # Uses __classcontains__ hack for parametrized categories + if not domain in Clans: raise TypeError("domain must be a clan") - if not _is_clan(codomain): + if not codomain in Clans: raise TypeError("codomain must be a clan") F = domain.base_ring() -- 2.51.0