gpe-lib 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gpe_lib-0.0.1/PKG-INFO +5 -0
- gpe_lib-0.0.1/gpe_lib/__init__.py +41 -0
- gpe_lib-0.0.1/gpe_lib/imports.py +6 -0
- gpe_lib-0.0.1/gpe_lib/notebook/__init__.py +5 -0
- gpe_lib-0.0.1/gpe_lib/notebook/colab.py +22 -0
- gpe_lib-0.0.1/gpe_lib/notebook/jupyter.py +11 -0
- gpe_lib-0.0.1/gpe_lib.egg-info/PKG-INFO +5 -0
- gpe_lib-0.0.1/gpe_lib.egg-info/SOURCES.txt +14 -0
- gpe_lib-0.0.1/gpe_lib.egg-info/dependency_links.txt +1 -0
- gpe_lib-0.0.1/gpe_lib.egg-info/not-zip-safe +1 -0
- gpe_lib-0.0.1/gpe_lib.egg-info/top_level.txt +2 -0
- gpe_lib-0.0.1/setup.cfg +4 -0
- gpe_lib-0.0.1/setup.py +12 -0
gpe_lib-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# gpe_lib/__init__.py
|
|
2
|
+
# --- IMPORTS ---------------------------------------------------------------
|
|
3
|
+
from . import notebook
|
|
4
|
+
import os, requests, matplotlib, matplotlib.font_manager
|
|
5
|
+
|
|
6
|
+
# --- DECLARATIONS ----------------------------------------------------------
|
|
7
|
+
NIDEC = True
|
|
8
|
+
|
|
9
|
+
colors_dict = {"ngreen":"#009B49", "ngrey":'#666666', "nblack":"#000000", "egreen":"#008691","yellow":"#BEBE00","blue":"#59B2D8","red":"#FF0000"}
|
|
10
|
+
colors_list = list(colors_dict.values())
|
|
11
|
+
|
|
12
|
+
# --- FUNCTIONS -------------------------------------------------------------
|
|
13
|
+
def set_nidec_color_cycle():
|
|
14
|
+
import matplotlib.pyplot as plt
|
|
15
|
+
plt.rcParams["axes.prop_cycle"] = plt.cycler(color=colors_list)
|
|
16
|
+
|
|
17
|
+
def __use_font(family,fonts):
|
|
18
|
+
fonts_dir = os.path.realpath(os.path.join(os.path.dirname(__file__),os.path.pardir,os.path.pardir,"files"))
|
|
19
|
+
if not os.path.exists(fonts_dir): os.makedirs(fonts_dir)
|
|
20
|
+
|
|
21
|
+
for fn,url in fonts:
|
|
22
|
+
filename = os.path.join(fonts_dir,fn)
|
|
23
|
+
if not os.path.exists(filename):
|
|
24
|
+
print(f"Downloading {fn}...")
|
|
25
|
+
with open(filename, "wb") as f: [f.write(chunk) if chunk else None for chunk in requests.get(url, stream=True).iter_content(chunk_size=8192)]
|
|
26
|
+
matplotlib.font_manager.fontManager.addfont(filename)
|
|
27
|
+
matplotlib.rc("font", family=family)
|
|
28
|
+
|
|
29
|
+
def use_times():
|
|
30
|
+
__use_font("Times New Roman",[("Times New Roman.ttf","https://github.com/justrajdeep/fonts/raw/master/Times%20New%20Roman.ttf"),("Times New Roman - Bold.ttf","https://github.com/justrajdeep/fonts/raw/master/Times%20New%20Roman%20Bold.ttf"),("Times New Roman Italic.ttf","https://github.com/justrajdeep/fonts/raw/master/Times%20New%20Roman%20Italic.ttf"),("Times New Roman Bold Italic.ttf","https://github.com/justrajdeep/fonts/raw/master/Times%20New%20Roman%20Bold%20Italic.ttf")])
|
|
31
|
+
matplotlib.rcParams.update({"font.family":"Times New Roman","mathtext.rm":"Times New Roman","mathtext.it":"Times New Roman:italic","mathtext.bf":"Times New Roman:bold","mathtext.fontset":"custom"})
|
|
32
|
+
|
|
33
|
+
def use_comfortaa():
|
|
34
|
+
__use_font("Comfortaa",[("Comfortaa-Regular.ttf","https://github.com/googlefonts/comfortaa/raw/main/fonts/TTF/Comfortaa-Regular.ttf"),("Comfortaa-Bold.ttf","https://github.com/googlefonts/comfortaa/raw/main/fonts/TTF/Comfortaa-Bold.ttf")])
|
|
35
|
+
matplotlib.rcParams.update({"font.family":"Comfortaa","mathtext.rm":"Comfortaa","mathtext.it":"Comfortaa:italic","mathtext.bf":"Comfortaa:bold","mathtext.fontset":"custom"})
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# --- COMMANDS --------------------------------------------------------------
|
|
39
|
+
if NIDEC:
|
|
40
|
+
set_nidec_color_cycle()
|
|
41
|
+
use_times()
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# gpe_lib/notebook/__init__.py
|
|
2
|
+
# --- IMPORTS ---------------------------------------------------------------
|
|
3
|
+
# --- DECLARATIONS ----------------------------------------------------------
|
|
4
|
+
# --- FUNCTIONS -------------------------------------------------------------
|
|
5
|
+
# --- COMMANDS --------------------------------------------------------------
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# gpe_lib/notebook/colab/__init__.py
|
|
2
|
+
# --- IMPORTS ---------------------------------------------------------------
|
|
3
|
+
import os
|
|
4
|
+
from google.colab import files
|
|
5
|
+
|
|
6
|
+
# --- DECLARATIONS ----------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
# --- FUNCTIONS -------------------------------------------------------------
|
|
9
|
+
def settings():
|
|
10
|
+
import matplotlib.pyplot as plt
|
|
11
|
+
plt.rcParams["figure.figsize"] = (3,3)
|
|
12
|
+
|
|
13
|
+
from google.colab import output, files
|
|
14
|
+
output.enable_custom_widget_manager()
|
|
15
|
+
|
|
16
|
+
# --- COMMANDS --------------------------------------------------------------
|
|
17
|
+
settings()
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
os.system("pip install ipympl")
|
|
21
|
+
import ipympl
|
|
22
|
+
except: pass
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# gpe_lib/notebook/jupyter/__init__.py
|
|
2
|
+
# --- IMPORTS ---------------------------------------------------------------
|
|
3
|
+
|
|
4
|
+
# --- DECLARATIONS ----------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
# --- FUNCTIONS -------------------------------------------------------------
|
|
7
|
+
def settings():
|
|
8
|
+
return
|
|
9
|
+
|
|
10
|
+
# --- COMMANDS --------------------------------------------------------------
|
|
11
|
+
settings()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
setup.py
|
|
2
|
+
gpe_lib/__init__.py
|
|
3
|
+
gpe_lib/imports.py
|
|
4
|
+
gpe_lib.egg-info/PKG-INFO
|
|
5
|
+
gpe_lib.egg-info/SOURCES.txt
|
|
6
|
+
gpe_lib.egg-info/dependency_links.txt
|
|
7
|
+
gpe_lib.egg-info/not-zip-safe
|
|
8
|
+
gpe_lib.egg-info/top_level.txt
|
|
9
|
+
gpe_lib/notebook/__init__.py
|
|
10
|
+
gpe_lib/notebook/colab.py
|
|
11
|
+
gpe_lib/notebook/jupyter.py
|
|
12
|
+
gpe_lib/notebook/__init__.py
|
|
13
|
+
gpe_lib/notebook/colab.py
|
|
14
|
+
gpe_lib/notebook/jupyter.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
gpe_lib-0.0.1/setup.cfg
ADDED
gpe_lib-0.0.1/setup.py
ADDED