-
Notifications
You must be signed in to change notification settings - Fork 22
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
for backward compatibility, reintroduce julia_to_gap
#1056
Conversation
- provide generic methods that delegate to `GapObj_internal` - add tests - move an `end` of a `@testset` to a better place
src/julia_to_gap.jl
Outdated
julia_to_gap(obj::Any) = GapObj_internal(obj, nothing, Val(false)) | ||
julia_to_gap(obj::Any; recursive::Bool) = julia_to_gap(obj) |
There was a problem hiding this comment.
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
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)) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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`
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
|
genericjulia_to_gap
methods that delegate toGapObj_internal
, in order to get the same behaviour forjulia_to_gap
as before the switch toGapObj_internal
recursive
value in order to either convert the matrix entries or not, as requested,julia_to_gap
for the conversions promised in the documentation,end
of a@testset
to a better place,FFE
in the documentation, notGapFFE