Skip to main content

StructOut

prints networkx graphs and large int lists pleasantly to terminal.

import structout as so
so.lprint(range(1000),length=70)

import networkx as nx
g=nx.path_graph(5)
so.gprint(g)

'' ''

install

pip install structout

numberlists


# implemented options: -> i should update this at some point :)
def doALine(values,
        length=-1,minmax=False, chunk_operation=max,
        method = 'log', methodhow =2)

# there is also a convenience function 'bins' that
# does evenly spaced out bins :)

Graphs

Colors

# this will color nodes 1,2,3 in one color and 4,0 in another
gprint(graph, color=([1,2,3],[4,0]))
  • edge labels are always blue
  • digraphs should mark the direction with a blue dot

cut graph down to a subgraph

# print nodes with max distance 1 to the nodes 1 and 2
gprint(graph, zoomlevel=1, zoomnodes=[1,2])

other options

nodelabel='label',  # node and edge labels
edgelabel='label',
size=10,            # size
pos=None,           # pass a coordinate dictionary ; {nodeid : x,y}
n_graphs_per_line= 5 # when passing multiple graphs, wrap here

RNAprint

                        G.-.G.-.G
                          -.    -
                            G.=.G
                            -   -
                            G.=.G
                            -   -
                            G   G
                            -   -
                            G   U.....             .U
                            -         -.....     .- -
A.-.A.-.A.-.A.-.A.-.A.-.A.-.A               U.-.U   U
                =   =   =   =               =   =   -
        A.-.A.-.A.-.A.-.A.-.A      .U.-.U.-.U.-.U.-.U
                            -    .-
                            A.=.A
                            -   -
                            A.=.A.
                              -.  -.
                                A.-.A

heatmap

heatmap(matrix,dim = (20,20),operator= np.max, wide = True)

wide makes each symbol take up 2 characters.

Release files for structout 0.1.63

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for structout 0.1.63
File Size Uploaded
structout-0.1.63.tar.gz 16.6 kB Details

Release files / structout-0.1.63.tar.gz

Download URL structout-0.1.63.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b5a1254f7cc94ca67614d20552f8fb4316d63d221270e8e7bedb1f1d2fbf24cd
BLAKE2b-256 checksum
How to use checksums
291d2e7c7a65ccea4ab1180a611c8a3d49ee2346a13420af2b024a86f0796e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.63 This release

1 release file

0.1.56

1 release file

0.1.52

1 release file

0.1.51

1 release file

0.1.47

1 release file

0.1.46

1 release file

0.1.44

1 release file

0.1.43

1 release file

0.1.41

1 release file

0.1.40

1 release file

0.1.38

1 release file

0.1.37

1 release file

0.1.36

1 release file

0.1.35

1 release file

0.1.33

1 release file

0.1.32

1 release file

0.1.30

1 release file

0.1.29

1 release file

0.1.26

1 release file

0.1.25

1 release file

0.1.23

1 release file

0.1.21

1 release file

0.1.20

1 release file

0.1.19

1 release file

0.1.18

1 release file

0.1.17

1 release file

0.1.13

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.0.16

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page