Plotting dispatch backends
Project description
plotting_backends
plotting dispatch backends
Installation
pip install plotting_backends
Examples
functools.singledispatch
This shows how to use plotting_backends
with functools.singledispatch
.
import plotting_backends
from functools import singledispatch
@singledispatch
def plotting_func(
backend: type[plotting_backends.AbstractPlottingBackend], x: Any, y: Any
) -> None: ...
@plotting_func.register
def matplotlib(
backend: type[plotting_backends.MatplotlibBackend], x: Any, y: Any
) -> None: ...
plum
(multiple dispatch)
This example shows how to use plotting_backends
in conjunction with plum
, a
multiple dispatch library.
import plotting_backends
from plum import dispatch
@dispatch.abstract
def plotting_func(
backend: type[plotting_backends.AbstractPlottingBackend], x: Any, y: Any
) -> None: ...
@dispatch
def plotting_func(
backend: type[plotting_backends.MatplotlibBackend], x: Any, y: Any
) -> None: ...
Development
We welcome contributions!
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
Built Distribution
File details
Details for the file plotting_backends-0.1.0.tar.gz
.
File metadata
- Download URL: plotting_backends-0.1.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5db1afcbc19e58bfa2ee5b42150bce656edffdcb520cee4b90f26d6b46070d52 |
|
MD5 | 3ef7f4b61170f86bb3e1c21c25e3be3b |
|
BLAKE2b-256 | 518195bbbd99928c92e8d52437a54e5d4c491dac07fe23dc78d958ab2b9b8dbd |
File details
Details for the file plotting_backends-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: plotting_backends-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d9ffd7fe678ba6b10aa6e52e1d73280ef2f7b484485687c01a83e7c53686b9f |
|
MD5 | 35b1712f25f0ead81a3c0f1925edd58d |
|
BLAKE2b-256 | 5f0eeaedbcc4a14b38d9a530045a121013b80dc8b2f2eee8d9c490492cce1a07 |