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

for backward compatibility, reintroduce julia_to_gap #1056

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

ThomasBreuer
Copy link
Member

@ThomasBreuer ThomasBreuer commented Oct 1, 2024

  • provide generic julia_to_gap methods that delegate to GapObj_internal, in order to get the same behaviour for julia_to_gap as before the switch to GapObj_internal
  • fix the conversion rule for matrices: call the conversion of the row objects with the given recursive value in order to either convert the matrix entries or not, as requested,
  • add tests for julia_to_gap for the conversions promised in the documentation,
  • move an end of a @testset to a better place,
  • and use the term FFE in the documentation, not GapFFE

- provide generic methods that delegate to `GapObj_internal`
- add tests
- move an `end` of a `@testset` to a better place
Comment on lines 355 to 356
julia_to_gap(obj::Any) = GapObj_internal(obj, nothing, Val(false))
julia_to_gap(obj::Any; recursive::Bool) = julia_to_gap(obj)
Copy link
Member

Choose a reason for hiding this comment

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

Julia doesn't use kwargs for dispatch. The dispatcher can therefore not distinguish these two.
Solution: unify into one method with a default kwarg value

Suggested change
julia_to_gap(obj::Any) = GapObj_internal(obj, nothing, Val(false))
julia_to_gap(obj::Any; recursive::Bool) = julia_to_gap(obj)
julia_to_gap(obj::Any; recursive::Bool=false) = GapObj_internal(obj, nothing, Val(false))

Copy link
Member

Choose a reason for hiding this comment

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

Why do we not honor recursive ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right.
We do not just want to have the generic methods but also the "old" behaviour for vectors, matrices, etc.
I will update the pull request.

- change the `julia_to_gap` methods such that `GapObj_internal`
  gets called with the same `recursive` value;
  this way, we get the same behaviour for `julia_to_gap` as before
  the switch to `GapObj_internal`,
- extend the tests of the backwards compatibility to the conversions
  promised in the documentation,
- fix the conversion rule for matrices:
  call the conversion of the row objects with the given `recursive` value
  in order to convert the matrix entries or not, as requested,
- and use the term `FFE` in the documentation, not `GapFFE`
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.92%. Comparing base (5ba3c3f) to head (4ffb34c).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1056      +/-   ##
==========================================
- Coverage   74.98%   74.92%   -0.06%     
==========================================
  Files          55       55              
  Lines        4549     4551       +2     
==========================================
- Hits         3411     3410       -1     
- Misses       1138     1141       +3     
Files with missing lines Coverage Δ
pkg/JuliaInterface/gap/convert.gd 100.00% <ø> (ø)
src/gap_to_julia.jl 89.78% <ø> (ø)
src/julia_to_gap.jl 99.25% <100.00%> (+0.76%) ⬆️

... and 1 file with indirect coverage changes

@fingolfin fingolfin merged commit 7d1ab87 into oscar-system:master Oct 21, 2024
21 checks passed
@ThomasBreuer ThomasBreuer deleted the TB_reenable_julia_to_gap branch October 21, 2024 13:54
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