Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Address various issues #50

Merged
merged 30 commits into from
Sep 30, 2021
Merged

Conversation

@codecov
Copy link

codecov bot commented Sep 25, 2021

Codecov Report

Merging #50 (5ee2132) into master (dd5ad9f) will increase coverage by 0.18%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
+ Coverage   98.68%   98.87%   +0.18%     
==========================================
  Files           4        4              
  Lines         229      266      +37     
==========================================
+ Hits          226      263      +37     
  Misses          3        3              
Impacted Files Coverage Δ
src/AttributesAndMethods.jl 100.00% <100.00%> (ø)
src/ToricDivisors.jl 100.00% <100.00%> (ø)
src/ToricVarieties.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd5ad9f...5ee2132. Read the comment docs.

# Examples
```julia-repl
julia> hirzebruch_surface( 5 )
NormalToricVariety(GAP: <A toric variety of dimension 2>, Polymake.BigObjectAllocated(Ptr{Nothing} @0x0000562fbcc21b70))
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps install a nicer show method for NormalToricVariety

"""
function del_pezzo( b::Int )
if b < 0
@warn("Number of blowups for construction of delPezzo surfaces must be non-negative.")
Copy link
Member

Choose a reason for hiding this comment

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

So why only a warning, not an error?

end
if b > 3
@warn("delPezzo surfaces with more than 3 blowups are realized as subvarieties of toric ambient spaces. This is currently not supported.")
return 0
Copy link
Member

Choose a reason for hiding this comment

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

Again, why warn instead of error? This breaks type stability of this function

@@ -61,6 +64,14 @@ using Test
@test ith_betti_number( H5, 4 ) == 1
@test nr_of_q_rational_points( H5, 1 ) == 4

# Construct delPezzo surfaces
del_pezzo( -1 )
Copy link
Member

Choose a reason for hiding this comment

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

There should be a way to test that this throws an error. In Oscar I saw something called @test_throws with a quick grep.


Checks if the normal toric variety `v` is normal. (This function is somewhat tautological at this point.)

# Examples
```julia-repl
julia> is_normal_variety( projective_space( 2 ) )
julia> is_normal_variety(projective_space( 2 ))
Copy link
Member

Choose a reason for hiding this comment

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

So I don't mind how you do it, but isn't this inconsistent again? I'd either do this (GAP style)

Suggested change
julia> is_normal_variety(projective_space( 2 ))
julia> is_normal_variety( projective_space( 2 ) )

Or more likely (if I did it, I mean) in Julia style:

Suggested change
julia> is_normal_variety(projective_space( 2 ))
julia> is_normal_variety(projective_space(2))

false
```
"""
function is_affine( v::normalToricVariety )
function is_affine( v::NormalToricVariety )
return v.polymakeNTV.AFFINE
Copy link
Member

Choose a reason for hiding this comment

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

Is this a always a boolean? Perhaps help the compiler via an annotation:

Suggested change
return v.polymakeNTV.AFFINE
return v.polymakeNTV.AFFINE::Bool

#end
#export underlying_sheaf


struct NefCone
polymakeNefCone::Polymake.BigObject
Copy link
Member

Choose a reason for hiding this comment

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

Why is this indented differently than the functions in this file?

"""
mori_cone( v::NormalToricVariety )

Computes the mori cone of the normal toric variety `v`.
Copy link
Member

Choose a reason for hiding this comment

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

Is it really mori cone, not a Mori cone?


Compute the i-th Betti number of the normal toric variety `v`.
"""
function ith_betti_number( v::normalToricVariety, i::Int )
function ith_betti_number( v::NormalToricVariety, i::Int )
return GAP.Globals.ithBettiNumber( v.GapNTV, GapObj( i ) )::Int
Copy link
Member

Choose a reason for hiding this comment

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

Note that the GapObj is not necessary here, an Int can always be passed to a GAP function

@fingolfin
Copy link
Member

@HereAround BTW, I am also willing to make some of the changes I suggest -- just let me know if you agree with the suggestion, and whether it is OK to change it, then I can push corresponding changes here. That may be more efficient.

@HereAround
Copy link
Member Author

@fingolfin Sure.

  • Nicer show method: If this is quick, we can of course add it here. [As we are at it - we would also need a nicer show method for toric divisors.] Otherwise, I suggest to open a new issue an then address this separately.
  • Other than that - I completely agree with all your suggestions.

@lkastner
Copy link
Member

There is a show method in my PR that comes after this.

@fingolfin
Copy link
Member

I'll merge this so that @lkastner PR can be rebased if needed, and will submit my tweaks in a separate PR.

@fingolfin fingolfin merged commit 1b7bbfb into oscar-system:master Sep 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for more Polymake functionality Add constructors for Hirzebruch and del Pezzo surfaces
3 participants