- Notifications
You must be signed in to change notification settings - Fork15
Closed
Labels
Description
This works fine:gb.op.plus_times(m @ m.T) and a nice view of the expression shows up in the notebook.
But without inclusion in the semiring,m @ m.T gets into a state where it knows it is a MatrixExpression, but the formatter gives it an invalid keyword argument.
>>>m @m.TTypeErrorTraceback (mostrecentcalllast)File~/miniconda3/envs/graphblas-local/lib/python3.9/site-packages/IPython/core/formatters.py:343,inBaseFormatter.__call__(self,obj)341method=get_real_method(obj,self.print_method)342ifmethodisnotNone:-->343returnmethod()344returnNone345else:File~/Projects/graphblas/python-graphblas/graphblas/core/expr.py:525,inInfixExprBase._repr_html_(self)523returnformatting.format_vector_infix_expression_html(self)524ifself.output_type.__name__=="MatrixExpression":-->525returnformatting.format_matrix_infix_expression_html(self)526returnformatting.format_scalar_infix_expression_html(self)File~/Projects/graphblas/python-graphblas/graphblas/core/formatting.py:828,informat_matrix_infix_expression_html(expr)822expr_html=expr._format_expr_html()823header=create_header_html(824expr_html,825 ["nrows","ncols","right_dtype","left_dtype"],826 [expr._nrows,expr._ncols,expr.left.dtype,expr.right.dtype],827 )-->828return_format_infix_expression(expr,header,expr_html)File~/Projects/graphblas/python-graphblas/graphblas/core/formatting.py:714,in_format_infix_expression(expr,header,expr_name)708computed=""709ifconfig.get("autocompute")and (710expr.method_namenotin {"ewise_add","ewise_mult"}711orexpr.left.dtype==BOOL712andexpr.right.dtype==BOOL713 ):-->714computed=get_expr_result(expr,html=True)715if"__EXPR__"incomputed:716returncomputed.replace("<tt>__EXPR__</tt>",topline)File~/Projects/graphblas/python-graphblas/graphblas/core/formatting.py:516,inget_expr_result(expr,html)514val.name="Result"515ifhtml:-->516arg_string=f"{val._repr_html_(expr=expr)}"517else:518arg_string=val.__repr__(expr=expr)TypeError:_repr_html_()gotanunexpectedkeywordargument'expr'