From: Michael Orlitzky Date: Sat, 21 Feb 2026 14:30:04 +0000 (-0500) Subject: mjo/clan/clan_operator.py: god-awful hack for category check X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=9fc0c8b9278dbdd08db971890e2ed9ae2670dcbb;p=sage.d.git mjo/clan/clan_operator.py: god-awful hack for category check --- diff --git a/mjo/clan/clan_operator.py b/mjo/clan/clan_operator.py index 82c0639..dd57f43 100644 --- a/mjo/clan/clan_operator.py +++ b/mjo/clan/clan_operator.py @@ -1,6 +1,14 @@ from sage.categories.all import FreeModules from sage.categories.map import Map +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""" An operator between two clans. @@ -30,11 +38,9 @@ class ClanOperator(Map): """ def __init__(self, domain, codomain, mat): - from mjo.clan.clan import Clans - - if not domain in Clans: + if not _is_clan(domain): raise TypeError("domain must be a clan") - if not codomain in Clans: + if not _is_clan(codomain): raise TypeError("codomain must be a clan") F = domain.base_ring()