py2ls 0.1.5.6__py3-none-any.whl → 0.1.5.8__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."""
@@ -2047,7 +2052,9 @@ def figsets(*args):
2047
2052
  # tick location
2048
2053
  if "tic" in key.lower() or "tk" in key.lower():
2049
2054
  if ("loc" in key.lower()) or ("po" in key.lower()):
2050
- if isinstance(value, (str, list)):
2055
+ if isinstance(value,str):
2056
+ value=[value]
2057
+ if isinstance(value, list):
2051
2058
  loc = []
2052
2059
  for i in value:
2053
2060
  if ("l" in i.lower()) and ("a" not in i.lower()):
@@ -2067,6 +2074,8 @@ def figsets(*args):
2067
2074
  ax.yaxis.set_ticks_position("none")
2068
2075
  # ticks / labels
2069
2076
  elif "x" in key.lower():
2077
+ if value is None:
2078
+ value=[]
2070
2079
  if "la" not in key.lower():
2071
2080
  ax.set_xticks(value)
2072
2081
  if "la" in key.lower():
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,32 +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,label=label_fill)
157
- line = ax.plot(x, yMean, color=acolor, lw=lw, ls=ls, marker=marker, label=label_line)
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)
158
197
  return line[0], fill
159
- # =============================================================================
160
- # # for plot figures {Qiu et al.2023}
161
- # =============================================================================
162
- # =============================================================================
163
- # plt.rcParams.update({'figure.max_open_warning': 0})
164
- # # Output matplotlib figure to SVG with text as text, not curves
165
- # plt.rcParams['svg.fonttype'] = 'none'
166
- # plt.rcParams['pdf.fonttype'] = 42
167
- #
168
- # plt.rc('text', usetex=False)
169
- # # plt.style.use('ggplot')
170
- # plt.style.use('science')
171
- # plt.rc('font', family='serif')
172
- # plt.rcParams.update({
173
- # "font.family": "serif", # specify font family here
174
- # "font.serif": ["Arial"], # specify font here
175
- # "font.size": 11})
176
- # # plt.tight_layout()
177
- # =============================================================================
178
- # =============================================================================
179
- # # axis spine
180
- # # use it like: adjust_spines(ax, ['left', 'bottom'])
181
- # =============================================================================
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.6
3
+ Version: 0.1.5.8
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=LFdQ7xb8cjowb99C80ypF4w5mH-GFenAKOrUjb55YFQ,96954
129
129
  py2ls/netfinder.py,sha256=ZsLWGYMeRuGvxj2nqE0Z8ANoaVl18Necfw0HQfh2q7I,45548
130
- py2ls/plot.py,sha256=b9eks1nDM0Z8QC3MA6-zQWl6qi_gQozUSV1lBGMurfM,7118
130
+ py2ls/plot.py,sha256=4dxZsE2Ir7faNlKbRHLT2aEL5xEYGu1ENlWhIuFH9zE,7700
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.6.dist-info/METADATA,sha256=mjKYEOH2E5TfH1CIoUeOkfAe_g46Za1zYwKLPt8gHGE,17943
137
- py2ls-0.1.5.6.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
138
- py2ls-0.1.5.6.dist-info/RECORD,,
136
+ py2ls-0.1.5.8.dist-info/METADATA,sha256=8Hu8LqDOHQ5_OEoHl5EubNAvkMiLeI_Y1GurfdFxevg,17943
137
+ py2ls-0.1.5.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
138
+ py2ls-0.1.5.8.dist-info/RECORD,,