Skip to content

Commit

Permalink
Merge pull request #285 from MatthewMckee4/main
Browse files Browse the repository at this point in the history
fix dependencies default argument
  • Loading branch information
joamatab authored Dec 11, 2024
2 parents 70fb2b6 + e3f5c36 commit 8a0a1d7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions gdstk/_gdstk.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Cell:
deep_copy: bool = True,
) -> Cell: ...
def delete_property(self, name: str) -> Self: ...
def dependencies(self, recursive: bool = True) -> Sequence[Self | RawCell]: ...
def dependencies(self, recursive: bool = True) -> Sequence[Cell | RawCell]: ...
def filter(
self,
spec: Iterable[tuple[int, int]],
Expand Down Expand Up @@ -496,7 +496,7 @@ class RawCell:
name: str
size: int
def __init__(self, name: str)-> None: ...
def dependencies(self, recursive: bool) -> list[RawCell]: ...
def dependencies(self, recursive: bool = True) -> list[RawCell]: ...

class Reference:
cell: Cell
Expand Down
2 changes: 1 addition & 1 deletion python/cell_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ static PyObject* cell_object_remap(CellObject* self, PyObject* args, PyObject* k
static PyObject* cell_object_dependencies(CellObject* self, PyObject* args, PyObject* kwds) {
int recursive = 1;
const char* keywords[] = {"recursive", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "p:dependencies", (char**)keywords, &recursive))
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|p:dependencies", (char**)keywords, &recursive))
return NULL;

Map<Cell*> cell_map = {};
Expand Down
4 changes: 2 additions & 2 deletions python/rawcell_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ static int rawcell_object_init(RawCellObject* self, PyObject* args, PyObject* kw
}

static PyObject* rawcell_object_dependencies(RawCellObject* self, PyObject* args) {
int recursive;
if (!PyArg_ParseTuple(args, "p:dependencies", &recursive)) return NULL;
int recursive = 1;
if (!PyArg_ParseTuple(args, "|p:dependencies", &recursive)) return NULL;
Map<RawCell*> rawcell_map = {};
self->rawcell->get_dependencies(recursive > 0, rawcell_map);
PyObject* result = PyList_New(rawcell_map.count);
Expand Down

0 comments on commit 8a0a1d7

Please sign in to comment.