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

Pipeline representation improvement ideas #136

Open
3 tasks
YooSunYoung opened this issue Feb 20, 2024 · 3 comments
Open
3 tasks

Pipeline representation improvement ideas #136

YooSunYoung opened this issue Feb 20, 2024 · 3 comments

Comments

@YooSunYoung
Copy link
Member

YooSunYoung commented Feb 20, 2024

I came across with some problems and requirements while I was trying to use sl.Pipeline html wrapper in scipp/essnmx
documentation.

Wrong name parsing of NewType in python 3.9 I just saw that this issue was marked as wontfix...! Sorry

  • Dict-like representation of Pipeline. So that it's easier to turn them into a html wrapper or other formats.
  • Pipeline.__repr__. It should be easy if the Dict-like representation is implemented.
  • Customize Value representation. For example, when I have a function it shows the address of the instance not the name of the module and the function. It'll be useful to pass a customizing function by the type.
    i.e.
import sciline as sl
pl = sl.Pipeline()
pl[int] = 0
pl.repr_value_renderer = lambda x: f"number: {x}"
print(pl)
# [ 
#  { 'Name': 'int', 'Value': 'number: 0', 'Source': '' }
# ] 

I'm suggesting this because, we can't handle all different types of providers and values on our own. However, if the Pipeline wrapper doesn't show what I want to show, it's less useful in the documentation.

Maybe it should be discussed together with scipp/scipp#3305

@SimonHeybrock
Copy link
Member

Item one is a wontfix, for the others, does Pipeline._repr_html_ not do the job for you?

@YooSunYoung
Copy link
Member Author

It mostly do, but these ideas started only because nmx workflow has function object as a parameter.
I didn't want to add instance address in the documentation...
And we have __repr__ for most of important data structures, so... why not for Pipeline...?
It'll make logging much easier.

@jl-wynen
Copy link
Member

Item 4 should be improved by the new utils in #124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants