ReadVTK.jl icon indicating copy to clipboard operation
ReadVTK.jl copied to clipboard

Show method strings for many objects are overly terse

Open williamjsdavis opened this issue 1 year ago • 1 comments

As a new user of the package, I was surprised by the REPL show method results for many objects in this package. Upon loading creating a VTKData object, the displayed string in the REPL read "VTKData()", making me think that I had incorrectly loaded my file and the object was empty. Only upon running the dump function on the object did I then see that I had, in fact, loaded the file correctly.

In this package, VTKFile objects have an informative show method:

https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L169-L180

Slightly similarly, VTKDataArray objects have a show method that is slightly helpful: https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L657-L659

On the other hand, the following objects have REPL show methods that I believe to be too terse:

PVTKFile objects

https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L278-L280

PVDFile objects:

https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L346-L348

VTKData objects:

https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L372

PVTKData objects:

https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L388

PVTKDataArray objects:

https://github.com/JuliaVTK/ReadVTK.jl/blob/09aea36c6eb100c5318291e97e84c309909678a6/src/ReadVTK.jl#L573

Reason changes should be made

Informative show methods help new users understand the functionality of the package, and help debugging.

Suggested changes

I suggest that the show methods for the above listed objects should show short, informative summaries. I think it's open to discussion exactly what information should be shown.

williamjsdavis avatar Jul 18 '24 19:07 williamjsdavis

Sounds reasonable. If you make a PR, we will be happy to review it and assist you.

ranocha avatar Jul 25 '24 09:07 ranocha