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

in show, use StringView not String #248

Merged
merged 1 commit into from
Jun 21, 2019

Conversation

ThomasBreuer
Copy link
Member

I think that the show method for GAP objects fits better to GAP's ViewObj than to String.
Ideally, ViewString should be called but this is not (yet) supported for enough GAP objects.
Thus StringView is a reasonable temporary alternative.
(Cf. gap-packages/JupyterKernel#104.)

@codecov
Copy link

codecov bot commented Jun 7, 2019

Codecov Report

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

@@           Coverage Diff           @@
##           master     #248   +/-   ##
=======================================
  Coverage   70.07%   70.07%           
=======================================
  Files          50       50           
  Lines        3262     3262           
=======================================
  Hits         2286     2286           
  Misses        976      976
Impacted Files Coverage Δ
src/gap2.jl 46% <100%> (ø) ⬆️

@ThomasBreuer
Copy link
Member Author

One of the Travis tests failed, due to a change of a type name in AbstractAlgebra:
MatSpaceElem instead of Mat.
The other tests succeeded, they seem to use an older version of AbstractAlgebra.
At the moment, I see no way to get a consistent output.
(Should I better avoid showing type names in tests?)

@mohamed-barakat
Copy link
Contributor

(Should I better avoid showing type names in tests?)

@ThomasBreuer: Yes, maybe this is a good idea for the moment.

@ThomasBreuer
Copy link
Member Author

@mohamed-barakat
Note that @fingolfin has already disabled the tests in question, as a part of pull request #253.

For the future, I would still like to have some check whether a Julia object created in a specific conversion is reasonable.
If the typeof string is not reliable then a compromise would be to check for a supertype, using isa, and to hope that the names of these supertypes are stable.
(This has nothing to do with type stability, just type name stability.)

For example, a matrix m in AbstractAlgebra and Nemo can be detected with isa( m, MatElem ).
There seem to be no general functions such as ismatrix.

@mohamed-barakat
Copy link
Contributor

I think that the show method for GAP objects fits better to GAP's ViewObj than to String.
Ideally, ViewString should be called but this is not (yet) supported for enough GAP objects.
Thus StringView is a reasonable temporary alternative.
(Cf. gap-packages/JupyterKernel#104.)

I was unaware of StringView and for me it seems like the correct choice anyway.

@mohamed-barakat
Copy link
Contributor

I rebased this PR locally and it works perfectly for me.

Copy link
Contributor

@mohamed-barakat mohamed-barakat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved once rebased.

@mohamed-barakat
Copy link
Contributor

May I resolve by rebasing and force-pushing?

@ThomasBreuer ThomasBreuer merged commit 4848dc2 into oscar-system:master Jun 21, 2019
@ThomasBreuer ThomasBreuer deleted the TB_show_StringView branch June 21, 2019 13:09
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

Successfully merging this pull request may close these issues.

2 participants