Skip to content

Commit b085992

Browse files
committed
feat: use docstrings from doc/fragments/*
1 parent a8919d2 commit b085992

File tree

6 files changed

+81
-49
lines changed

6 files changed

+81
-49
lines changed

doc/fragments/igraph_empty.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Creates an empty graph with the given number of vertices.
2+
3+
Parameters:
4+
n: the number of vertices
5+
directed: whether the graph is directed

doc/fragments/igraph_famous.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Creates one of the "famous" graphs embedded into igraph by name.
2+
3+
See the documentation of the ``igraph_famous()`` function in igraph's C core
4+
for a list of names accepted by this function.
5+
6+
Parameters:
7+
name: the name of the graph to construct
8+
9+
Returns:
10+
the constructed graph

poetry.lock

Lines changed: 45 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ pycapi = "^0.82.1"
1616
pytest = "^7.2.1"
1717
pytest-cov = "^4.0.0"
1818
richbench = "^1.0.3"
19-
igraph = "^0.10.4"
20-
stimulus = { git = "https://github.com/igraph/stimulus.git", tag = "0.13.0" }
19+
igraph = "^0.10.6"
20+
stimulus = { git = "https://github.com/igraph/stimulus.git", tag = "0.14.0" }
2121

2222
[tool.ruff]
2323
ignore = ["F405"]

src/codegen/run.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ def main():
276276
str(SOURCE_FOLDER / "codegen" / "functions.yaml"),
277277
"-t",
278278
str(SOURCE_FOLDER / "codegen" / "types.yaml"),
279+
"-D",
280+
str(SOURCE_FOLDER.parent / "doc" / "fragments"),
279281
]
280282

281283
args = [

src/igraph_ctypes/_internal/functions.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@
3737

3838

3939
def empty(n: int = 0, directed: bool = True) -> Graph:
40-
"""Type-annotated wrapper for ``igraph_empty``."""
40+
"""Creates an empty graph with the given number of vertices.
41+
42+
Parameters:
43+
n: the number of vertices
44+
directed: whether the graph is directed
45+
"""
4146
# Prepare input arguments
4247
c_graph = _Graph()
4348
c_n = n
@@ -687,7 +692,17 @@ def kautz(m: int, n: int) -> Graph:
687692

688693

689694
def famous(name: str) -> Graph:
690-
"""Type-annotated wrapper for ``igraph_famous``."""
695+
"""Creates one of the "famous" graphs embedded into igraph by name.
696+
697+
See the documentation of the ``igraph_famous()`` function in igraph's C core
698+
for a list of names accepted by this function.
699+
700+
Parameters:
701+
name: the name of the graph to construct
702+
703+
Returns:
704+
the constructed graph
705+
"""
691706
# Prepare input arguments
692707
c_graph = _Graph()
693708
c_name = name.encode("utf-8")

0 commit comments

Comments
 (0)