diff --git a/docs/conf.py b/docs/conf.py index e9ffff96..cc6c3271 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ from _extend_docstrings import extend_docstrings # noqa: PLC2701 -def pick_newtype_attrs(some_type: type) -> list: +def __get_newtypes(some_type: type) -> list: return [ attr for attr in dir(some_type) @@ -278,25 +278,20 @@ def pick_newtype_attrs(some_type: type) -> list: nb_execution_show_tb = True nb_execution_timeout = -1 nb_output_stderr = "remove" - - -nitpick_temp_names = [ - *pick_newtype_attrs(EdgeQuantumNumbers), - *pick_newtype_attrs(NodeQuantumNumbers), -] -nitpick_temp_patterns = [ - (r"py:(class|obj)", r"qrules\.quantum_numbers\." + name) - for name in nitpick_temp_names -] nitpick_ignore_regex = [ (r"py:(class|obj)", "json.encoder.JSONEncoder"), + (r"py:(class|obj)", r"frozendict(\.frozendict)?"), (r"py:(class|obj)", r"qrules\.topology\.EdgeType"), (r"py:(class|obj)", r"qrules\.topology\.KT"), (r"py:(class|obj)", r"qrules\.topology\.NewEdgeType"), (r"py:(class|obj)", r"qrules\.topology\.NewNodeType"), (r"py:(class|obj)", r"qrules\.topology\.NodeType"), (r"py:(class|obj)", r"qrules\.topology\.VT"), - *nitpick_temp_patterns, + *[ + (r"py:(class|obj)", r"qrules\.quantum_numbers\." + name) + for name in __get_newtypes(EdgeQuantumNumbers) + + __get_newtypes(NodeQuantumNumbers) + ], ] nitpicky = True primary_domain = "py" diff --git a/src/qrules/topology.py b/src/qrules/topology.py index 6f263650..bb69981b 100644 --- a/src/qrules/topology.py +++ b/src/qrules/topology.py @@ -50,7 +50,7 @@ def __lt__(self, other: Any) -> bool: ... @total_ordering class FrozenDict(frozendict, Generic[KT, VT]): - """A sortable version of `frozendict _`.""" + """A sortable version of :code:`frozendict`.""" def _repr_pretty_(self, p: PrettyPrinter, cycle: bool) -> None: class_name = type(self).__name__