From 9fc0c8b9278dbdd08db971890e2ed9ae2670dcbb Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 21 Feb 2026 09:30:04 -0500 Subject: [PATCH] mjo/clan/clan_operator.py: god-awful hack for category check --- mjo/clan/clan_operator.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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() -- 2.51.0