py2ls 0.1.5.5__py3-none-any.whl → 0.1.5.7__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.
@@ -45,3 +45,6 @@ bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144a
45
45
  bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144af Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1720952321 +0200 remote set-head
46
46
  bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144af Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1720954284 +0200 remote set-head
47
47
  bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144af Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1720956245 +0200 remote set-head
48
+ bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144af Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1720958208 +0200 remote set-head
49
+ bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144af Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1720960171 +0200 remote set-head
50
+ bf67907e337021ebff434e02b19b30a741c144af bf67907e337021ebff434e02b19b30a741c144af Jianfeng Liu <macjianfeng@jflmbp.speedport.ip> 1720962134 +0200 remote set-head
py2ls/ips.py CHANGED
@@ -44,6 +44,11 @@ from duckduckgo_search import DDGS
44
44
 
45
45
  from py2ls import netfinder
46
46
 
47
+ try:
48
+ get_ipython().run_line_magic('load_ext', 'autoreload')
49
+ get_ipython().run_line_magic('autoreload', '2')
50
+ except NameError:
51
+ pass
47
52
 
48
53
  def is_package_installed(package_name):
49
54
  """Check if a package is installed."""
py2ls/plot.py CHANGED
@@ -2,8 +2,19 @@ from scipy.signal import savgol_filter
2
2
  import numpy as np
3
3
  import matplotlib.pyplot as plt
4
4
 
5
+
5
6
  def stdshade(ax=None,*args, **kwargs):
7
+ # Separate kws_line and kws_fill if necessary
8
+ kws_line = kwargs.pop('kws_line', {})
9
+ kws_fill = kwargs.pop('kws_fill', {})
6
10
 
11
+ # Merge kws_line and kws_fill into kwargs
12
+ kwargs.update(kws_line)
13
+ kwargs.update(kws_fill)
14
+ def str2list(str_):
15
+ l = []
16
+ [l.append(x) for x in str_]
17
+ return l
7
18
  def hue2rgb(hex_colors):
8
19
  def hex_to_rgb(hex_color):
9
20
  """Converts a hexadecimal color code to RGB values."""
@@ -111,7 +122,7 @@ def stdshade(ax=None,*args, **kwargs):
111
122
  and args[iarg] >= 1
112
123
  ):
113
124
  smth = args[iarg]
114
-
125
+ smth = kwargs.get('smth', smth)
115
126
  if "x" not in locals() or x is None:
116
127
  x = np.arange(1, y.shape[1] + 1)
117
128
  elif len(x) < y.shape[1]:
@@ -150,35 +161,67 @@ def stdshade(ax=None,*args, **kwargs):
150
161
  label=kwargs.get("label",None)
151
162
  label_line = kwargs.get("label_line",None)
152
163
  label_fill = kwargs.get('label_fill',None)
164
+ alpha=kwargs.get('alpha',alpha)
165
+ color=kwargs.get('color', acolor)
153
166
  if not label_line and label:
154
167
  label_line = label
155
-
156
- fill = ax.fill_between(x, yMean + wings, yMean - wings, color=acolor, alpha=alpha, lw=0,**fill_kws)
157
- if line_kws != {} and not any(key.lower() in ['lw', 'linewidth'] for key in line_kws.keys()):
158
- line = ax.plot(x, yMean, color=acolor, lw=lw, ls=ls, marker=marker, label=label_line)
159
- else:
160
- line = ax.plot(x, yMean, color=acolor, ls=ls, marker=marker, label=label_fill)
168
+ kwargs['lw'] = lw
169
+ kwargs['ls'] = ls
170
+ kwargs['label_line'] = label_line
171
+ kwargs['label_fill'] = label_fill
172
+
173
+ # set kws_line
174
+ if 'color' not in kws_line:
175
+ kws_line['color']=color
176
+ if 'lw' not in kws_line:
177
+ kws_line['lw']=lw
178
+ if 'ls' not in kws_line:
179
+ kws_line['ls']=ls
180
+ if 'marker' not in kws_line:
181
+ kws_line['marker']=marker
182
+ if 'label' not in kws_line:
183
+ kws_line['label']=label_line
184
+
185
+ # set kws_line
186
+ if 'color' not in kws_fill:
187
+ kws_fill['color']=color
188
+ if 'alpha' not in kws_fill:
189
+ kws_fill['alpha']=alpha
190
+ if 'lw' not in kws_fill:
191
+ kws_fill['lw']=0
192
+ if 'label' not in kws_fill:
193
+ kws_fill['label']=label_fill
194
+
195
+ fill = ax.fill_between(x, yMean + wings, yMean - wings, **kws_fill)
196
+ line = ax.plot(x, yMean, **kws_line)
161
197
  return line[0], fill
162
- # =============================================================================
163
- # # for plot figures {Qiu et al.2023}
164
- # =============================================================================
165
- # =============================================================================
166
- # plt.rcParams.update({'figure.max_open_warning': 0})
167
- # # Output matplotlib figure to SVG with text as text, not curves
168
- # plt.rcParams['svg.fonttype'] = 'none'
169
- # plt.rcParams['pdf.fonttype'] = 42
170
- #
171
- # plt.rc('text', usetex=False)
172
- # # plt.style.use('ggplot')
173
- # plt.style.use('science')
174
- # plt.rc('font', family='serif')
175
- # plt.rcParams.update({
176
- # "font.family": "serif", # specify font family here
177
- # "font.serif": ["Arial"], # specify font here
178
- # "font.size": 11})
179
- # # plt.tight_layout()
180
- # =============================================================================
181
- # =============================================================================
182
- # # axis spine
183
- # # use it like: adjust_spines(ax, ['left', 'bottom'])
184
- # =============================================================================
198
+
199
+
200
+ """
201
+ ########## Usage 1 ##########
202
+ plot.stdshade(data,
203
+ 'b',
204
+ ':',
205
+ 'd',
206
+ 0.1,
207
+ 4,
208
+ label='ddd',
209
+ label_line='label_line',
210
+ label_fill="label-fill")
211
+ plt.legend()
212
+
213
+ ########## Usage 2 ##########
214
+ plot.stdshade(data,
215
+ 'm-',
216
+ alpha=0.1,
217
+ lw=2,
218
+ ls=':',
219
+ marker='d',
220
+ color='b',
221
+ smth=4,
222
+ label='ddd',
223
+ label_line='label_line',
224
+ label_fill="label-fill")
225
+ plt.legend()
226
+
227
+ """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2ls
3
- Version: 0.1.5.5
3
+ Version: 0.1.5.7
4
4
  Summary: py(thon)2(too)ls
5
5
  Author: Jianfeng
6
6
  Author-email: Jianfeng.Liu0413@gmail.com
@@ -21,7 +21,7 @@ py2ls/.git/index,sha256=ypuqDA3K3KBipX7FdqdgRQozfYsKAFZ-NV09-uWkL-E,1791
21
21
  py2ls/.git/info/exclude,sha256=ZnH-g7egfIky7okWTR8nk7IxgFjri5jcXAbuClo7DsE,240
22
22
  py2ls/.git/logs/HEAD,sha256=n-qGQXJL1v859RevL9KKxp-QckcdkwtFE_0V2hJKyeY,3071
23
23
  py2ls/.git/logs/refs/heads/main,sha256=n-qGQXJL1v859RevL9KKxp-QckcdkwtFE_0V2hJKyeY,3071
24
- py2ls/.git/logs/refs/remotes/origin/HEAD,sha256=NvzruVfHGH-cik1MT2bkZRYh6dEetozA__INkVcdX-w,7647
24
+ py2ls/.git/logs/refs/remotes/origin/HEAD,sha256=EBINh4QbBbWNrNhfKy8uklH_3OvnVcsXE7T9-FFHMZc,8133
25
25
  py2ls/.git/logs/refs/remotes/origin/main,sha256=E4VJChrdCLBY0vhc8_zfVvT_BBBaJAnq524hLd6MiCU,2736
26
26
  py2ls/.git/objects/01/d5bd8065e6860c0bd23ff9fa57161806a099e1,sha256=hEQ8nqJnGsfFsuV5wc4cZas58rehXvT0v5ANx1zmMAY,584
27
27
  py2ls/.git/objects/09/08da26de58c114225ad81f484b80bf5d351b34,sha256=NOyYvrJxATpK3aDdP1_stwkqOQRDwJn7DSy6isyKImE,925
@@ -125,14 +125,14 @@ py2ls/data/db2ls_sql_chtsht.json,sha256=ls9d7Sm8TLeujanWHfHlWhU85Qz1KnAizO_9X3wU
125
125
  py2ls/data/lang_code_iso639.json,sha256=qZiU7H2RLJjDMXK22C-jhwzLJCI5vKmampjB1ys4ek4,2157
126
126
  py2ls/db2ls.py,sha256=MMfFX47aIPIyu7fU9aPvX9lbPRPYOpJ_VXwlnWk-8qo,13615
127
127
  py2ls/freqanalysis.py,sha256=F4218VSPbgL5tnngh6xNCYuNnfR-F_QjECUUxrPYZss,32594
128
- py2ls/ips.py,sha256=hGom81LO6p0zMzgZPucMqAHOmUbXwJr_SEXgOx6HYqI,96679
128
+ py2ls/ips.py,sha256=xyWKqnLN2PFgAFupzzTykbU-EF2tp3rRCj6j8xpCDOM,96822
129
129
  py2ls/netfinder.py,sha256=ZsLWGYMeRuGvxj2nqE0Z8ANoaVl18Necfw0HQfh2q7I,45548
130
- py2ls/plot.py,sha256=mO_B40hU_xs2ByHNLoxwzJd4Vn3bDrWLVLYG6oy5YI8,7311
130
+ py2ls/plot.py,sha256=EbRx_6RuYT1EqDoi_01E6UbO6YPMXQJy83SuKqiOgto,7696
131
131
  py2ls/setuptools-70.1.0-py3-none-any.whl,sha256=2bi3cUVal8ip86s0SOvgspteEF8SKLukECi-EWmFomc,882588
132
132
  py2ls/sleep_events_detectors.py,sha256=36MCuRrpurn0Uvzpo3p3b3_JlVsRNHSWCXbJxCGM3mg,51546
133
133
  py2ls/stats.py,sha256=Wd9yCKQ_61QD29WMEgMuEcreFxF91NmlPW65iWT2B5w,39041
134
134
  py2ls/translator.py,sha256=6S7MmTZmjj8NljVmj0W5uEauu4ePxso3AMf2LvGVRQA,30516
135
135
  py2ls/wb_detector.py,sha256=7y6TmBUj9exCZeIgBAJ_9hwuhkDh1x_-yg4dvNY1_GQ,6284
136
- py2ls-0.1.5.5.dist-info/METADATA,sha256=B9uOJk3_Qa34owSDCx91tDq_xNf17yqMT-rqYwrcaHQ,17943
137
- py2ls-0.1.5.5.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
138
- py2ls-0.1.5.5.dist-info/RECORD,,
136
+ py2ls-0.1.5.7.dist-info/METADATA,sha256=vUwZ_D3iMt___SHaEdzoR1q0l0h0_qknuh-IFAiHoUQ,17943
137
+ py2ls-0.1.5.7.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
138
+ py2ls-0.1.5.7.dist-info/RECORD,,