Skip to content

Pretty printing of distributions doesn't work as expected under Node 12 #933

Description

@null-a

We rely on Node's custom inspect method mechanism to pretty print distributions, but it looks like this stopped working since around Node v12. The most noticeable effect of this is that when running a program such as Infer(flip) at the command line, the output will be something like {"probs":[0.5,0.5],"support":[false,true]} rather than:

Marginal:
    false : 0.5
    true : 0.5

It doesn't appear as though this machinery has been removed from Node entirely, so it might be possible to update our code to work with recent releases. (We'd probably also want to support Node < v12 too if possible.) Alternatively, we might be able to workaround this by manually calling inspect() when present on any object returned as the result of a program or passed to display(...).

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions