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

Restructure relations of LibGAP.jl and JuliaInterface #97

Merged
merged 8 commits into from
Oct 30, 2018

Conversation

sebasguts
Copy link
Contributor

@sebasguts sebasguts commented Oct 25, 2018

  • Made JuliaInterface load the necessary part of LibGAP.jl
  • overhauled GAP.GAPFuncs to dynamically fetch functions from GAP

@codecov
Copy link

codecov bot commented Oct 25, 2018

Codecov Report

Merging #97 into master will increase coverage by 0.13%.
The diff coverage is 68.05%.

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
+ Coverage   51.24%   51.38%   +0.13%     
==========================================
  Files          33       33              
  Lines        1969     1919      -50     
==========================================
- Hits         1009      986      -23     
+ Misses        960      933      -27
Impacted Files Coverage Δ
JuliaInterface/src/JuliaInterface.c 76.21% <ø> (-0.64%) ⬇️
JuliaInterface/src/JuliaInterface.h 100% <ø> (ø) ⬆️
JuliaInterface/gap/BindCFunction.gi 80% <ø> (-7.81%) ⬇️
JuliaExperimental/src/JuliaExperimental.c 100% <ø> (ø) ⬆️
JuliaInterface/example/orbits.jl 0% <0%> (ø) ⬆️
JuliaExperimental/julia/gaprat.jl 65.97% <71.15%> (ø) ⬆️
JuliaInterface/read.g 91.66% <75%> (-8.34%) ⬇️
JuliaInterface/julia/gaptypes.jl 92% <81.81%> (+39.82%) ⬆️
JuliaExperimental/init.g 100% <0%> (ø) ⬆️

@sebasguts sebasguts changed the title WIP: Restructure relations of LibGAP.jl and JuliaInterface Restructure relations of LibGAP.jl and JuliaInterface Oct 25, 2018
@sebasguts
Copy link
Contributor Author

I am still working on this, no need to review right now.

@sebasguts
Copy link
Contributor Author

@fingolfin @ThomasBreuer I am finished with this so far, please have a look.

@ThomasBreuer I think almost all of the ccalls in JuliaExperimental could be removed, and Main.GAP.GAPFuncs.Whatever could be used instead. Please note that in this functions Int64s are handled transparently, which means that you can just pass them to those functions without converting them to GAP integers before.

ThomasBreuer
ThomasBreuer previously approved these changes Oct 29, 2018
Copy link
Member

@ThomasBreuer ThomasBreuer left a comment

Choose a reason for hiding this comment

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

This looks nice.
(Sorry but I do not feel competent to judge about the quality.)
In particular, I will follow the suggestions to replace ccall by direct calls in JuliaExperimental.

Just for curiosity:
You seem to get rid of almost all cases where GET_FROM_GAP is used;
is there a reason to keep it?

@sebasguts
Copy link
Contributor Author

I am currently not sure. I would guess there will be more ccalls in the future, which might require it, too.

I could remove it and just fuse it into the function which it uses, but I see no urgent need to do it, so I left it.

fingolfin
fingolfin previously approved these changes Oct 29, 2018
Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

All in all this seems fine to me, with some minor remarks. I'd feel better if the new code was tested, but given that it was mostly untested before (I think, at least?), I wouldn't want to hold back this PR over it. Though I do think it would be important to work on these tests (and not just to play "increasing coverage" as a number game for itself, but rather because I am genuinely concerned about bugs in some of that code.

If PR #90 is merged soon, it might be interesting to rebase this PR, just to see how much of this code actually is exercised.

(Ptr{Cvoid}, Ptr{Cvoid}), a.obj.ptr, int_ptr ) )
end

function ==( a::Int, b::GAPRat )
int_ptr = ccall( Main.gap_INTOBJ_INT, Ptr{Cvoid}, (Int,), a )
return Bool( ccall( Main.gap_MyFuncEQ, Int,
int_ptr = ccall( :ObjInt_Int, Ptr{Cvoid}, (Int,), a )
Copy link
Member

Choose a reason for hiding this comment

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

Great, it seems you resolve #70

JuliaExperimental/julia/gaprat.jl Show resolved Hide resolved
JuliaExperimental/src/gap_macros.c Show resolved Hide resolved
JuliaInterface/example/orbits.jl Show resolved Hide resolved
JuliaInterface/read.g Show resolved Hide resolved
@sebasguts
Copy link
Contributor Author

Currently, the tests fail with a strange error. I will investigate.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Fine by me now. Feel free to squash my tiny fixup commit. You could also fix the typo "occourences" in one of the commit messages. Or leave it in, nobody will care :)

@@ -12,8 +12,6 @@ import Base: zero, -, one, inv, ==, isless, +, *, //, ^, mod, iszero, string,

import Main.GAP: GapObj

import Main.GAP.GAPFuncs: SUM

Copy link
Member

Choose a reason for hiding this comment

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

I had to add this to make it possible to load this file (good thing we fixed the tests :-)

@sebasguts sebasguts merged commit 4400d9f into oscar-system:master Oct 30, 2018
@sebasguts sebasguts deleted the libgap_restructure branch November 14, 2018 10: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.

3 participants