Skip to content

Commit

Permalink
Replace relative cimports
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Sep 8, 2023
1 parent 882507f commit dfceb98
Show file tree
Hide file tree
Showing 314 changed files with 545 additions and 549 deletions.
2 changes: 1 addition & 1 deletion src/sage/algebras/quatalg/quaternion_algebra_cython.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ from sage.matrix.matrix_space import MatrixSpace
from sage.matrix.matrix_integer_dense cimport Matrix_integer_dense
from sage.matrix.matrix_rational_dense cimport Matrix_rational_dense

from .quaternion_algebra_element cimport QuaternionAlgebraElement_rational_field
from sage.algebras.quatalg.quaternion_algebra_element cimport QuaternionAlgebraElement_rational_field

from sage.libs.gmp.mpz cimport mpz_t, mpz_lcm, mpz_init, mpz_set, mpz_clear, mpz_init_set, mpz_mul, mpz_fdiv_q, mpz_cmp_si

Expand Down
2 changes: 1 addition & 1 deletion src/sage/arith/power.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ square-and-multiply algorithm.

from cysignals.signals cimport sig_check

from .long cimport integer_check_long
from sage.arith.long cimport integer_check_long


cpdef generic_power(a, n):
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/action.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# sage_setup: distribution = sagemath-objects
from sage.structure.element cimport Element
from .morphism cimport Morphism
from .map cimport Map
from .functor cimport Functor
from sage.categories.morphism cimport Morphism
from sage.categories.map cimport Map
from sage.categories.functor cimport Functor

cdef class Action(Functor):
cdef readonly G
Expand Down
6 changes: 3 additions & 3 deletions src/sage/categories/action.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ AUTHOR:

from cpython.tuple cimport PyTuple_GET_ITEM

from .functor cimport Functor
from .morphism cimport Morphism
from .map cimport Map
from sage.categories.functor cimport Functor
from sage.categories.morphism cimport Morphism
from sage.categories.map cimport Map
from sage.structure.element cimport parent
from sage.structure.parent cimport Parent

Expand Down
2 changes: 1 addition & 1 deletion src/sage/categories/morphism.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sage_setup: distribution = sagemath-objects
from sage.structure.element cimport Element
from .map cimport Map
from sage.categories.map cimport Map


cdef class Morphism(Map):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ cpdef find_brouwer_van_rees_with_one_truncated_column(int k,int n):

return False

from .designs_pyx cimport _OA_cache, _OA_cache_size
from sage.combinat.designs.designs_pyx cimport _OA_cache, _OA_cache_size
cdef int is_available(int k,int n) except -1:
r"""
Return whether Sage can build an OA(k,n)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/cpython/debug.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cdef extern from "Python.h":
cdef extern from "sage/cpython/debugimpl.c":
void _type_debug(PyTypeObject*)

from .getattr cimport AttributeErrorMessage
from sage.cpython.getattr cimport AttributeErrorMessage


# Determine subtype_traverse, subtype_clear, subtype_dealloc functions
Expand Down
2 changes: 1 addition & 1 deletion src/sage/cpython/getattr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Variants of getattr()

from cpython.object cimport PyObject, PyTypeObject, Py_TYPE, descrgetfunc

from .string cimport bytes_to_str
from sage.cpython.string cimport bytes_to_str

cdef extern from "Python.h":
r"""
Expand Down
2 changes: 1 addition & 1 deletion src/sage/data_structures/bitset.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from .bitset_base cimport bitset_t
from sage.data_structures.bitset_base cimport bitset_t

# Python layer over bitset_t
cdef class FrozenBitset:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/data_structures/bitset.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ linear in ``capacity``.
# http://www.gnu.org/licenses/
#*****************************************************************************

from .bitset_base cimport *
from sage.data_structures.bitset_base cimport *
from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
cimport cython
from sage.data_structures.list_of_pairs cimport ListOfPairs
from sage.structure.sage_object cimport SageObject
from .face_iterator cimport FaceIterator, CombinatorialFace
from .list_of_faces cimport ListOfFaces
from .face_data_structure cimport face_t
from .polyhedron_face_lattice cimport PolyhedronFaceLattice
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator cimport FaceIterator, CombinatorialFace
from sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces cimport ListOfFaces
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_t
from sage.geometry.polyhedron.combinatorial_polyhedron.polyhedron_face_lattice cimport PolyhedronFaceLattice

@cython.final
cdef class CombinatorialPolyhedron(SageObject):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ from .conversions \
incidence_matrix_to_bit_rep_of_Vrep, \
facets_tuple_to_bit_rep_of_facets, \
facets_tuple_to_bit_rep_of_Vrep
from .conversions cimport Vrep_list_to_bit_rep
from sage.geometry.polyhedron.combinatorial_polyhedron.conversions cimport Vrep_list_to_bit_rep
from sage.misc.cachefunc import cached_method

from sage.rings.integer cimport smallInteger
from cysignals.signals cimport sig_check

from .face_data_structure cimport face_len_atoms, face_init, face_free
from .face_iterator cimport iter_t, parallel_f_vector
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_len_atoms, face_init, face_free
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator cimport iter_t, parallel_f_vector


cdef extern from "Python.h":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# sage_setup: distribution = sagemath-polyhedra
cimport cython
from sage.structure.sage_object cimport SageObject
from .list_of_faces cimport ListOfFaces
from .face_data_structure cimport face_t
from .face_iterator cimport FaceIterator
from sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces cimport ListOfFaces
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_t
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator cimport FaceIterator

@cython.final
cdef class CombinatorialFace(SageObject):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ from cysignals.memory cimport check_allocarray, sig_free

import numbers
from sage.rings.integer cimport smallInteger
from .conversions cimport bit_rep_to_Vrep_list
from .base cimport CombinatorialPolyhedron
from .face_iterator cimport FaceIterator_base, FaceStatus
from .polyhedron_face_lattice cimport PolyhedronFaceLattice
from .face_data_structure cimport face_len_atoms, face_init, face_free, face_copy, face_issubset
from .face_list_data_structure cimport bit_rep_to_coatom_rep
from .list_of_faces cimport face_as_combinatorial_polyhedron
from sage.geometry.polyhedron.combinatorial_polyhedron.conversions cimport bit_rep_to_Vrep_list
from sage.geometry.polyhedron.combinatorial_polyhedron.base cimport CombinatorialPolyhedron
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator cimport FaceIterator_base, FaceStatus
from sage.geometry.polyhedron.combinatorial_polyhedron.polyhedron_face_lattice cimport PolyhedronFaceLattice
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_len_atoms, face_init, face_free, face_copy, face_issubset
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport bit_rep_to_coatom_rep
from sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces cimport face_as_combinatorial_polyhedron


cdef extern from "Python.h":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# sage_setup: distribution = sagemath-polyhedra
from .face_list_data_structure cimport face_t
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport face_t

cdef int Vrep_list_to_bit_rep(tuple Vrep_list, face_t output) except -1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ from memory_allocator cimport MemoryAllocator

from sage.matrix.matrix_dense cimport Matrix_dense

from .list_of_faces cimport ListOfFaces
from .face_data_structure cimport face_next_atom, face_add_atom_safe, facet_set_coatom, face_clear
from sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces cimport ListOfFaces
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_next_atom, face_add_atom_safe, facet_set_coatom, face_clear

cdef extern from "Python.h":
int unlikely(int) nogil # Defined by Cython
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# sage_setup: distribution = sagemath-polyhedra
cimport cython
from sage.structure.sage_object cimport SageObject
from .list_of_faces cimport ListOfFaces
from .face_data_structure cimport face_t
from .face_list_data_structure cimport face_list_t
from .combinatorial_face cimport CombinatorialFace
from sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces cimport ListOfFaces
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_t
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport face_list_t
from sage.geometry.polyhedron.combinatorial_polyhedron.combinatorial_face cimport CombinatorialFace

cdef enum FaceStatus:
NOT_INITIALIZED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ from memory_allocator cimport MemoryAllocator

from sage.misc.lazy_import import LazyImport

from .conversions cimport bit_rep_to_Vrep_list
from .base cimport CombinatorialPolyhedron
from .face_list_data_structure cimport *
from sage.geometry.polyhedron.combinatorial_polyhedron.conversions cimport bit_rep_to_Vrep_list
from sage.geometry.polyhedron.combinatorial_polyhedron.base cimport CombinatorialPolyhedron
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport *

combinatorial_face_to_polyhedral_face = LazyImport('sage.geometry.polyhedron.face', 'combinatorial_face_to_polyhedral_face')
PolyhedronFace = LazyImport('sage.geometry.polyhedron.face', 'PolyhedronFace')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Inline cython methods for lists of faces.
cdef extern from "Python.h":
int unlikely(int) nogil # Defined by Cython

from .face_data_structure cimport *
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport *
from libc.string cimport memset
from cysignals.signals cimport sig_check
from cysignals.memory cimport check_allocarray, check_calloc, sig_free
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sage_setup: distribution = sagemath-polyhedra
cimport cython
from .face_list_data_structure cimport face_list_t, face_t
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport face_list_t, face_t

@cython.final
cdef class ListOfFaces:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ AUTHOR:

from sage.matrix.matrix_dense cimport Matrix_dense

from .face_list_data_structure cimport *
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport *

cdef extern from "Python.h":
int unlikely(int) nogil # Defined by Cython
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# sage_setup: distribution = sagemath-polyhedra
cimport cython
from .list_of_faces cimport ListOfFaces
from .face_data_structure cimport face_t
from .face_list_data_structure cimport face_list_t
from .combinatorial_face cimport CombinatorialFace
from sage.geometry.polyhedron.combinatorial_polyhedron.list_of_faces cimport ListOfFaces
from sage.geometry.polyhedron.combinatorial_polyhedron.face_data_structure cimport face_t
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport face_list_t
from sage.geometry.polyhedron.combinatorial_polyhedron.combinatorial_face cimport CombinatorialFace

@cython.final
cdef class PolyhedronFaceLattice:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ from .conversions \
import facets_tuple_to_bit_rep_of_facets, \
facets_tuple_to_bit_rep_of_Vrep

from .conversions cimport bit_rep_to_Vrep_list
from sage.geometry.polyhedron.combinatorial_polyhedron.conversions cimport bit_rep_to_Vrep_list

from .base cimport CombinatorialPolyhedron
from .face_iterator cimport FaceIterator
from .face_list_data_structure cimport *
from sage.geometry.polyhedron.combinatorial_polyhedron.base cimport CombinatorialPolyhedron
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator cimport FaceIterator
from sage.geometry.polyhedron.combinatorial_polyhedron.face_list_data_structure cimport *


cdef extern from "Python.h":
Expand Down
4 changes: 2 additions & 2 deletions src/sage/geometry/triangulation/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ from sage.structure.parent cimport Parent
from sage.categories.sets_cat import Sets
from sage.matrix.constructor import matrix

from .functions cimport binomial
from .triangulations cimport \
from sage.geometry.triangulation.functions cimport binomial
from sage.geometry.triangulation.triangulations cimport \
triangulations_ptr, init_triangulations, next_triangulation, delete_triangulations


Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/base/c_graph.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#**************************************************************************

from sage.data_structures.bitset cimport bitset_t
from .graph_backends cimport GenericGraphBackend
from sage.graphs.base.graph_backends cimport GenericGraphBackend
from libc.stdint cimport uint32_t

cdef class CGraph:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/base/dense_graph.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from .c_graph cimport CGraph, CGraphBackend
from sage.graphs.base.c_graph cimport CGraph, CGraphBackend
from sage.data_structures.binary_matrix cimport binary_matrix_t

cdef class DenseGraph(CGraph):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/base/graph_backends.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Classes and methods
# (at your option) any later version.
# https://www.gnu.org/licenses/
# ****************************************************************************
from .c_graph cimport CGraphBackend
from sage.graphs.base.c_graph cimport CGraphBackend


cdef class GenericGraphBackend(SageObject):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/base/sparse_graph.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from .c_graph cimport CGraph, CGraphBackend
from sage.graphs.base.c_graph cimport CGraph, CGraphBackend
cimport cython

cdef struct SparseGraphLLNode:
Expand Down
4 changes: 2 additions & 2 deletions src/sage/graphs/base/static_sparse_backend.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sage_setup: distribution = sagemath-graphs
from .c_graph cimport CGraph, CGraphBackend
from .static_sparse_graph cimport short_digraph, ushort
from sage.graphs.base.c_graph cimport CGraph, CGraphBackend
from sage.graphs.base.static_sparse_graph cimport short_digraph, ushort
from libc.stdint cimport uint64_t, uint32_t, INT32_MAX, UINT32_MAX
from sage.data_structures.bitset cimport *

Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/base/static_sparse_backend.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ from sage.graphs.base.static_sparse_graph cimport (init_short_digraph,
has_edge,
free_short_digraph,
edge_label)
from .c_graph cimport CGraphBackend
from sage.graphs.base.c_graph cimport CGraphBackend
from sage.data_structures.bitset cimport FrozenBitset
from libc.stdint cimport uint32_t
from sage.data_structures.bitset_base cimport *
Expand Down
4 changes: 2 additions & 2 deletions src/sage/graphs/base/static_sparse_graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ from memory_allocator cimport MemoryAllocator

from sage.data_structures.bitset_base cimport *
from sage.graphs.base.c_graph cimport CGraph
from .static_sparse_backend cimport StaticSparseCGraph
from .static_sparse_backend cimport StaticSparseBackend
from sage.graphs.base.static_sparse_backend cimport StaticSparseCGraph
from sage.graphs.base.static_sparse_backend cimport StaticSparseBackend


cdef extern from "fenv.h":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from .data_structures cimport *
from sage.groups.perm_gps.partn_ref.data_structures cimport *
from sage.data_structures.bitset cimport bitset_t
from sage.rings.integer cimport Integer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ REFERENCE:
from libc.string cimport memcmp, memcpy
from cysignals.memory cimport sig_malloc, sig_realloc, sig_free

from .data_structures cimport *
from sage.groups.perm_gps.partn_ref.data_structures cimport *
from sage.data_structures.bitset_base cimport *

cdef inline int agcl_cmp(int a, int b):
Expand Down
6 changes: 3 additions & 3 deletions src/sage/groups/perm_gps/partn_ref/canonical_augmentation.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ AUTHORS:
# http://www.gnu.org/licenses/
#*****************************************************************************

from .data_structures cimport *
from sage.groups.perm_gps.partn_ref.data_structures cimport *

from .automorphism_group_canonical_label cimport (
from sage.groups.perm_gps.partn_ref.automorphism_group_canonical_label cimport (
get_aut_gp_and_can_lab, aut_gp_and_can_lab, agcl_work_space,
allocate_agcl_output, deallocate_agcl_output,
allocate_agcl_work_space, deallocate_agcl_work_space)
from .double_coset cimport (double_coset,
from sage.groups.perm_gps.partn_ref.double_coset cimport (double_coset,
dc_work_space, allocate_dc_work_space, deallocate_dc_work_space)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ REFERENCE:

from cysignals.memory cimport sig_malloc, sig_free

from .data_structures cimport*
from sage.groups.perm_gps.partn_ref.data_structures cimport*


cdef void *canonical_generator_next(void *can_gen_data, int *degree, bint *mem_err):
Expand Down
2 changes: 1 addition & 1 deletion src/sage/groups/perm_gps/partn_ref/double_coset.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from .data_structures cimport *
from sage.groups.perm_gps.partn_ref.data_structures cimport *
from sage.data_structures.bitset cimport bitset_t
from sage.rings.integer cimport Integer

Expand Down
Loading

0 comments on commit dfceb98

Please sign in to comment.