Skip to content

Commit

Permalink
Add Python stub files (#74)
Browse files Browse the repository at this point in the history
* Add Python stubs

* Add stub install script
  • Loading branch information
tobre1 authored Mar 27, 2024
1 parent 758c2f8 commit 884d2af
Show file tree
Hide file tree
Showing 6 changed files with 1,190 additions and 1 deletion.
11 changes: 11 additions & 0 deletions python/install-stubs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# experimental script to install stubs for python packages
# this script is not yet integrated into the main build process

# install stubs for all packages in the current environment
# this is useful for IDEs that support type hinting

path=$(python3 -m site --user-site)
echo "Installing stubs in $path"
cp -r stubs/* $path
2 changes: 1 addition & 1 deletion python/pyWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ PYBIND11_MODULE(VIENNAPS_MODULE_NAME, module) {
.def("setMaxCoverageInitIterations",
&psProcess<T, D>::setMaxCoverageInitIterations,
"Set the number of iterations to initialize the coverages.")
.def(" setPrintTimeInterval ", &psProcess<T, D>::setPrintTimeInterval,
.def("setPrintTimeInterval ", &psProcess<T, D>::setPrintTimeInterval,
"Sets the minimum time between printing intermediate results during "
"the process. If this is set to a non-positive value, no "
"intermediate results are printed.")
Expand Down
3 changes: 3 additions & 0 deletions python/stubs/viennaps2d/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ._viennaps2d import *

def ReadConfigFile(fileName: str): ...
Loading

1 comment on commit 884d2af

@Curve
Copy link
Member

@Curve Curve commented on 884d2af Mar 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may be able to do this more efficiently from the pyproject.toml

Please sign in to comment.