Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dependencies default argument #285

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading