Skip to main content

Generate stub file for yacs config.

Project description

yacs-stubgen

Add typing support for your YACS config by generating stub file.

python version workflow

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 just 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

Project details


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.post1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

yacs_stubgen-0.1.2.post1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page