Skip to content

Commit 7429c3b

Browse files
author
Release Manager
committed
gh-40887: convert some methods in designs and graphs to n_* This replaces methods `num_points` and `num_blocks` by `n_points` and `n_blocks` in designs. Old names are kept as aliases. cf also #40875 This is just a small reduction of the number of method with names `num_*` ### 📝 Checklist - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. URL: #40887 Reported by: Frédéric Chapoton Reviewer(s): Vincent Macri
2 parents 03ce84d + 5ae07a9 commit 7429c3b

10 files changed

+98
-84
lines changed

src/sage/combinat/designs/bibd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def balanced_incomplete_block_design(v, k, lambd=1, existence=False, use_LJCR=Fa
334334
return False
335335
raise EmptySetError(f"there exists no ({v},{k},{lambd})-BIBD")
336336
B = B.incidence_structure()
337-
if B.num_blocks() == expected_n_of_blocks:
337+
if B.n_blocks() == expected_n_of_blocks:
338338
if existence:
339339
return True
340340
else:
@@ -1467,7 +1467,7 @@ def __repr__(self):
14671467
(13,3,1)-Balanced Incomplete Block Design
14681468
"""
14691469
bsizes = list(frozenset(self.block_sizes()))
1470-
return "Pairwise Balanced Design on {} points with sets of sizes in {}".format(self.num_points(), bsizes)
1470+
return "Pairwise Balanced Design on {} points with sets of sizes in {}".format(self.n_points(), bsizes)
14711471

14721472

14731473
class BalancedIncompleteBlockDesign(PairwiseBalancedDesign):
@@ -1526,10 +1526,10 @@ def __repr__(self):
15261526
sage: b=designs.balanced_incomplete_block_design(9,3); b
15271527
(9,3,1)-Balanced Incomplete Block Design
15281528
"""
1529-
v = self.num_points()
1529+
v = self.n_points()
15301530
k = len(self._blocks[0]) if self._blocks else 0
15311531
l = self._lambd
1532-
return "({},{},{})-Balanced Incomplete Block Design".format(v,k,l)
1532+
return f"({v},{k},{l})-Balanced Incomplete Block Design"
15331533

15341534
def arc(self, s=2, solver=None, verbose=0, *, integrality_tolerance=1e-3):
15351535
r"""

src/sage/combinat/designs/gen_quadrangles_with_spread.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def dual_GQ_ovoid(GQ, O):
217217

218218
# GQ.ground_set()[i] becomes newBlocks[i]
219219
# GQ.blocks()[i] becomes i
220-
newBlocks = [[] for _ in range(GQ.num_points())]
220+
newBlocks = [[] for _ in range(GQ.n_points())]
221221
pointsToInt = {p: i for i, p in enumerate(GQ.ground_set())}
222222

223223
for i, b in enumerate(GQ.blocks()):

src/sage/combinat/designs/group_divisible_designs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def __init__(self, points, groups, blocks, G=None, K=None, lambd=1,
292292

293293
if check or groups is None:
294294
is_gdd = is_group_divisible_design(self._groups, self._blocks,
295-
self.num_points(), G, K,
295+
self.n_points(), G, K,
296296
lambd, verbose=1)
297297
assert is_gdd
298298
if groups is None:
@@ -355,6 +355,6 @@ def __repr__(self):
355355
if not gdd_type:
356356
gdd_type = "1^0"
357357

358-
v = self.num_points()
358+
v = self.n_points()
359359

360360
return "Group Divisible Design on {} points of type {}".format(v, gdd_type)

0 commit comments

Comments
 (0)