Skip to main content

Plotting dispatch backends

Project description

plotting_backends

plotting dispatch backends

Installation

PyPI platforms PyPI version

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

Actions Status ruff status

We welcome contributions!

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

plotting_backends-0.1.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

plotting_backends-0.1.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

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

Hashes for plotting_backends-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5db1afcbc19e58bfa2ee5b42150bce656edffdcb520cee4b90f26d6b46070d52
MD5 3ef7f4b61170f86bb3e1c21c25e3be3b
BLAKE2b-256 518195bbbd99928c92e8d52437a54e5d4c491dac07fe23dc78d958ab2b9b8dbd

See more details on using hashes here.

File details

Details for the file plotting_backends-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for plotting_backends-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d9ffd7fe678ba6b10aa6e52e1d73280ef2f7b484485687c01a83e7c53686b9f
MD5 35b1712f25f0ead81a3c0f1925edd58d
BLAKE2b-256 5f0eeaedbcc4a14b38d9a530045a121013b80dc8b2f2eee8d9c490492cce1a07

See more details on using hashes here.

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