Skip to main content

illustration du tri fusion

Project description

trifusionviz

Installation via Pypi.org

$ pip3 install trifusionviz

Utilisation en ligne de commande

L'installation fournit la commande tfv

$ tfv -h
usage: tfv [-h] [-nb] [-al] [-ft [FORMAT]] [-fo [FONCTIONORDRE]]
           [liste] [fichier]

Application facilitant l'utilisation de trifusionviz

positional arguments:
  liste                 liste Python avec guillemets
  fichier               nom du fichier de sortie. Mettre "pipe" pour une sortie console.

optional arguments:
  -h, --help            show this help message and exit
  -nb, --noirblanc      Noir et Blanc
  -al, --appels         sortie des appels
  -ft [FORMAT], --format [FORMAT]
                        format fichier, par défaut : pdf
  -fo [FONCTIONORDRE], --fonctionordre [FONCTIONORDRE]
                        par défaut : lambda x, y: x < y

Exemples :

  • $ tfv "[1, 4, 3, 2]" test -ft png créera un fichier test.png

  • $ tfv -nb -al "[1, 4, 3, 2]" test créera deux fichiers en noir et blanc : test.pdf et test_appels.pdf

  • $ tfv "[1, 4, 10, 2]" test -fo "lambda x, y: str(x) < str(y)" créera un fichier : test.pdf

Remarques :

  • Sans argument, tfv produit une erreur.

  • Avec une liste pour seul argument, par exemple $ tfv "[1, 5, 2]", cela produit dans le répertoire courant un fichier Digraph.gv.pdf.

  • la sortie pipe (en nom de fichier) produira une sortie console au format souhaité permettant le pipe avec un autre programme.

  • tfv n'implémente pas pour le moment toutes les fonctionnalités de la bibliothèque.

Utilisation en module

import trifusionviz as tfv
import random

liste = list(range(13))
random.shuffle(liste)

t = tfv.trifusionviz(liste)
# sorties pdf : graphe et appels
t.sortie_appels = True
t.sortie("exemple_sortie")

u = tfv.trifusionviz(liste)
u.fonction_ordre = lambda x, y: str(x) < str(y)
u.noirblanc = True
u.profondeurs_cachees = range(2, 2 + 7)
u.forme_diviser, u.forme_arreter, u.forme_combiner = \
    "invhouse", "rectangle", "house"
# sortie png
u.sortie("exemple_sortie_lexico", "png")

v = tfv.trifusionviz(range(13))
v.style = "invis"
# sortie png
v.sortie("exemple_invisible", "png")

Sorties de l'exemple

Licence

CC-BY-NC-SA

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

trifusionviz-0.7.1.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

trifusionviz-0.7.1-py3-none-any.whl (6.5 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