gpe-lib 0.0.1__py3-none-any.whl

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/__init__.py 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()
gpe_lib/imports.py ADDED
@@ -0,0 +1,6 @@
1
+ import matplotlib.pyplot as plt
2
+ import numpy as np
3
+ import pandas as pd
4
+
5
+ import os
6
+ import matplotlib.ticker as mtick
@@ -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,5 @@
1
+ # gpe_lib/notebooki/__init__.py
2
+ # --- IMPORTS ---------------------------------------------------------------
3
+ # --- DECLARATIONS ----------------------------------------------------------
4
+ # --- FUNCTIONS -------------------------------------------------------------
5
+ # --- COMMANDS --------------------------------------------------------------
@@ -0,0 +1,25 @@
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
+ print("Setting colab settings")
11
+
12
+ import matplotlib.pyplot as plt
13
+ plt.rcParams["figure.figsize"] = (3,3)
14
+
15
+ from google.colab import output, files
16
+ output.enable_custom_widget_manager()
17
+
18
+ # --- COMMANDS --------------------------------------------------------------
19
+ print("Importing colab settings")
20
+ settings()
21
+
22
+ try:
23
+ os.system("pip install ipympl")
24
+ import ipympl
25
+ except: pass
@@ -0,0 +1,13 @@
1
+ # gpe_lib/notebook/jupyter/__init__.py
2
+ # --- IMPORTS ---------------------------------------------------------------
3
+
4
+ # --- DECLARATIONS ----------------------------------------------------------
5
+
6
+ # --- FUNCTIONS -------------------------------------------------------------
7
+ def settings():
8
+ print("Setting jupyter settings")
9
+ return
10
+
11
+ # --- COMMANDS --------------------------------------------------------------
12
+ print("Importing jupyter settings")
13
+ settings()
@@ -0,0 +1,6 @@
1
+ Metadata-Version: 2.1
2
+ Name: gpe_lib
3
+ Version: 0.0.1
4
+ Summary: Funcionalidades bem comumente usadas por mim
5
+ Author: Gustavo Exel
6
+
@@ -0,0 +1,12 @@
1
+ gpe_lib/__init__.py,sha256=UuSMcSKLJtxHNZD9WIsvso8AL0GPkSsp7qWo5YkmNvk,2580
2
+ gpe_lib/imports.py,sha256=0sgUi2xhQgPdoGfRahl_wZ3pKMuw-4hw9dDbLDiSr10,116
3
+ gpe_lib/notebook/__init__.py,sha256=9e4B-k_4zKHyRKoaC9n7fT6mL5oa68k6Huw98puMV8E,342
4
+ gpe_lib/notebook/colab.py,sha256=m6lrLGAhtb9Q3s4N3Wa6-JF3CchkCbuQ_FQWzzNAC2M,661
5
+ gpe_lib/notebook/jupyter.py,sha256=8qxY_CJlxaXsRGZcyHZmJk3paktRM9Urz67RRhSr_dA,395
6
+ gpe_lib/notebooki/__init__.py,sha256=6uZbFcl3N9ppOl7Qnl78z3R3BIdXNzvOd-YMRDYITqU,343
7
+ gpe_lib/notebooki/colab.py,sha256=f8LgtCKQX0yO8i7BN4aUoCuqrE1ncmxTNynst9Zn-8I,732
8
+ gpe_lib/notebooki/jupyter.py,sha256=M657y1WV_jIc4gPrmsuah5hKiu60ETMG7xQ7Qo3_abw,469
9
+ gpe_lib-0.0.1.dist-info/METADATA,sha256=VpsXPs93XGemIuj0bYX5z3H1sHhNTfDCoAXqtXpCYkE,133
10
+ gpe_lib-0.0.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
11
+ gpe_lib-0.0.1.dist-info/top_level.txt,sha256=5skBuTtZQFyRnJy6zYefBDKPbjEN5n7p0WfsouOBM9k,25
12
+ gpe_lib-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.43.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ gpe_lib
2
+ gpe_lib/notebook