sagemath/sage

Avoid ceil, floor from sage.functions.other in non-symbolic uses

Closed this issue · 16 comments

floor(.../...) can be rewritten as integer division ...//...

Other uses can be replaced by integer_ceil, integer_floor from sage.arith.misc

Depends on #32717

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 33a2e7b

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/32731

Dependencies: #32717

Branch pushed to git repo; I updated commit sha1. New commits:

00f5615src/sage/graphs/hyperbolicity.pyx: Remove unused import
27b44b9src/sage/modular/pollack_stevens/dist.pyx: Remove unused import
7f1d021src/sage/quadratic_forms/ternary.pyx: Remove unused import
d5cfe2asrc/sage/combinat/crystals/tensor_product_element.pyx: Remove unused import
d825aa8src/sage/combinat/crystals/littelmann_path.py: Use integer_floor instead of sage.functions.other.floor
9c35213src/sage/combinat/diagram_algebras.py: Use integer_floor, integer_ceil instead of importing from sage.functions
57551d3src/sage/graphs/generic_graph.py: Use integer_floor instead of sage.functions.other.floor

Author: Matthias Koeppe

comment:5

LGTM.

Reviewer: Travis Scrimshaw

comment:6

Thank you!

Changed commit from 57551d3 to bed7308

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

bed7308src/sage/geometry/polyhedron/base.py: Remove stray character

Changed commit from bed7308 to 33a2e7b

Branch pushed to git repo; I updated commit sha1. New commits:

33a2e7bsrc/sage/geometry/polyhedron/base.py: Fix up imports
comment:9

Waiting for another round of the patchbot.

comment:10

The failure in src/sage/libs/flint/nmod_poly_linkage.pxi seems unrelated.

comment:11

Thank you (again)!