I ended up doing the following:
from sage.geometry.newton_polygon import NewtonPolygon
R.<x,y> = PolynomialRing(QQbar,2,order='invlex')
def facets(f):
NP = NewtonPolygon(f.newton_polytope())
slopes = NP.slopes(repetition=False)
weights = [(numerator(abs(slope)),denominator(abs(slope))) for slope in slopes]
facets = []
for w in weights:
S.<x,y> = PolynomialRing(QQbar,'x,y',order=TermOrder('wdeglex',w))
f = S(f)
jw = f.homogeneous_components()
j = jw[sorted(jw)[0]]
facets.append(j)
return facets,weights
f = x*y*(x+y)^2 + y^7 + x^5
facets,_ = facets(f)
print(facets)
which prints:
[x*y^3 + y^7, x^3*y + 2*x^2*y^2 + x*y^3, x^5 + x^3*y]
Though I am not sure if this is best practice.