I'm (somewhat) aware of bugs which come from poor treatment of weighted polynomial rings. In my mind this has two solutions.
1) Someone who is an expert in toric varieties has another look through the current code, adds more extensive testing and methods for computations in the area
2) We work with what we currently have for the hyperelliptic curve case and when something appears to be broken we attempt to fix it.
I am in no position to do 1) as I do not know enough. As a result I will start one 2) but I am happy for more work to be done in parallel?
My current experimentation I believe we want to define the curve in the following way
```
sage: def projective_model(f, h, g):
....: """
....: Compute the weighted projective model (1 : g + 1 : 1)
....: """
....: k = f.base_ring()
....: T = toric_varieties.WP([1, g + 1, 1], base_ring=k, names="X, Y, Z")
....: (X, Y, Z) = T.gens()
....:
....: if h.is_zero():
....: d = f.degree()
....: F = sum(f[i] * X**i * Z**(d - i) for i in range(d + 1))
....: G = Y**2 - F
....: else:
....: d = max(h.degree(), (f.degree() / 2).ceil())
....: H = sum(h[i] * X**i * Z**(d - i) for i in range(d + 1))
....: F = sum(f[i] * X**i * Z**(2*d - i) for i in range(2*d + 1))
....: G = Y**2 + H*Y - F
....:
....: return T.subscheme([G])
....:
sage: f = x^7 + 1
sage: h = x
sage: g = HyperellipticCurve(f, h).genus() # simply make sure this is a "good" choice of f, h for this field
sage: g
3
sage: projective_model(f, h, g)
Closed subscheme of 2-d toric variety covered by 3 affine patches defined by:
-X^7*Z - Z^8 + X*Y*Z^3 + Y^2
```
Which suggests to me that the generic class for hyperelliptic curves is a child class HyperellipticCurve_generic(AlgebraicScheme_subscheme_toric) and we start building this from here.