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
Adding stub file of cm.py would be very helpful for type checking and auto completing colormaps.
cm.py
from matplotlib.colors import ListedColormap from pathlib import Path paths: list[Path] cmaps: dict[str, ListedColormap] def show_cmaps(*, ncols: int = ..., figwidth: int = ...) -> None: ... acton: ListedColormap acton_r: ListedColormap actonS: ListedColormap bam: ListedColormap bam_r: ListedColormap bamako: ListedColormap bamako_r: ListedColormap bamakoS: ListedColormap ⋮
I generated cm.pyi stub file with this script (mypy needed).
cm.pyi
import subprocess from pathlib import Path from cmcrameri.cm import cmaps if __name__ == "__main__": subprocess.check_output(["stubgen", "-o", ".", "cmcrameri/cm.py"]) path = Path(__file__).parent / "cm.pyi" assert path.exists() with path.open("a", encoding="utf-8") as f: for cmap in cmaps: f.write(f"\n{cmap}: ListedColormap")
These lines were added for typing paths and cmaps.
paths
cmaps
paths: list[Path] cmaps: dict[str, ListedColormap] paths, cmaps = _load_cmaps()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Adding stub file of
cm.py
would be very helpful for type checking and auto completing colormaps.I generated
cm.pyi
stub file with this script (mypy needed).These lines were added for typing
paths
andcmaps
.The text was updated successfully, but these errors were encountered: