main > main: 3rd party imports
This commit is contained in:
parent
ba54939a3b
commit
cf880ccffc
32
src/thirdparty/db.py
vendored
Normal file
32
src/thirdparty/db.py
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
# IMPORTS
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
import sqlite3;
|
||||||
|
from sqlite3 import Binary;
|
||||||
|
from sqlite3 import Connection;
|
||||||
|
from sqlite3 import connect;
|
||||||
|
from sqlite3 import Cursor;
|
||||||
|
from sqlite3 import PARSE_DECLTYPES;
|
||||||
|
from sqlite3 import register_adapter;
|
||||||
|
from sqlite3 import register_converter;
|
||||||
|
import pandas as pd;
|
||||||
|
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
# EXPORTS
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
'Binary',
|
||||||
|
'Connection',
|
||||||
|
'Cursor',
|
||||||
|
'PARSE_DECLTYPES',
|
||||||
|
'connect',
|
||||||
|
'pd',
|
||||||
|
'register_adapter',
|
||||||
|
'register_converter',
|
||||||
|
'sqlite3',
|
||||||
|
];
|
2
src/thirdparty/maths.py
vendored
2
src/thirdparty/maths.py
vendored
@ -9,6 +9,7 @@ from fractions import Fraction;
|
|||||||
import math;
|
import math;
|
||||||
import numpy as np;
|
import numpy as np;
|
||||||
import random;
|
import random;
|
||||||
|
from collections import deque as Stack;
|
||||||
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# EXPORTS
|
# EXPORTS
|
||||||
@ -19,4 +20,5 @@ __all__ = [
|
|||||||
'math',
|
'math',
|
||||||
'np',
|
'np',
|
||||||
'random',
|
'random',
|
||||||
|
'Stack',
|
||||||
];
|
];
|
||||||
|
139
src/thirdparty/plots.py
vendored
Normal file
139
src/thirdparty/plots.py
vendored
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
# IMPORTS
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
from enum import Enum;
|
||||||
|
from matplotlib import pyplot as mplot;
|
||||||
|
from matplotlib import colors as mcolours;
|
||||||
|
from matplotlib import ticker as mticker;
|
||||||
|
from matplotlib.figure import Figure;
|
||||||
|
from matplotlib.axes import Axes;
|
||||||
|
from matplotlib.patches import Polygon;
|
||||||
|
from matplotlib.patches import FancyArrowPatch;
|
||||||
|
import plotly;
|
||||||
|
import plotly.express as px;
|
||||||
|
import plotly.graph_objects as pgo;
|
||||||
|
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
# MODIFICATIONS
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
class PLOTLY_COLOUR_SCHEME(Enum):
|
||||||
|
'''
|
||||||
|
Colour schemes for Plotly <https://plotly.com/python/builtin-colorscales>
|
||||||
|
'''
|
||||||
|
AGGRNYL = 'aggrnyl';
|
||||||
|
AGSUNSET = 'agsunset';
|
||||||
|
ALGAE = 'algae';
|
||||||
|
AMP = 'amp';
|
||||||
|
ARMYROSE = 'armyrose';
|
||||||
|
BALANCE = 'balance';
|
||||||
|
BLACKBODY = 'blackbody';
|
||||||
|
BLUERED = 'bluered';
|
||||||
|
BLUES = 'blues';
|
||||||
|
BLUGRN = 'blugrn';
|
||||||
|
BLUYL = 'bluyl';
|
||||||
|
BRBG = 'brbg';
|
||||||
|
BRWNYL = 'brwnyl';
|
||||||
|
BUGN = 'bugn';
|
||||||
|
BUPU = 'bupu';
|
||||||
|
BURG = 'burg';
|
||||||
|
BURGYL = 'burgyl';
|
||||||
|
CIVIDIS = 'cividis';
|
||||||
|
CURL = 'curl';
|
||||||
|
DARKMINT = 'darkmint';
|
||||||
|
DEEP = 'deep';
|
||||||
|
DELTA = 'delta';
|
||||||
|
DENSE = 'dense';
|
||||||
|
EARTH = 'earth';
|
||||||
|
EDGE = 'edge';
|
||||||
|
ELECTRIC = 'electric';
|
||||||
|
EMRLD = 'emrld';
|
||||||
|
FALL = 'fall';
|
||||||
|
GEYSER = 'geyser';
|
||||||
|
GNBU = 'gnbu';
|
||||||
|
GRAY = 'gray';
|
||||||
|
GREENS = 'greens';
|
||||||
|
GREYS = 'greys';
|
||||||
|
HALINE = 'haline';
|
||||||
|
HOT = 'hot';
|
||||||
|
HSV = 'hsv';
|
||||||
|
ICE = 'ice';
|
||||||
|
ICEFIRE = 'icefire';
|
||||||
|
INFERNO = 'inferno';
|
||||||
|
JET = 'jet';
|
||||||
|
MAGENTA = 'magenta';
|
||||||
|
MAGMA = 'magma';
|
||||||
|
MATTER = 'matter';
|
||||||
|
MINT = 'mint';
|
||||||
|
MRYBM = 'mrybm';
|
||||||
|
MYGBM = 'mygbm';
|
||||||
|
ORANGES = 'oranges';
|
||||||
|
ORRD = 'orrd';
|
||||||
|
ORYEL = 'oryel';
|
||||||
|
OXY = 'oxy';
|
||||||
|
PEACH = 'peach';
|
||||||
|
PHASE = 'phase';
|
||||||
|
PICNIC = 'picnic';
|
||||||
|
PINKYL = 'pinkyl';
|
||||||
|
PIYG = 'piyg';
|
||||||
|
PLASMA = 'plasma';
|
||||||
|
PLOTLY3 = 'plotly3';
|
||||||
|
PORTLAND = 'portland';
|
||||||
|
PRGN = 'prgn';
|
||||||
|
PUBU = 'pubu';
|
||||||
|
PUBUGN = 'pubugn';
|
||||||
|
PUOR = 'puor';
|
||||||
|
PURD = 'purd';
|
||||||
|
PURP = 'purp';
|
||||||
|
PURPLES = 'purples';
|
||||||
|
PURPOR = 'purpor';
|
||||||
|
RAINBOW = 'rainbow';
|
||||||
|
RDBU = 'rdbu';
|
||||||
|
RDGY = 'rdgy';
|
||||||
|
RDPU = 'rdpu';
|
||||||
|
RDYLBU = 'rdylbu';
|
||||||
|
RDYLGN = 'rdylgn';
|
||||||
|
REDOR = 'redor';
|
||||||
|
REDS = 'reds';
|
||||||
|
SOLAR = 'solar';
|
||||||
|
SPECTRAL = 'spectral';
|
||||||
|
SPEED = 'speed';
|
||||||
|
SUNSET = 'sunset';
|
||||||
|
SUNSETDARK = 'sunsetdark';
|
||||||
|
TEAL = 'teal';
|
||||||
|
TEALGRN = 'tealgrn';
|
||||||
|
TEALROSE = 'tealrose';
|
||||||
|
TEMPO = 'tempo';
|
||||||
|
TEMPS = 'temps';
|
||||||
|
THERMAL = 'thermal';
|
||||||
|
TROPIC = 'tropic';
|
||||||
|
TURBID = 'turbid';
|
||||||
|
TURBO = 'turbo';
|
||||||
|
TWILIGHT = 'twilight';
|
||||||
|
VIRIDIS = 'viridis';
|
||||||
|
YLGN = 'ylgn';
|
||||||
|
YLGNBU = 'ylgnbu';
|
||||||
|
YLORBR = 'ylorbr';
|
||||||
|
YLORRD = 'ylorrd';
|
||||||
|
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
# EXPORTS
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
'Axes',
|
||||||
|
'FancyArrowPatch',
|
||||||
|
'Figure',
|
||||||
|
'Polygon',
|
||||||
|
'mcolours',
|
||||||
|
'mplot',
|
||||||
|
'mticker',
|
||||||
|
'pgo',
|
||||||
|
'PLOTLY_COLOUR_SCHEME',
|
||||||
|
'plotly',
|
||||||
|
'px',
|
||||||
|
];
|
6
src/thirdparty/render.py
vendored
6
src/thirdparty/render.py
vendored
@ -11,7 +11,8 @@ from IPython.display import display_png;
|
|||||||
from IPython.display import display_markdown;
|
from IPython.display import display_markdown;
|
||||||
from IPython.display import display;
|
from IPython.display import display;
|
||||||
# from array_to_latex import to_ltx as array_to_latex; # <- has issues
|
# from array_to_latex import to_ltx as array_to_latex; # <- has issues
|
||||||
from qiskit.visualization import array_to_latex;
|
# from qiskit.visualization import array_to_latex;
|
||||||
|
from tabulate import tabulate;
|
||||||
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# EXPORTS
|
# EXPORTS
|
||||||
@ -23,5 +24,6 @@ __all__ = [
|
|||||||
'display_latex',
|
'display_latex',
|
||||||
'display_png',
|
'display_png',
|
||||||
'display_markdown',
|
'display_markdown',
|
||||||
'array_to_latex',
|
# 'array_to_latex',
|
||||||
|
'tabulate',
|
||||||
];
|
];
|
||||||
|
56
src/thirdparty/types.py
vendored
56
src/thirdparty/types.py
vendored
@ -32,53 +32,55 @@ from typing import Any;
|
|||||||
from typing import Awaitable;
|
from typing import Awaitable;
|
||||||
from typing import Callable;
|
from typing import Callable;
|
||||||
from typing import ClassVar;
|
from typing import ClassVar;
|
||||||
|
from typing import Concatenate;
|
||||||
from typing import Coroutine;
|
from typing import Coroutine;
|
||||||
from typing import Generator;
|
from typing import Generator;
|
||||||
from typing import Generic;
|
from typing import Generic;
|
||||||
|
from typing import Literal;
|
||||||
from typing import Optional;
|
from typing import Optional;
|
||||||
|
from typing import ParamSpec;
|
||||||
from typing import Type;
|
from typing import Type;
|
||||||
from typing import TypeVar;
|
from typing import TypeVar;
|
||||||
from typing_extensions import Concatenate;
|
|
||||||
from typing_extensions import ParamSpec;
|
|
||||||
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
# EXPORTS
|
# EXPORTS
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
'Enum',
|
|
||||||
'BytesIO',
|
|
||||||
'NDArray',
|
|
||||||
'Shape',
|
|
||||||
'Bool',
|
|
||||||
'UInt',
|
|
||||||
'UInt8',
|
|
||||||
'UInt32',
|
|
||||||
'UInt64',
|
|
||||||
'Int',
|
|
||||||
'Int32',
|
|
||||||
'Int64',
|
|
||||||
'Float',
|
|
||||||
'Float32',
|
|
||||||
'Float64',
|
|
||||||
'uint8',
|
|
||||||
'int32',
|
|
||||||
'int64',
|
|
||||||
'float32',
|
|
||||||
'float64',
|
|
||||||
'complex64',
|
|
||||||
'complex128',
|
|
||||||
'conint',
|
|
||||||
'Any',
|
'Any',
|
||||||
'Awaitable',
|
'Awaitable',
|
||||||
|
'Bool',
|
||||||
|
'BytesIO',
|
||||||
'Callable',
|
'Callable',
|
||||||
'ClassVar',
|
'ClassVar',
|
||||||
|
'complex128',
|
||||||
|
'complex64',
|
||||||
|
'Concatenate',
|
||||||
|
'conint',
|
||||||
'Coroutine',
|
'Coroutine',
|
||||||
|
'Enum',
|
||||||
|
'Float',
|
||||||
|
'Float32',
|
||||||
|
'float32',
|
||||||
|
'Float64',
|
||||||
|
'float64',
|
||||||
'Generator',
|
'Generator',
|
||||||
'Generic',
|
'Generic',
|
||||||
|
'Int',
|
||||||
|
'Int32',
|
||||||
|
'int32',
|
||||||
|
'Int64',
|
||||||
|
'int64',
|
||||||
|
'Literal',
|
||||||
|
'NDArray',
|
||||||
'Optional',
|
'Optional',
|
||||||
|
'ParamSpec',
|
||||||
|
'Shape',
|
||||||
'Type',
|
'Type',
|
||||||
'TypeVar',
|
'TypeVar',
|
||||||
'Concatenate',
|
'UInt',
|
||||||
'ParamSpec',
|
'UInt32',
|
||||||
|
'UInt64',
|
||||||
|
'UInt8',
|
||||||
|
'uint8',
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user