GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — _repr_html_ broken for `m @ m.T` · Issue #416 · python-graphblas/python-graphblas

_repr_html_ broken for m @ m.T #416

New issue
Copy link
New issue
Copy link
Closed
#418
Closed
_repr_html_ broken for m @ m.T#416
#418
Copy link
Labels
bugSomething is brokenSomething is broken

Description

@jim22k
jim22k
opened on Mar 27, 2023
Issue body actions

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.T
TypeError                                 Traceback (most recent call last)
File ~/miniconda3/envs/graphblas-local/lib/python3.9/site-packages/IPython/core/formatters.py:343, in BaseFormatter.__call__(self, obj)
    341     method = get_real_method(obj, self.print_method)
    342     if method is not None:
--> 343         return method()
    344     return None
    345 else:

File ~/Projects/graphblas/python-graphblas/graphblas/core/expr.py:525, in InfixExprBase._repr_html_(self)
    523     return formatting.format_vector_infix_expression_html(self)
    524 if self.output_type.__name__ == "MatrixExpression":
--> 525     return formatting.format_matrix_infix_expression_html(self)
    526 return formatting.format_scalar_infix_expression_html(self)

File ~/Projects/graphblas/python-graphblas/graphblas/core/formatting.py:828, in format_matrix_infix_expression_html(expr)
    822 expr_html = expr._format_expr_html()
    823 header = create_header_html(
    824     expr_html,
    825     ["nrows", "ncols", "right_dtype", "left_dtype"],
    826     [expr._nrows, expr._ncols, expr.left.dtype, expr.right.dtype],
    827 )
--> 828 return _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)
    708 computed = ""
    709 if config.get("autocompute") and (
    710     expr.method_name not in {"ewise_add", "ewise_mult"}
    711     or expr.left.dtype == BOOL
    712     and expr.right.dtype == BOOL
    713 ):
--> 714     computed = get_expr_result(expr, html=True)
    715     if "__EXPR__" in computed:
    716         return computed.replace("<tt>__EXPR__</tt>", topline)

File ~/Projects/graphblas/python-graphblas/graphblas/core/formatting.py:516, in get_expr_result(expr, html)
    514 val.name = "Result"
    515 if html:
--> 516     arg_string = f"{val._repr_html_(expr=expr)}"
    517 else:
    518     arg_string = val.__repr__(expr=expr)

TypeError: _repr_html_() got an unexpected keyword argument 'expr'

Activity

  1. eriknw
    added
    bugSomething is brokenSomething is broken
    on Mar 28, 2023
  2. eriknw
    closed this as completedin #418on Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is brokenSomething is broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.