gap-packages / JupyterKernel

Native Jupyter kernel for GAP
https://gap-packages.github.io/JupyterKernel/
BSD 3-Clause "New" or "Revised" License
19 stars 12 forks source link

prefer `ViewObj` to `ViewString` (temporarily) #104

Closed ThomasBreuer closed 3 years ago

ThomasBreuer commented 5 years ago

In JupyterRender, call StringView (which is based on ViewObj) instead of ViewString (for which many methods are missing). This makes GAP's Jupyter kernel more useful. Here is a typical example.

gap> obj:= End( GF(2), GF(2)^2 );
End( GF(2), ( GF(2)^2 ) )
gap> ViewString( obj );
"<monoid>"
gap> StringView( obj );
"End( GF(2), ( GF(2)^2 ) )"
codecov[bot] commented 5 years ago

Codecov Report

Merging #104 into master will not change coverage. The diff coverage is 100%.

@@          Coverage Diff           @@
##           master    #104   +/-   ##
======================================
  Coverage    71.9%   71.9%           
======================================
  Files          14      14           
  Lines         865     865           
======================================
  Hits          622     622           
  Misses        243     243
Impacted Files Coverage Δ
gap/JupyterRenderable.gi 100% <100%> (ø) :arrow_up:
olexandr-konovalov commented 3 years ago

@ThomasBreuer sorry, did not tend to PRs here for a while. This may be a good idea. Of course, one could have issues like https://github.com/gap-system/gap/issues/2658 but then the workaround of not displaying an object sometimes is easier than workaround of using Print multiple times.

I am going to test this on some of my notebooks to see how widely they will differ. But I guess with https://github.com/oscar-system/GAP.jl/pull/248 merged for 2 years already, this PR should undoubtedly be merged, and it will be also useful to unify the behaviour in GAP and OSCAR.