Skip to content

Commit

Permalink
Replace relative imports in Cython files
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Oct 31, 2023
1 parent f1368a6 commit d486801
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/sage/coding/ag_code_decoders.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ from sage.rings.function_field.constructor import FunctionField
from sage.modules.free_module_element import vector
from sage.matrix.constructor import matrix

from .encoder import Encoder
from .decoder import Decoder, DecodingError
from sage.coding.encoder import Encoder
from sage.coding.decoder import Decoder, DecodingError

from sage.modules.free_module_element cimport FreeModuleElement
from sage.matrix.matrix cimport Matrix
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/designs_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ def is_quasi_difference_matrix(M,G,int k,int lmbda,int mu,int u,verbose=False):
Column 1 contains 2 empty entries instead of the expected lambda.u=1.1=1
False
"""
from .difference_family import group_law
from sage.combinat.designs.difference_family import group_law

assert k>=2
assert lmbda >=1
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/evenly_distributed_sets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ cdef class EvenlyDistributedSetsBacktracker:
xe = self.K.multiplicative_generator() ** (self.e)
df = [[xe**j*b for b in B] for j in range((self.q-1)/(2*self.e))]
if check:
from .difference_family import is_difference_family
from sage.combinat.designs.difference_family import is_difference_family
if not is_difference_family(self.K, df, self.q, self.k, 1):
raise RuntimeError("a wrong evenly distributed set was "
"produced by the Sage library for the parameters:\n"
Expand Down
28 changes: 14 additions & 14 deletions src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Functions
"""

from sage.misc.cachefunc import cached_function
from .orthogonal_arrays import orthogonal_array
from sage.combinat.designs.orthogonal_arrays import orthogonal_array
from sage.rings.integer cimport smallInteger
from sage.arith.misc import prime_powers

Expand Down Expand Up @@ -153,7 +153,7 @@ cpdef find_product_decomposition(int k,int n) noexcept:
# faster to use that rather than calling the divisors function
continue
if is_available(k, n1) and is_available(k, n2):
from .orthogonal_arrays import wilson_construction
from sage.combinat.designs.orthogonal_arrays import wilson_construction
return wilson_construction, (None,k,n1,n2,(),False)
return False

Expand Down Expand Up @@ -203,7 +203,7 @@ cpdef find_wilson_decomposition_with_one_truncated_group(int k,int n) noexcept:
is_available(k ,m+1) and
is_available(k+1,r ) and
is_available(k ,u )):
from .orthogonal_arrays import wilson_construction
from sage.combinat.designs.orthogonal_arrays import wilson_construction
return wilson_construction, (None,k,r,m,(u,),False)

return False
Expand Down Expand Up @@ -266,7 +266,7 @@ cpdef find_wilson_decomposition_with_two_truncated_groups(int k,int n) noexcept:
r2 = r1_p_r2-r1
if is_available(k,r2):
assert n == r*m+r1+r2
from .orthogonal_arrays import wilson_construction
from sage.combinat.designs.orthogonal_arrays import wilson_construction
return wilson_construction, (None,k,r,m,(r1,r2),False)
return False

Expand Down Expand Up @@ -306,7 +306,7 @@ cpdef find_construction_3_3(int k,int n) noexcept:

if (is_available(k+i, nn ) and
is_available(k , mm+i)):
from .orthogonal_arrays_build_recursive import construction_3_3
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_3_3
return construction_3_3, (k,nn,mm,i)

cpdef find_construction_3_4(int k,int n) noexcept:
Expand Down Expand Up @@ -349,7 +349,7 @@ cpdef find_construction_3_4(int k,int n) noexcept:
if (is_available(k+r+1,nn) and
is_available(k , s) and
(is_available(k,mm+r) or is_available(k,mm+r+1))):
from .orthogonal_arrays_build_recursive import construction_3_4
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_3_4
return construction_3_4, (k,nn,mm,r,s)

cpdef find_construction_3_5(int k,int n) noexcept:
Expand Down Expand Up @@ -399,7 +399,7 @@ cpdef find_construction_3_5(int k,int n) noexcept:
(r==0 or is_available(k,r)) and
(s==0 or is_available(k,s)) and
(t==0 or is_available(k,t))):
from .orthogonal_arrays_build_recursive import construction_3_5
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_3_5
return construction_3_5, (k,nn,mm,r,s,t)

cpdef find_construction_3_6(int k,int n) noexcept:
Expand Down Expand Up @@ -440,7 +440,7 @@ cpdef find_construction_3_6(int k,int n) noexcept:

if (is_available(k+i,nn) and
smallInteger(nn).is_prime_power()):
from .orthogonal_arrays_build_recursive import construction_3_6
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_3_6
return construction_3_6, (k,nn,mm,i)

cpdef find_q_x(int k,int n) noexcept:
Expand Down Expand Up @@ -492,7 +492,7 @@ cpdef find_q_x(int k,int n) noexcept:
# is_available(k+1,q) and
is_available(k, x+2 ) and
smallInteger(q).is_prime_power()):
from .orthogonal_arrays_build_recursive import construction_q_x
from sage.combinat.designs.orthogonal_arrays_build_recursive import construction_q_x
return construction_q_x, (k,q,x)
return False

Expand Down Expand Up @@ -546,7 +546,7 @@ cpdef find_thwart_lemma_3_5(int k,int N) noexcept:
sage: for k,n in kn: # not tested -- too long
....: assert designs.orthogonal_array(k,n,existence=True) is True
"""
from .orthogonal_arrays_build_recursive import thwart_lemma_3_5
from sage.combinat.designs.orthogonal_arrays_build_recursive import thwart_lemma_3_5
cdef int n,m,a,b,c,d,NN,na,nb,nc

for n in prime_powers(k+2,N-2): # There must exist a OA(k+3,n) thus n>=k+2
Expand Down Expand Up @@ -661,7 +661,7 @@ cpdef find_thwart_lemma_4_1(int k,int n) noexcept:
not is_available(k,mm+4)):
continue

from .orthogonal_arrays_build_recursive import thwart_lemma_4_1
from sage.combinat.designs.orthogonal_arrays_build_recursive import thwart_lemma_4_1
return thwart_lemma_4_1,(k,nn,mm)

return False
Expand Down Expand Up @@ -706,7 +706,7 @@ cpdef find_three_factor_product(int k,int n) noexcept:
not is_available(k,n2) or
not is_available(k,n3)):
continue
from .orthogonal_arrays_build_recursive import three_factor_product
from sage.combinat.designs.orthogonal_arrays_build_recursive import three_factor_product
return three_factor_product,(k-1,n1,n2,n3)

return False
Expand All @@ -731,7 +731,7 @@ cpdef find_brouwer_separable_design(int k,int n) noexcept:
sage: find_brouwer_separable_design(5,14)
False
"""
from .orthogonal_arrays_build_recursive import brouwer_separable_design
from sage.combinat.designs.orthogonal_arrays_build_recursive import brouwer_separable_design
cdef int q,x,baer_subplane_size, max_t, min_t, t,e1,e2,e3,e4

for q in prime_powers(2,n):
Expand Down Expand Up @@ -945,7 +945,7 @@ cpdef find_brouwer_van_rees_with_one_truncated_column(int k,int n) noexcept:

values = int_as_sum(remainder, available_multipliers, r)
if values is not None:
from .orthogonal_arrays import wilson_construction
from sage.combinat.designs.orthogonal_arrays import wilson_construction
return (wilson_construction,
(None,k,r,m,[[(x,1) for x in values]]))

Expand Down
6 changes: 3 additions & 3 deletions src/sage/graphs/base/graph_backends.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ cdef class GenericGraphBackend(SageObject):
sage: loads(dumps(gi)) == gi
True
"""
from .static_sparse_backend import StaticSparseBackend
from .sparse_graph import SparseGraphBackend
from .dense_graph import DenseGraphBackend
from sage.graphs.base.static_sparse_backend import StaticSparseBackend
from sage.graphs.base.sparse_graph import SparseGraphBackend
from sage.graphs.base.dense_graph import DenseGraphBackend

# implementation, data_structure, multiedges, directed, loops
if isinstance(self, CGraphBackend):
Expand Down

0 comments on commit d486801

Please sign in to comment.