Springpy
Springpy visualises a distance matrix.
Download
pip3 install springpy
Usage
import springpy as sp
matrix = [[0, 0.2, 0.1],
[0.2, 0, 0.3],
[0.1, 0.3, 0]]
# Show a matplotlib animation
sp.animate(matrix)
# Save to video (Default Name:"spring_result.mp4")
sp.animate(matrix, save=True)
# Show a matplotlib graph
sp.graph(matrix)
# Save the graph(Default Name:"spring_result.jpg")
sp.graph(matrix, save=True)
Input: A distance matrix embedded into a 2D Python List.
Demonstration:
Data: Click Here
Result(animation & video):
Result(graph): Currently Unavaliable(Visit GitHub page for more information)
Change Default Values
import springpy as sp
# Width of the graph, default 100px
sp.w = 100
# Height of the graph, default 100px
sp.h = 100
# Cool down delta, default 0.975
sp.delta = 0.975
# The eplison, if the change is smaller than this value, then stop iterating, default 5
sp.eplison = 10
# Max iteration, the maximum number of iterations, default 500
sp.MaxIter = 500
For sp.animate:
sp.animate(self, matrix, save=False, interval=100, VideoName="springpy_result.mp4"):
"""
:param save: whether to save the video, default False
:param interval: the interval between frames, default 100
:param VideoName: the name of the video for the result, default "springpy_result.gif". Note that this name must include the suffix(ie .gif)
"""
For sp.graph:
sp.graph(self, matrix, save=False, ImageName = "springpy_result.jpg"):
"""
:param save: whether to save the graph, default False
:param VideoName: the name of the graph for the result, default "springpy_result.jpg". Note that this name must include the suffix(ie .jpg or .png)
"""
Links
Metadata
Release files for springpy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| springpy-0.1.0.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| springpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.4 kB
Release files / springpy-0.1.0.tar.gz
| Download URL | springpy-0.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f68ab7950946760b392cb59555177caf49f0ff33a88cdc7726c9263470740184
|
|
BLAKE2b-256 checksum How to use checksums |
a0775b8cd51e5fedcc63e41c60df8731dbc52ed77d4610809229e2924eafa52a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.4
|
Release files / springpy-0.1.0-py3-none-any.whl
| Download URL | springpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f75aef0ff5cf8a0adef2a16aad0e671bbf93e682dedd900293d353b736e6fbba
|
|
BLAKE2b-256 checksum How to use checksums |
8d00bdc25ea63074125e30c6b21d7cc90ee4311a7ab9d89f14d90db83e0ed200
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.8.4
|