Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The pretty-print of a dimension 1-dimension Distribution does not show its parameters #2664

Open
mbaudin47 opened this issue May 24, 2024 · 0 comments

Comments

@mbaudin47
Copy link
Collaborator

mbaudin47 commented May 24, 2024

What is the idea?

When we create a Distribution, we can pretty-print it. This was first developed at #2282, #2447 for ComposedDistribution. But when we print a distribution in dimension 1, then the pretty-print does not show the parameters of the distribution.

Why is this needed?

The parameters are an important part of the distribution. When hidden, lots of informations are lost.

Additional Context

Here is an example:

import openturns as ot

d = ot.Gumbel()
d

This prints:


Gumbel

  • name=Gumbel
  • dimension=1
  • weight=1
  • range=]-inf (-3.47309), (32.2362) +inf[
  • description=[X0]
  • isParallel=true
  • isCopula=false

We can see the type of distribution, but not its parameters.

Instead, the not-so-pretty print works well:

print(d)

This prints:

Gumbel(beta = 1, gamma = 0)

Analysis

The pretty-print feature of a Distribution is available of the code in DistributionImplementation::repr_html(). The limitation is because none of the implementations overload that pretty-print with their own parameters. This implicit choice was made because the current pretty-print shows the attributes of the class: the parameters are not attributes of this generic class.

@mbaudin47 mbaudin47 changed the title The pretty-print of a Distribution does not show its properties. The pretty-print of a dimension 1 Distribution does not show its parameter. May 24, 2024
@mbaudin47 mbaudin47 changed the title The pretty-print of a dimension 1 Distribution does not show its parameter. The pretty-print of a dimension 1 Distribution does not show its parameters May 24, 2024
@mbaudin47 mbaudin47 changed the title The pretty-print of a dimension 1 Distribution does not show its parameters The pretty-print of a dimension 1-dimension Distribution does not show its parameters May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant