Skip to content

Commit 51375be

Browse files
committed
chore: regenerated code
1 parent e4bdaa9 commit 51375be

File tree

5 files changed

+94
-208
lines changed

5 files changed

+94
-208
lines changed

src/igraph_ctypes/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
from ._version import __version__
1+
try:
2+
from ._version import __version__
3+
except ImportError:
4+
# during development when _version.py is not generated
5+
__version__ = "0.0.0"
26

37
from .graph import Graph
48
from ._internal.setup import setup_igraph_library

src/igraph_ctypes/_internal/enums.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -494,36 +494,6 @@ def from_(cls, value: Any):
494494
}
495495

496496

497-
class Multiple(IntEnum):
498-
"""Python counterpart of an ``igraph_multiple_t`` enum."""
499-
500-
NO_MULTIPLE = 0
501-
MULTIPLE = 1
502-
503-
@classmethod
504-
def from_(cls, value: Any):
505-
"""Converts an arbitrary Python object into this enum.
506-
507-
Raises:
508-
ValueError: if the object cannot be converted
509-
"""
510-
if isinstance(value, Multiple):
511-
return value
512-
elif isinstance(value, int):
513-
return cls(value)
514-
else:
515-
try:
516-
return _Multiple_string_map[value]
517-
except KeyError:
518-
raise ValueError(f"{value!r} cannot be converted to Multiple") from None
519-
520-
521-
_Multiple_string_map: dict[str, Multiple] = {
522-
'multiple': Multiple.MULTIPLE,
523-
'no_multiple': Multiple.NO_MULTIPLE,
524-
}
525-
526-
527497
class Order(IntEnum):
528498
"""Python counterpart of an ``igraph_order_t`` enum."""
529499

@@ -1678,6 +1648,36 @@ def from_(cls, value: Any):
16781648
}
16791649

16801650

1651+
class Product(IntEnum):
1652+
"""Python counterpart of an ``igraph_product_t`` enum."""
1653+
1654+
CARTESIAN = 0
1655+
TENSOR = 1
1656+
1657+
@classmethod
1658+
def from_(cls, value: Any):
1659+
"""Converts an arbitrary Python object into this enum.
1660+
1661+
Raises:
1662+
ValueError: if the object cannot be converted
1663+
"""
1664+
if isinstance(value, Product):
1665+
return value
1666+
elif isinstance(value, int):
1667+
return cls(value)
1668+
else:
1669+
try:
1670+
return _Product_string_map[value]
1671+
except KeyError:
1672+
raise ValueError(f"{value!r} cannot be converted to Product") from None
1673+
1674+
1675+
_Product_string_map: dict[str, Product] = {
1676+
'cartesian': Product.CARTESIAN,
1677+
'tensor': Product.TENSOR,
1678+
}
1679+
1680+
16811681
class LpaVariant(IntEnum):
16821682
"""Python counterpart of an ``igraph_lpa_variant_t`` enum."""
16831683

@@ -2089,11 +2089,11 @@ def from_(cls, value: Any):
20892089
'LpaVariant',
20902090
'MatrixStorage',
20912091
'MstAlgorithm',
2092-
'Multiple',
20932092
'NeighborMode',
20942093
'Optimality',
20952094
'Order',
20962095
'PagerankAlgorithm',
2096+
'Product',
20972097
'RandomTreeMethod',
20982098
'RandomWalkStuck',
20992099
'RealizeDegseq',

0 commit comments

Comments
 (0)