GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 54-55 lines in 3 locations

app/core.py 1 location

@@ 259-313 (lines=55) @@
256
    y_base = y_fitted_line(m, b, x)
257
    return y_base
258
259
def peak_detection_fxn(data_y):
260
    """The function takes an input of the column containing the y variables in the dataframe,
261
    associated with the current. The function calls the split function, which splits the
262
    column into two arrays, one of the positive and one of the negative values.
263
    This is because cyclic voltammetry delivers negative peaks, but the peakutils function works
264
    better with positive peaks. The function also runs on the middle 80% of data to eliminate
265
    unnecessary noise and messy values associated with pseudo-peaks.The vectors are then imported
266
    into the peakutils.indexes function to determine the significant peak for each array.
267
    The values are stored in a list, with the first index corresponding to the top peak and the
268
    second corresponding to the bottom peak.
269
    Parameters
270
    ______________
271
    y column: must be a column from a pandas dataframe
272
273
    Returns
274
    _____________
275
    A list with the index of the peaks from the top curve and bottom curve.
276
    """
277
278
    # initialize storage list
279
    index_list = []
280
281
    # split data into above and below the baseline
282
    col_y1, col_y2 = split(data_y) # removed main. head.
283
284
    # detemine length of data and what 10% of the data is
285
    len_y = len(col_y1)
286
    ten_percent = int(np.around(0.1*len_y))
287
288
    # adjust both input columns to be the middle 80% of data
289
    # (take of the first and last 10% of data)
290
    # this avoid detecting peaks from electrolysis
291
    # (from water splitting and not the molecule itself,
292
    # which can form random "peaks")
293
    mod_col_y2 = col_y2[ten_percent:len_y-ten_percent]
294
    mod_col_y1 = col_y1[ten_percent:len_y-ten_percent]
295
296
    # run peakutils package to detect the peaks for both top and bottom
297
    peak_top = peakutils.indexes(mod_col_y2, thres=0.99, min_dist=20)
298
    peak_bottom = peakutils.indexes(abs(mod_col_y1), thres=0.99, min_dist=20)
299
300
    # detemine length of both halves of data
301
    len_top = len(peak_top)
302
    len_bot = len(peak_bottom)
303
304
    # append the values to the storage list
305
    # manipulate values by adding the ten_percent value back
306
    # (as the indecies have moved)
307
    # to detect the actual peaks and not the modified values
308
    index_list.append(peak_top[int(len_top/2)]+ten_percent)
309
    index_list.append(peak_bottom[int(len_bot/2)]+ten_percent)
310
311
    # return storage list
312
    # first value is the top, second value is the bottom
313
    return index_list
314
315
316
def peak_values(DataFrame_x, DataFrame_y):

voltcycle/core.py 1 location

@@ 215-269 (lines=55) @@
212
    y_base = y_fitted_line(m, b, x)
213
    return y_base
214
215
def peak_detection_fxn(data_y):
216
    """The function takes an input of the column containing the y variables in the dataframe,
217
    associated with the current. The function calls the split function, which splits the
218
    column into two arrays, one of the positive and one of the negative values.
219
    This is because cyclic voltammetry delivers negative peaks, but the peakutils function works
220
    better with positive peaks. The function also runs on the middle 80% of data to eliminate
221
    unnecessary noise and messy values associated with pseudo-peaks.The vectors are then imported
222
    into the peakutils.indexes function to determine the significant peak for each array.
223
    The values are stored in a list, with the first index corresponding to the top peak and the
224
    second corresponding to the bottom peak.
225
    Parameters
226
    ______________
227
    y column: must be a column from a pandas dataframe
228
229
    Returns
230
    _____________
231
    A list with the index of the peaks from the top curve and bottom curve.
232
    """
233
234
    # initialize storage list
235
    index_list = []
236
237
    # split data into above and below the baseline
238
    col_y1, col_y2 = split(data_y) # removed main. head.
239
240
    # detemine length of data and what 10% of the data is
241
    len_y = len(col_y1)
242
    ten_percent = int(np.around(0.1*len_y))
243
244
    # adjust both input columns to be the middle 80% of data
245
    # (take of the first and last 10% of data)
246
    # this avoid detecting peaks from electrolysis
247
    # (from water splitting and not the molecule itself,
248
    # which can form random "peaks")
249
    mod_col_y2 = col_y2[ten_percent:len_y-ten_percent]
250
    mod_col_y1 = col_y1[ten_percent:len_y-ten_percent]
251
252
    # run peakutils package to detect the peaks for both top and bottom
253
    peak_top = peakutils.indexes(mod_col_y2, thres=0.99, min_dist=20)
254
    peak_bottom = peakutils.indexes(abs(mod_col_y1), thres=0.99, min_dist=20)
255
256
    # detemine length of both halves of data
257
    len_top = len(peak_top)
258
    len_bot = len(peak_bottom)
259
260
    # append the values to the storage list
261
    # manipulate values by adding the ten_percent value back
262
    # (as the indecies have moved)
263
    # to detect the actual peaks and not the modified values
264
    index_list.append(peak_top[int(len_top/2)]+ten_percent)
265
    index_list.append(peak_bottom[int(len_bot/2)]+ten_percent)
266
267
    # return storage list
268
    # first value is the top, second value is the bottom
269
    return index_list
270
271
272
def peak_values(DataFrame_x, DataFrame_y):

voltcycle/submodule/peak_detection_fxn.py 1 location

@@ 12-65 (lines=54) @@
9
import main
10
11
12
def peak_detection_fxn(data_y):
13
    """The function takes an input of the column containing the y variables in the dataframe,
14
    associated with the current. The function calls the split function, which splits the
15
    column into two arrays, one of the positive and one of the negative values.
16
    This is because cyclic voltammetry delivers negative peaks, but the peakutils function works
17
    better with positive peaks. The function also runs on the middle 80% of data to eliminate
18
    unnecessary noise and messy values associated with pseudo-peaks.The vectors are then imported
19
    into the peakutils.indexes function to determine the significant peak for each array.
20
    The values are stored in a list, with the first index corresponding to the top peak and the
21
    second corresponding to the bottom peak.
22
    Parameters
23
    ______________
24
    y column: must be a column from a pandas dataframe
25
    Returns
26
    _____________
27
    A list with the index of the peaks from the top curve and bottom curve.
28
    """
29
30
    # initialize storage list
31
    index_list = []
32
33
    # split data into above and below the baseline
34
    col_y1, col_y2 = main.split(data_y)
35
36
    # detemine length of data and what 10% of the data is
37
    len_y = len(col_y1)
38
    ten_percent = int(np.around(0.1*len_y))
39
40
    # adjust both input columns to be the middle 80% of data
41
    # (take of the first and last 10% of data)
42
    # this avoid detecting peaks from electrolysis
43
    # (from water splitting and not the molecule itself,
44
    # which can form random "peaks")
45
    mod_col_y2 = col_y2[ten_percent:len_y-ten_percent]
46
    mod_col_y1 = col_y1[ten_percent:len_y-ten_percent]
47
48
    # run peakutils package to detect the peaks for both top and bottom
49
    peak_top = peakutils.indexes(mod_col_y2, thres=0.99, min_dist=20)
50
    peak_bottom = peakutils.indexes(abs(mod_col_y1), thres=0.99, min_dist=20)
51
52
    # detemine length of both halves of data
53
    len_top = len(peak_top)
54
    len_bot = len(peak_bottom)
55
56
    # append the values to the storage list
57
    # manipulate values by adding the ten_percent value back
58
    # (as the indecies have moved)
59
    # to detect the actual peaks and not the modified values
60
    index_list.append(peak_top[int(len_top/2)]+ten_percent)
61
    index_list.append(peak_bottom[int(len_bot/2)]+ten_percent)
62
63
    # return storage list
64
    # first value is the top, second value is the bottom
65
    return index_list