Generate stub file for yacs config.
Project description
yacs-stubgen
Add typing support for your yacs config by generating stub file.
Install
pip install yacs-stubgen
or install from this repo:
pip install git+github.com/JamzumSum/yacs-stubgen.git
Usage
Add typing support for your yacs config by appending two lines:
_C.MODEL.DEVICE = 'cuda'
...
# your config items above
from yacs_stubgen import build_pyi
# this line can be moved to the import header
build_pyi(_C, __file__, var_name='_C')
# _C is the CfgNode object, "_C" should be its name correctly
After any run/import of this file, a stub file (*.pyi) will be generated. Then you will get typing and auto-complete support if your IDE supports stub files.
License
- MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yacs-stubgen-0.1.2.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for yacs_stubgen-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6de2399914207d0f9e2467ee7d5b5438438f3950e1596b13b3c9e8df9fee711 |
|
MD5 | 24729660d38b8e68ec9c7170c1ba6e06 |
|
BLAKE2b-256 | c416be1e0b76beddcc8560982938d7abb134ac24e1462080067ba08207442110 |