We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe.
Adding stub file of cm.py would be very helpful for auto completing and type checking.
cm.py
Describe the solution you would like
cm.pyi would be like the following:
cm.pyi
from matplotlib.colors import ListedColormap as LC CMAP_DCT = dict[str, LC] cmap_d: CMAP_DCT cmap_cd: dict[str, CMAP_DCT] amber: LC amber_r: LC amethyst: LC amethyst_r: LC apple: LC apple_r: LC arctic: LC arctic_r: LC ⋮
I generated the stub file with this script:
from pathlib import Path import cmasher.cm as cmrcm from cmasher._known_cmap_types import _CMASHER_BUILTIN_MAP_TYPES if __name__ == "__main__": pyi = Path(cmrcm.__file__).with_suffix(".pyi") with pyi.open("w", encoding="utf-8") as f: f.write( """from matplotlib.colors import ListedColormap as LC CMAP_DCT = dict[str, LC] cmap_d: CMAP_DCT cmap_cd: dict[str, CMAP_DCT] """ ) for cmap in _CMASHER_BUILTIN_MAP_TYPES: if cmap.startswith("cmr."): continue f.write(f"{cmap}: LC\n") f.write(f"{cmap}_r: LC\n")
Additional context
The text was updated successfully, but these errors were encountered:
This would be a useful addition indeed, PR welcome ! The script used for generation would need to be added to scripts too.
scripts
Sorry, something went wrong.
#111 Thank you for kind response. This is my first PR :)
closed in #112 , thanks again !
Successfully merging a pull request may close this issue.
Is your feature request related to a problem? Please describe.
Adding stub file of
cm.py
would be very helpful for auto completing and type checking.Describe the solution you would like
cm.pyi
would be like the following:I generated the stub file with this script:
Additional context
The text was updated successfully, but these errors were encountered: