Skip to content

Commit 5ba3a6c

Browse files
Joseph-Edwardsjames-d-mitchell
authored andcommitted
Change to -> make
1 parent 9352086 commit 5ba3a6c

File tree

12 files changed

+55
-54
lines changed

12 files changed

+55
-54
lines changed

docs/source/data-structures/word-graph/forest.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Forest
1010
======
1111

1212
This class represents the collection of spanning trees of a word graph.
13-
See also :any:`to_forest`.
13+
See also :any:`make_forest`.
1414

1515
Contents
1616
--------
@@ -38,4 +38,4 @@ Full API
3838
:show-inheritance:
3939
:class-doc-from: class
4040

41-
.. autofunction:: to_forest
41+
.. autofunction:: make_forest

docs/source/data-structures/word-graph/helpers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In ``libsemigroups_pybind11``:
2121
.. autosummary::
2222
:nosignatures:
2323

24-
to_word_graph
24+
make_word_graph
2525

2626
In ``libsemigroups_pybind11.word_graph``:
2727

@@ -54,7 +54,7 @@ Full API
5454

5555
.. currentmodule:: libsemigroups_pybind11
5656

57-
.. autofunction:: to_word_graph
57+
.. autofunction:: make_word_graph
5858

5959
.. automodule:: libsemigroups_pybind11.word_graph
6060
:members:

libsemigroups_pybind11/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
Bipartition,
5858
Blocks,
5959
freeband_equal_to,
60-
to_forest,
60+
make_forest,
6161
Meeter,
62-
to_word_graph,
62+
make_word_graph,
6363
Joiner,
6464
Dot,
6565
PBR,

src/bipart.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Copy a Blocks object.
6666
// with them.
6767

6868
thing.def(py::init([](std::vector<std::vector<int32_t>> const& blocks) {
69-
return to_blocks(blocks);
69+
return make<Blocks>(blocks);
7070
}),
7171
py::arg("blocks"),
7272
R"pbdoc(
@@ -264,7 +264,7 @@ Copy a Bipartition object.
264264
// with them.
265265

266266
thing.def(py::init([](std::vector<std::vector<int32_t>> const& blocks) {
267-
return to_bipartition(blocks);
267+
return make<Bipartition>(blocks);
268268
}),
269269
py::arg("blocks"),
270270
R"pbdoc(
@@ -283,7 +283,7 @@ The items in *blocks* should be:
283283
:raises LibsemigroupsError: if any of the conditions above is not met.
284284
)pbdoc");
285285
thing.def(py::init([](std::vector<uint32_t> const& lookup) {
286-
return to_bipartition(lookup);
286+
return make<Bipartition>(lookup);
287287
}),
288288
py::arg("lookup"),
289289
R"pbdoc(

src/forest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ namespace py = pybind11;
3838
namespace libsemigroups {
3939
void init_forest(py::module& m) {
4040
m.def(
41-
"to_forest",
41+
"make_forest",
4242
[](std::vector<size_t> const& parents,
4343
std::vector<size_t> const& labels) {
44-
return to_forest(parents, labels);
44+
return make<Forest>(parents, labels);
4545
},
4646
py::arg("parents"),
4747
py::arg("labels"),

src/matrix.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ above in :any:`MatrixKind`.
387387
auto thing = bind_matrix_common<Mat>(m);
388388

389389
thing.def(py::init([](std::vector<std::vector<scalar_type>> const& rows) {
390-
return to_matrix<Mat>(rows);
390+
return make<Mat>(rows);
391391
}),
392392
py::arg("rows"),
393393
R"pbdoc(
@@ -428,7 +428,7 @@ Construct a matrix from rows.
428428
thing.def(
429429
py::init([](size_t threshold,
430430
std::vector<std::vector<scalar_type>> const& entries) {
431-
return to_matrix<Mat>(semiring<semiring_type>(threshold), entries);
431+
return make<Mat>(semiring<semiring_type>(threshold), entries);
432432
}));
433433
thing.def("one", [](Mat const& self, size_t n) {
434434
return Mat::one(semiring<semiring_type>(matrix::threshold(self)), n);
@@ -469,8 +469,8 @@ that is a matrix whose kind is any of:
469469
py::init([](size_t threshold,
470470
size_t period,
471471
std::vector<std::vector<scalar_type>> const& entries) {
472-
return to_matrix<Mat>(semiring<semiring_type>(threshold, period),
473-
entries);
472+
return make<Mat>(semiring<semiring_type>(threshold, period),
473+
entries);
474474
}));
475475
thing.def(
476476
py::init([](size_t threshold, size_t period, size_t r, size_t c) {

src/pbr.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Construct empty PBR of given degree.
5454
)pbdoc");
5555
thing.def(py::init([](PBR::vector_type<int32_t> left,
5656
PBR::vector_type<int32_t> right) {
57-
return to_pbr(left, right);
57+
return make<PBR>(left, right);
5858
}),
5959
py::arg("left"),
6060
py::arg("right"),
@@ -79,9 +79,10 @@ A negative value ``i`` corresponds to ``n - i``.
7979
* would not describe a binary relation on an even number of points; or
8080
* would have a point related to a point that is greater than :any:`degree`;
8181
)pbdoc");
82-
thing.def(py::init([](PBR::vector_type<uint32_t> x) { return to_pbr(x); }),
83-
py::arg("x"),
84-
R"pbdoc(
82+
thing.def(
83+
py::init([](PBR::vector_type<uint32_t> x) { return make<PBR>(x); }),
84+
py::arg("x"),
85+
R"pbdoc(
8586
Construct from adjacencies ``0`` to ``2n - 1``.
8687
8788
Construct from adjacencies ``0`` to ``2n - 1``. The parameter *x* must be a

src/transf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ Copy a {0}.
176176
)pbdoc";
177177
}
178178
thing.def(py::init([](std::vector<Scalar> const& imgs) {
179-
return to<PTransfSubclass>(imgs);
179+
return make<PTransfSubclass>(imgs);
180180
}),
181181
py::arg("imgs"),
182182
fmt::format(
@@ -432,7 +432,7 @@ among the points where :math:`f` is defined).
432432

433433
thing.def(py::init([](std::vector<Scalar> const& dom,
434434
std::vector<Scalar> const& im,
435-
size_t deg) { return to<PPerm_>(dom, im, deg); }),
435+
size_t deg) { return make<PPerm_>(dom, im, deg); }),
436436
py::arg("dom"),
437437
py::arg("im"),
438438
py::arg("M"),

src/word-graph.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ the *out-degree* of the word graph, or any of its nodes.)pbdoc");
6868
});
6969

7070
thing.def("__str__", [](WordGraph_ const& self) {
71-
return to_input_string(self, "to_word_graph(", "[]", ")");
71+
return to_input_string(self, "make_word_graph(", "[]", ")");
7272
});
7373

7474
thing.def(py::self != py::self);
@@ -1027,8 +1027,8 @@ considered to be reachable from itself by default).
10271027
10281028
.. doctest::
10291029
1030-
>>> from libsemigroups_pybind11 import to_word_graph, word_graph
1031-
>>> wg = to_word_graph (5, [[0, 0], [1, 1], [2], [3, 3]])
1030+
>>> from libsemigroups_pybind11 import make_word_graph, word_graph
1031+
>>> wg = make_word_graph (5, [[0, 0], [1, 1], [2], [3, 3]])
10321032
>>> word_graph.is_strictly_cyclic(wg)
10331033
False)pbdoc");
10341034
m.def(
@@ -1770,9 +1770,9 @@ and *y*.
17701770
:raises LibsemigroupsError: if *y* has no nodes;
17711771
:raises LibsemigroupsError: if ``x.out_degree() != y.out_degree()``.)pbdoc");
17721772

1773-
m.def("to_word_graph",
1773+
m.def("make_word_graph",
17741774
py::overload_cast<size_t, std::vector<std::vector<node_type>> const&>(
1775-
&to_word_graph<node_type>),
1775+
&make<WordGraph<node_type>>),
17761776
py::arg("num_nodes"),
17771777
py::arg("targets"),
17781778
R"pbdoc(
@@ -1796,8 +1796,8 @@ out-degree is specified by the length of the first item in *targets*.
17961796
17971797
.. doctest::
17981798
1799-
>>> from libsemigroups_pybind11 import to_word_graph
1800-
>>> to_word_graph(5, [[0, 0], [1, 1], [2], [3, 3]])
1799+
>>> from libsemigroups_pybind11 import make_word_graph
1800+
>>> make_word_graph(5, [[0, 0], [1, 1], [2], [3, 3]])
18011801
<WordGraph with 5 nodes, 7 edges, & out-degree 2>)pbdoc");
18021802
}
18031803
} // namespace libsemigroups

tests/test_dot.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
Dot,
2020
LibsemigroupsError,
2121
word_graph,
22-
to_word_graph,
22+
make_word_graph,
2323
)
2424

2525

2626
def test_edge():
27-
wg = to_word_graph(3, [[0, 1], [1, 0], [2, 2]])
27+
wg = make_word_graph(3, [[0, 1], [1, 0], [2, 2]])
2828
d = word_graph.dot(wg)
2929
edges = d.edges()
3030
assert len(edges) == 6
@@ -38,7 +38,7 @@ def test_edge():
3838

3939

4040
def test_node():
41-
wg = to_word_graph(3, [[0, 1], [1, 0], [2, 2]])
41+
wg = make_word_graph(3, [[0, 1], [1, 0], [2, 2]])
4242
d = word_graph.dot(wg)
4343
nodes = d.nodes()
4444
assert len(nodes) == 3
@@ -51,13 +51,13 @@ def test_node():
5151

5252

5353
def test_dot_copy():
54-
wg = to_word_graph(3, [[0, 1], [1, 0], [2, 2]])
54+
wg = make_word_graph(3, [[0, 1], [1, 0], [2, 2]])
5555
d = word_graph.dot(wg)
5656
assert copy.copy(d) is not d
5757

5858

5959
def test_dot_attrs():
60-
wg = to_word_graph(3, [[0, 1], [1, 0], [2, 2]])
60+
wg = make_word_graph(3, [[0, 1], [1, 0], [2, 2]])
6161
d = word_graph.dot(wg)
6262
d.add_attr("node [shape=circle]")
6363
assert d.attrs() == {"node [shape=circle]": ""}

0 commit comments

Comments
 (0)