corelp 1.0.35__py3-none-any.whl → 1.0.37__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.
- corelp/modules/Section_LP/Section.py +3 -3
- corelp/modules/main_LP/main.py +3 -5
- corelp/modules/print_LP/print.py +11 -6
- {corelp-1.0.35.dist-info → corelp-1.0.37.dist-info}/METADATA +6 -3
- {corelp-1.0.35.dist-info → corelp-1.0.37.dist-info}/RECORD +6 -6
- {corelp-1.0.35.dist-info → corelp-1.0.37.dist-info}/WHEEL +0 -0
|
@@ -99,17 +99,17 @@ class Section() :
|
|
|
99
99
|
@wraps(func)
|
|
100
100
|
def wrapper(*args, **kwargs):
|
|
101
101
|
wrapper.path = self.path / f"{num:03}_{name}"
|
|
102
|
-
print(f'\n#### {num}. {name.replace("_"," ")} section
|
|
102
|
+
print(f'\n#### **{num}. {name.replace("_"," ")} section**\n')
|
|
103
103
|
|
|
104
104
|
# Creating hash
|
|
105
105
|
if cache :
|
|
106
|
-
print('**Call hash:**')
|
|
106
|
+
print('**Call hash:**', do_stdout=False)
|
|
107
107
|
bound = inspect.signature(func).bind(*args, **kwargs)
|
|
108
108
|
bound.apply_defaults()
|
|
109
109
|
serialized = pickle.dumps(bound.arguments)
|
|
110
110
|
args_hash = hashlib.md5(serialized).hexdigest()
|
|
111
111
|
result_file = wrapper.path / f'{args_hash}.pkl'
|
|
112
|
-
print(f'*{args_hash}*\n')
|
|
112
|
+
print(f'*{args_hash}*\n', do_stdout=False)
|
|
113
113
|
|
|
114
114
|
# Checking already calculated exists
|
|
115
115
|
if result_file.exists() and not new :
|
corelp/modules/main_LP/main.py
CHANGED
|
@@ -51,8 +51,6 @@ def main() :
|
|
|
51
51
|
The import_subfolders and export_subfolder are defined from import_path and export_path respectively (they are not absolute from root path).
|
|
52
52
|
overnight : bool
|
|
53
53
|
If True and exception occurs, will skip and pass to the next run in bulk processing. To use for example for overnight bulk processing.
|
|
54
|
-
run_name : str or None
|
|
55
|
-
Prefix to use for the output folder, if None takes the name of function decorated.
|
|
56
54
|
|
|
57
55
|
Examples
|
|
58
56
|
--------
|
|
@@ -180,7 +178,7 @@ def main() :
|
|
|
180
178
|
print_status = kwargsself(print)
|
|
181
179
|
print.console = None
|
|
182
180
|
print.file = md_file
|
|
183
|
-
print(f'\n\n\n# BEGIN {name}
|
|
181
|
+
print(f'\n\n\n# **BEGIN {name}**\n')
|
|
184
182
|
print(f"{time.ctime()}")
|
|
185
183
|
if ipath != "None" :
|
|
186
184
|
print(f'import_path : {ipath}\n')
|
|
@@ -209,7 +207,7 @@ def main() :
|
|
|
209
207
|
#Applying function
|
|
210
208
|
print("\n---\n")
|
|
211
209
|
subfolder_string = f"{export_subfolder}" if export_subfolder != "" else ""
|
|
212
|
-
print(f'## Launched script {subfolder_string}
|
|
210
|
+
print(f'## **Launched script {subfolder_string}**\n')
|
|
213
211
|
tic = time.perf_counter()
|
|
214
212
|
try :
|
|
215
213
|
results[export_subfolder] = new_func()
|
|
@@ -231,7 +229,7 @@ def main() :
|
|
|
231
229
|
|
|
232
230
|
# END
|
|
233
231
|
print(time.ctime())
|
|
234
|
-
print(f'# END {name}
|
|
232
|
+
print(f'# **END {name}**\n\n')
|
|
235
233
|
print.export_html(html_file)
|
|
236
234
|
selfkwargs(print, print_status)
|
|
237
235
|
if _bulk is None :
|
corelp/modules/print_LP/print.py
CHANGED
|
@@ -20,6 +20,7 @@ This function overrides python built in print function to add functionnalities.
|
|
|
20
20
|
from corelp import prop
|
|
21
21
|
from dataclasses import dataclass, field
|
|
22
22
|
from datetime import datetime, timedelta
|
|
23
|
+
from numpy._core.numeric import True_
|
|
23
24
|
from rich import print as richprint
|
|
24
25
|
from rich.console import Console
|
|
25
26
|
from rich.theme import Theme
|
|
@@ -135,7 +136,7 @@ class Print() :
|
|
|
135
136
|
"""
|
|
136
137
|
|
|
137
138
|
# Main function
|
|
138
|
-
def __call__(self, *strings, verbose=None, return_string=False, file=None, mode='a', end='\n', **kwargs) :
|
|
139
|
+
def __call__(self, *strings, verbose=None, do_stdout=True, do_file=True, return_string=False, file=None, mode='a', end='\n', **kwargs) :
|
|
139
140
|
|
|
140
141
|
# Muting
|
|
141
142
|
verbose = verbose if verbose is not None else self.verbose
|
|
@@ -146,13 +147,16 @@ class Print() :
|
|
|
146
147
|
string = ", ".join([str(string) for string in strings]) + end
|
|
147
148
|
|
|
148
149
|
# Printing markdown
|
|
149
|
-
|
|
150
|
+
if do_stdout :
|
|
151
|
+
string2print = Markdown(string) if self.apply_markdown else string
|
|
152
|
+
self.print(string2print, **kwargs)
|
|
150
153
|
|
|
151
154
|
# Writting to file
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
file
|
|
155
|
+
if do_file :
|
|
156
|
+
file = file if file is not None else self.file
|
|
157
|
+
if file is not None :
|
|
158
|
+
with open(Path(file), mode) as file :
|
|
159
|
+
file.write(string)
|
|
156
160
|
|
|
157
161
|
# Return
|
|
158
162
|
if return_string :
|
|
@@ -174,6 +178,7 @@ class Print() :
|
|
|
174
178
|
return self.console.log
|
|
175
179
|
pyprint = pyprint # python print
|
|
176
180
|
richprint = richprint # rich prints
|
|
181
|
+
apply_markdown : bool = field(default=True, repr=False) # True to apply rich markdown formatting in prints
|
|
177
182
|
|
|
178
183
|
|
|
179
184
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: corelp
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.37
|
|
4
4
|
Summary: A library that gathers core functions for python programming.
|
|
5
|
-
Requires-Dist: joblib
|
|
6
|
-
Requires-Dist: rich
|
|
5
|
+
Requires-Dist: joblib ; extra == 'script'
|
|
6
|
+
Requires-Dist: rich ; extra == 'script'
|
|
7
|
+
Requires-Dist: marimo ; extra == 'script'
|
|
7
8
|
Requires-Python: >=3.12
|
|
9
|
+
Provides-Extra: lib
|
|
10
|
+
Provides-Extra: script
|
|
8
11
|
Description-Content-Type: text/markdown
|
|
9
12
|
|
|
10
13
|
# coreLP
|
|
@@ -3,7 +3,7 @@ corelp/icon_pythonLP.png,sha256=pg386kYEKGspDDRbRF0alOmHXPEm0geMoYIPaxEfQ_o,3805
|
|
|
3
3
|
corelp/modules/Path_LP/Path.py,sha256=wfvO1DuewIUSEA9_g66O5nCEp95Pr5XM-yxaOOEimTs,2418
|
|
4
4
|
corelp/modules/Path_LP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
corelp/modules/Path_LP/test_Path.py,sha256=8VSn9VVbhc3EDxXpxQV18rnAq_T2a1uuoRFKdmsqX-I,715
|
|
6
|
-
corelp/modules/Section_LP/Section.py,sha256=
|
|
6
|
+
corelp/modules/Section_LP/Section.py,sha256=0uqvqzuBd5qSoOBqqpx4mN7SZERMCOdZfAEMBsQL004,6098
|
|
7
7
|
corelp/modules/Section_LP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
corelp/modules/Section_LP/test_Section.py,sha256=zcrIbJueMDT90t0_M-RD40IWpkx4OT7Q52tE6HzbfIo,812
|
|
9
9
|
corelp/modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -19,10 +19,10 @@ corelp/modules/kwargsself_LP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
|
|
|
19
19
|
corelp/modules/kwargsself_LP/kwargsself.py,sha256=24HVn1G7ALdhQFSLT0U2dVjVzop6c2s-nr7DrMK53iw,1865
|
|
20
20
|
corelp/modules/kwargsself_LP/test_kwargsself.py,sha256=BaqGu0bqFuFemiYUEDMviFfegTb0aF6lmeFm3KJa8sw,1241
|
|
21
21
|
corelp/modules/main_LP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
-
corelp/modules/main_LP/main.py,sha256=
|
|
22
|
+
corelp/modules/main_LP/main.py,sha256=nbb35whCWI1fnjqCr_3QI1qDdEAVO8DHts39HnrguwY,10063
|
|
23
23
|
corelp/modules/main_LP/test_main.py,sha256=mxL645pZdkJ8J5MFdj0K-z8xRCGKQ0zw1NvmW3iPGB4,1741
|
|
24
24
|
corelp/modules/print_LP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
-
corelp/modules/print_LP/print.py,sha256=
|
|
25
|
+
corelp/modules/print_LP/print.py,sha256=TXnxPc4bHf6zSaQkHJ-3iQNkERCG7hvb-tmCAgp94r0,8980
|
|
26
26
|
corelp/modules/print_LP/test_print.py,sha256=uMmCrnyIVSlZg_ZEOk2mr5zDlEpTN2KMq4jFu5p6n4I,2292
|
|
27
27
|
corelp/modules/prop_LP/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
corelp/modules/prop_LP/prop.py,sha256=lfsENmjg65mpXxt9V9n3Nn__wHgNJA61l8_UXBKn1lc,3999
|
|
@@ -44,6 +44,6 @@ corelp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
44
44
|
corelp/pythonLP.png:Zone.Identifier,sha256=uVLSTPcBvE56fSHhroXGEYJOgFeaiYNsDLSbGTRGzP4,25
|
|
45
45
|
corelp/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
46
|
corelp/scripts.json,sha256=RBNvo1WzZ4oRRq0W9-hknpT7T8If536DEMBg9hyq_4o,2
|
|
47
|
-
corelp-1.0.
|
|
48
|
-
corelp-1.0.
|
|
49
|
-
corelp-1.0.
|
|
47
|
+
corelp-1.0.37.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
|
|
48
|
+
corelp-1.0.37.dist-info/METADATA,sha256=ML8PH0xON63YuMqExPNOgloYPM3jESPiLiaBiS8OWoQ,1823
|
|
49
|
+
corelp-1.0.37.dist-info/RECORD,,
|
|
File without changes
|