project
stringlengths 1
98
| commit_sha
stringlengths 40
40
| parent_sha
stringlengths 40
40
| file_path
stringlengths 4
209
| project_url
stringlengths 23
132
| likely_bug
bool 1
class | comodified
bool 1
class | in_function
bool 2
classes | diff
stringlengths 27
9.71k
| before
stringlengths 1
8.91k
| after
stringlengths 1
6k
| sstub_pattern
stringclasses 23
values | edit_script
stringlengths 33
158k
| key
stringlengths 45
154
| commit_message
stringlengths 3
65.5k
⌀ | files
list |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
scikit-image | bda9b4fb3c3ee2892488555865da2b2b7b929e7a | b0b0b112db517c5b87e3bb8d1f16efa98c2f7954 | skimage/restoration/tests/test_restoration.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -45,7 +45,7 @@ def test_unsupervised_wiener():
deconvolved = np.real(restoration.unsupervised_wiener(
data, otf, reg=laplacian, is_real=False,
user_params={"callback": lambda x: None})[0])
- path = pjoin(dirname(abspath("./tests/")), 'camera_unsup2.npy')
+ path = pjoin(dirname(abspath(__file__)), 'camera_unsup2.npy')
np.testing.assert_allclose(deconvolved, np.load(path))
| path = pjoin ( dirname ( abspath ( "./tests/" ) ) , 'camera_unsup2.npy' ) | path = pjoin ( dirname ( abspath ( __file__ ) ) , 'camera_unsup2.npy' ) | SINGLE_TOKEN | [["Insert", ["argument_list", 3, 33, 3, 45], ["identifier:__file__", "T"], 1], ["Delete", ["string:\"./tests/\"", 3, 34, 3, 44]]] | matsuken92/scikit-image@bda9b4fb3c3ee2892488555865da2b2b7b929e7a | Fix travis test | [
{
"sha": "ce1a27a40188b3aed596eb77528966687b0d0638",
"filename": "skimage/restoration/tests/test_restoration.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/bda9b4fb3c3ee2892488555865da2b2b7b929e7a/skimage%2Frestoration%2Ftests%2Ftest_restoration.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/bda9b4fb3c3ee2892488555865da2b2b7b929e7a/skimage%2Frestoration%2Ftests%2Ftest_restoration.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Frestoration%2Ftests%2Ftest_restoration.py?ref=bda9b4fb3c3ee2892488555865da2b2b7b929e7a",
"patch": "@@ -45,7 +45,7 @@ def test_unsupervised_wiener():\n deconvolved = np.real(restoration.unsupervised_wiener(\n data, otf, reg=laplacian, is_real=False,\n user_params={\"callback\": lambda x: None})[0])\n- path = pjoin(dirname(abspath(\"./tests/\")), 'camera_unsup2.npy')\n+ path = pjoin(dirname(abspath(__file__)), 'camera_unsup2.npy')\n np.testing.assert_allclose(deconvolved, np.load(path))\n \n "
}
] |
scikit-image | f1839e685a5e4c9c48e3ce653ba6331af37d3ca7 | f8099fa6acb14ef6c1ee4565f30e46b39ea9c21d | skimage/filter/rank/bilateral.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -146,7 +146,7 @@ def pop_bilateral(image, selem, out=None, mask=None, shift_x=False,
... [0, 1, 1, 1, 0],
... [0, 1, 1, 1, 0],
... [0, 0, 0, 0, 0]], dtype=np.uint16)
- >>> rank.pop_bilateral(imgsquare(3), s0=10, s1=10)
+ >>> rank.pop_bilateral(img, square(3), s0=10, s1=10)
array([[3, 4, 3, 4, 3],
[4, 4, 6, 4, 4],
[3, 6, 9, 6, 3],
| ... [ 0 , 0 , 0 , 0 , 0 ] ] , dtype = np . uint16 ) >> > rank . pop_bilateral ( imgsquare ( 3 ) , s0 = 10 , s1 = 10 ) | ... [ 0 , 0 , 0 , 0 , 0 ] ] , dtype = np . uint16 ) >> > rank . pop_bilateral ( img , square ( 3 ) , s0 = 10 , s1 = 10 ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 27, 3, 55], ["identifier:img", "T"], 1], ["Insert", ["argument_list", 3, 27, 3, 55], [",:,", "T"], 2], ["Update", ["identifier:imgsquare", 3, 28, 3, 37], "square"]] | matsuken92/scikit-image@f1839e685a5e4c9c48e3ce653ba6331af37d3ca7 | Fix pop_bilateral doc test | [
{
"sha": "4f36e62832326607ffc81b7c954912c163d54413",
"filename": "skimage/filter/rank/bilateral.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/f1839e685a5e4c9c48e3ce653ba6331af37d3ca7/skimage%2Ffilter%2Frank%2Fbilateral.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/f1839e685a5e4c9c48e3ce653ba6331af37d3ca7/skimage%2Ffilter%2Frank%2Fbilateral.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilter%2Frank%2Fbilateral.py?ref=f1839e685a5e4c9c48e3ce653ba6331af37d3ca7",
"patch": "@@ -146,7 +146,7 @@ def pop_bilateral(image, selem, out=None, mask=None, shift_x=False,\n ... [0, 1, 1, 1, 0],\n ... [0, 1, 1, 1, 0],\n ... [0, 0, 0, 0, 0]], dtype=np.uint16)\n- >>> rank.pop_bilateral(imgsquare(3), s0=10, s1=10)\n+ >>> rank.pop_bilateral(img, square(3), s0=10, s1=10)\n array([[3, 4, 3, 4, 3],\n [4, 4, 6, 4, 4],\n [3, 6, 9, 6, 3],"
}
] |
scikit-image | 040a21afb90d5e5c3e6ad43748142395259a680f | d71cd4d750600ab871977895fdf13da6a4609b79 | skimage/measure/profile.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -3,7 +3,7 @@ import scipy.ndimage as nd
def profile_line(img, src, dst, linewidth=1,
- order=0, mode='constant', cval=0.0):
+ order=1, mode='constant', cval=0.0):
| def profile_line ( img , src , dst , linewidth = 1 , order = 0 , mode = 'constant' , cval = 0.0 ) : | def profile_line ( img , src , dst , linewidth = 1 , order = 1 , mode = 'constant' , cval = 0.0 ) : | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:0", 3, 24, 3, 25], "1"]] | matsuken92/scikit-image@040a21afb90d5e5c3e6ad43748142395259a680f | Change default interpolation order to 1 | [
{
"sha": "e49c710ce6b9164f2aded0b2a7cd46f638d5bc27",
"filename": "skimage/measure/profile.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/040a21afb90d5e5c3e6ad43748142395259a680f/skimage%2Fmeasure%2Fprofile.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/040a21afb90d5e5c3e6ad43748142395259a680f/skimage%2Fmeasure%2Fprofile.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2Fprofile.py?ref=040a21afb90d5e5c3e6ad43748142395259a680f",
"patch": "@@ -3,7 +3,7 @@\n \n \n def profile_line(img, src, dst, linewidth=1,\n- order=0, mode='constant', cval=0.0):\n+ order=1, mode='constant', cval=0.0):\n \"\"\"Return the intensity profile of an image measured along a scan line.\n \n Parameters"
}
] |
scikit-image | 292f9dce9b7a5c41bb4f02e9f5d8897a1c915dcf | 50a27088b1794f8cc0a332102fd61cf7272f2ea5 | skimage/measure/_regionprops.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -399,7 +399,7 @@ def regionprops(label_image, properties=None,
**major_axis_length** : float
The length of the major axis of the ellipse that has the same
normalized second central moments as the region.
- **min_intensity** : float
+ **max_intensity** : float
Value with the greatest intensity in the region.
**mean_intensity** : float
Value with the mean intensity in the region.
| region . ** min_intensity ** : float | region . ** max_intensity ** : float | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:min_intensity", 3, 7, 3, 20], "max_intensity"]] | matsuken92/scikit-image@292f9dce9b7a5c41bb4f02e9f5d8897a1c915dcf | Fix regionprops doc typo | [
{
"sha": "5817580d9c316e5498bc8fba60b9d82a6f05bd0a",
"filename": "skimage/measure/_regionprops.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/292f9dce9b7a5c41bb4f02e9f5d8897a1c915dcf/skimage%2Fmeasure%2F_regionprops.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/292f9dce9b7a5c41bb4f02e9f5d8897a1c915dcf/skimage%2Fmeasure%2F_regionprops.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2F_regionprops.py?ref=292f9dce9b7a5c41bb4f02e9f5d8897a1c915dcf",
"patch": "@@ -399,7 +399,7 @@ def regionprops(label_image, properties=None,\n **major_axis_length** : float\n The length of the major axis of the ellipse that has the same\n normalized second central moments as the region.\n- **min_intensity** : float\n+ **max_intensity** : float\n Value with the greatest intensity in the region.\n **mean_intensity** : float\n Value with the mean intensity in the region."
}
] |
scikit-image | 48ca44bf166a446343a6999557c967287562ac29 | e9ac84b77ca80813cd22cc2017c59e13015b3223 | skimage/measure/_marching_cubes.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -244,7 +244,7 @@ def correct_mesh_orientation(volume, verts, faces, spacing=(1., 1., 1.),
# Calculate and normalize cross products for each face
crosses = np.cross(a, b)
- crosses = crosses / np.linalg.norm(crosses, axis=1)[:, np.newaxis]
+ crosses = crosses / np.sum(crosses ** 2, axis=1) ** (0.5)[:, np.newaxis]
# Take dot product
dotproducts = (grad_centroids * crosses).sum(axis=1)
| crosses = crosses / np . linalg . norm ( crosses , axis = 1 ) [ : , np . newaxis ] | crosses = crosses / np . sum ( crosses ** 2 , axis = 1 ) ** ( 0.5 ) [ : , np . newaxis ] | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 15, 3, 71], ["binary_operator", "N0"], 2], ["Move", "N0", ["call", 3, 25, 3, 56], 0], ["Insert", "N0", ["**:**", "T"], 1], ["Insert", "N0", ["subscript", "N1"], 2], ["Move", ["call", 3, 25, 3, 56], ["attribute", 3, 25, 3, 34], 0], ["Insert", "N1", ["parenthesized_expression", "N2"], 0], ["Move", "N1", ["[:[", 3, 56, 3, 57], 1], ["Move", "N1", ["slice", 3, 57, 3, 58], 2], ["Move", "N1", [",:,", 3, 58, 3, 59], 3], ["Move", "N1", ["attribute", 3, 60, 3, 70], 4], ["Move", "N1", ["]:]", 3, 70, 3, 71], 5], ["Update", ["identifier:linalg", 3, 28, 3, 34], "sum"], ["Insert", ["argument_list", 3, 39, 3, 56], ["binary_operator", "N3"], 1], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["float:0.5", "T"], 1], ["Insert", "N2", ["):)", "T"], 2], ["Move", "N3", ["identifier:crosses", 3, 40, 3, 47], 0], ["Insert", "N3", ["**:**", "T"], 1], ["Insert", "N3", ["integer:2", "T"], 2], ["Delete", [".:.", 3, 34, 3, 35]], ["Delete", ["identifier:norm", 3, 35, 3, 39]], ["Delete", ["attribute", 3, 25, 3, 39]], ["Delete", ["subscript", 3, 25, 3, 71]]] | matsuken92/scikit-image@48ca44bf166a446343a6999557c967287562ac29 | FIX: Slight speed decrease for backwards compatibility | [
{
"sha": "b5750f41b6b86ebc48b6a468c002837c1d2b3181",
"filename": "skimage/measure/_marching_cubes.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/48ca44bf166a446343a6999557c967287562ac29/skimage%2Fmeasure%2F_marching_cubes.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/48ca44bf166a446343a6999557c967287562ac29/skimage%2Fmeasure%2F_marching_cubes.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2F_marching_cubes.py?ref=48ca44bf166a446343a6999557c967287562ac29",
"patch": "@@ -244,7 +244,7 @@ def correct_mesh_orientation(volume, verts, faces, spacing=(1., 1., 1.),\n \n # Calculate and normalize cross products for each face\n crosses = np.cross(a, b)\n- crosses = crosses / np.linalg.norm(crosses, axis=1)[:, np.newaxis]\n+ crosses = crosses / np.sum(crosses ** 2, axis=1) ** (0.5)[:, np.newaxis]\n \n # Take dot product\n dotproducts = (grad_centroids * crosses).sum(axis=1)"
}
] |
grow_control_backend | a1510624e597c3e02d29044eff7d81376b4d21ed | 70dc89bd5a1e0f12797a56dd718b51ad4db0461e | api/views/chart_child_data.py | https://github.com/jcasmer/grow_control_backend | true | false | true | @@ -40,7 +40,7 @@ def ChartChildDataView(request):
# return Response({'error': 'No se encontró controles realizados para el menor'}, status=400)
if not childs_detail:
- return Response({'error': 'No se encontró controles realizados para el menor'}, status=400)
+ return Response({'error': 'No se han realizado controles para el menor'}, status=400)
try:
| return Response ( { 'error' : 'No se encontró controles realizados para el menor'} , tatus= 4 00) | return Response ( { 'error' : 'No se han realizado controles para el menor' } , status = 400 ) | SINGLE_STMT | [["Update", [",: ", 3, 88, 3, 89], ","], ["Update", [")", 3, 100, 3, 101], ")"], ["Update", ["}:,", 3, 87, 3, 88], "}"], ["Update", ["identifier:tatus=", 3, 90, 3, 96], "status"], ["Update", ["=:4", 3, 96, 3, 97], "="], ["Update", ["integer:00)", 3, 97, 3, 100], "400"], ["Update", ["string:'No se encontr\u00f3 controles realizados para el menor'}", 3, 35, 3, 87], "'No se han realizado controles para el menor'"]] | jcasmer/grow_control_backend@a1510624e597c3e02d29044eff7d81376b4d21ed | changed message error | [
{
"sha": "e8a0818e884e4c5d001c0daa039944848f433b53",
"filename": "api/views/chart_child_data.py",
"status": "modified",
"additions": 2,
"deletions": 1,
"changes": 3,
"blob_url": "https://github.com/jcasmer/grow_control_backend/blob/a1510624e597c3e02d29044eff7d81376b4d21ed/api%2Fviews%2Fchart_child_data.py",
"raw_url": "https://github.com/jcasmer/grow_control_backend/raw/a1510624e597c3e02d29044eff7d81376b4d21ed/api%2Fviews%2Fchart_child_data.py",
"contents_url": "https://api.github.com/repos/jcasmer/grow_control_backend/contents/api%2Fviews%2Fchart_child_data.py?ref=a1510624e597c3e02d29044eff7d81376b4d21ed",
"patch": "@@ -40,7 +40,7 @@ def ChartChildDataView(request):\n # return Response({'error': 'No se encontró controles realizados para el menor'}, status=400)\r\n \r\n if not childs_detail:\r\n- return Response({'error': 'No se encontró controles realizados para el menor'}, status=400)\r\n+ return Response({'error': 'No se han realizado controles para el menor'}, status=400)\r\n \r\n try:\r\n child = Childs.objects.get(id=request.GET.get('idChild'))\r\n@@ -61,6 +61,7 @@ def ChartChildDataView(request):\n # type 1 == weight \r\n if request.GET.get('chartType') == '1':\r\n data.append(detail.weight)\r\n+ # type 2 == height \r\n elif request.GET.get('chartType') == '2':\r\n data.append(detail.height)\r\n \r"
}
] |
rpi-api | ac77c1110e9b82cf1a65c95ac28b514b54fc0ff5 | 169b14ec8439280033db67a25f0fda27c4d59b86 | api.py | https://github.com/BTx123/rpi-api | true | false | false | @@ -7,7 +7,7 @@ import logging
ROUTE_API = "/api"
ROUTE_LEDS = "/leds"
LOGGER = logging.getLogger("api")
-DEBUG = True
+DEBUG = False
# LED numbers should refer to GPIO number not RPi pin number
VALID_LEDS = [17, 27, 22]
| DEBUG = True | DEBUG = False | CHANGE_BOOLEAN_LITERAL | [["Insert", ["assignment", 3, 1, 3, 13], ["false:False", "T"], 2], ["Delete", ["true:True", 3, 9, 3, 13]]] | BTx123/rpi-api@ac77c1110e9b82cf1a65c95ac28b514b54fc0ff5 | null | null |
homework | 54ab154f9f3e350974e04da6a6336514fe6fb995 | 48173bdc746b5e00eb5c7564bc3345fcf230b63c | 01/wuhang/learn1.py | https://github.com/python-13/homework | true | false | true | @@ -47,7 +47,7 @@ def update_operate(update_name):
def del_operate(del_name):
if del_name in user_info:
del user_info[del_name]
- print("Del %s succeed\n")
+ print("Del %s succeed\n" % del_name)
else:
print("Name not exist\n")
| print ( "Del %s succeed\n" ) | print ( "Del %s succeed\n" % del_name ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 14, 3, 34], ["binary_operator", "N0"], 1], ["Move", "N0", ["string:\"Del %s succeed\\n\"", 3, 15, 3, 33], 0], ["Insert", "N0", ["%:%", "T"], 1], ["Insert", "N0", ["identifier:del_name", "T"], 2]] | python-13/homework@54ab154f9f3e350974e04da6a6336514fe6fb995 | Update learn1.py
chaneg del_operate() print error | [
{
"sha": "6147656dec09b41c22ad77808f770d2778ef2869",
"filename": "01/wuhang/learn1.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/python-13/homework/blob/54ab154f9f3e350974e04da6a6336514fe6fb995/01%2Fwuhang%2Flearn1.py",
"raw_url": "https://github.com/python-13/homework/raw/54ab154f9f3e350974e04da6a6336514fe6fb995/01%2Fwuhang%2Flearn1.py",
"contents_url": "https://api.github.com/repos/python-13/homework/contents/01%2Fwuhang%2Flearn1.py?ref=54ab154f9f3e350974e04da6a6336514fe6fb995",
"patch": "@@ -47,7 +47,7 @@ def update_operate(update_name):\n def del_operate(del_name):\n if del_name in user_info:\n del user_info[del_name]\n- print(\"Del %s succeed\\n\")\n+ print(\"Del %s succeed\\n\" % del_name)\n else:\n print(\"Name not exist\\n\")\n "
}
] |
Eva | a6193e1f37e214ffcf8212ba97ed2b476b02b899 | 1e8b9ab681fa8f9c56a875574cd65ce5e7a9eb5e | red.py | https://github.com/PogChamp7/Eva | true | false | true | @@ -1119,7 +1119,7 @@ def isMemberAdmin(message):
return False
def canDeleteMessages(message):
- return message.channel.permissions_for(message.server.me).can_manage_messages
+ return message.channel.permissions_for(message.server.me).manage_messages
################################################
| return message . channel . permissions_for ( message . server . me ) . can_manage_messages | return message . channel . permissions_for ( message . server . me ) . manage_messages | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:can_manage_messages", 3, 60, 3, 79], "manage_messages"]] | PogChamp7/Eva@a6193e1f37e214ffcf8212ba97ed2b476b02b899 | Hotfix for recent discord.py change | [
{
"sha": "9f47f32a9c025f2b4022bebf95cd4f205cc61a6c",
"filename": "red.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/PogChamp7/Eva/blob/a6193e1f37e214ffcf8212ba97ed2b476b02b899/red.py",
"raw_url": "https://github.com/PogChamp7/Eva/raw/a6193e1f37e214ffcf8212ba97ed2b476b02b899/red.py",
"contents_url": "https://api.github.com/repos/PogChamp7/Eva/contents/red.py?ref=a6193e1f37e214ffcf8212ba97ed2b476b02b899",
"patch": "@@ -1119,7 +1119,7 @@ def isMemberAdmin(message):\n \t\treturn False\n \n def canDeleteMessages(message):\n-\treturn message.channel.permissions_for(message.server.me).can_manage_messages\n+\treturn message.channel.permissions_for(message.server.me).manage_messages\n \n ################################################\n "
}
] |
Eva | e1c4edba9f95821c38b257e61856f1a8531f5376 | 7a82c9ec68e5884d3a74be05d182c8dffa6c3be0 | red.py | https://github.com/PogChamp7/Eva | true | false | true | @@ -1131,7 +1131,7 @@ async def setVolume(message):
msg = msg.split(" ")
try:
vol = float(msg[1])
- if vol >= 0 or vol <= 1:
+ if vol >= 0 and vol <= 1:
settings["VOLUME"] = vol
await(client.send_message(message.channel, "`Volume set. Next track will have the desired volume.`"))
| if vol >= 0 or vol <= 1 : settings [ "VOLUME" ] = vol await ( client . send_message ( message . channel , "`Volume set. Next track will have the desired volume.`" ) ) | if vol >= 0 and vol <= 1 : settings [ "VOLUME" ] = vol await ( client . send_message ( message . channel , "`Volume set. Next track will have the desired volume.`" ) ) | CHANGE_BINARY_OPERATOR | [["Insert", ["boolean_operator", 3, 7, 3, 27], ["and:and", "T"], 1], ["Delete", ["or:or", 3, 16, 3, 18]]] | PogChamp7/Eva@e1c4edba9f95821c38b257e61856f1a8531f5376 | Fix typo which allowed arbitrary volumes | [
{
"sha": "767c85ab671edd42c7f86ffa9a3c05ea91813949",
"filename": "red.py",
"status": "modified",
"additions": 2,
"deletions": 2,
"changes": 4,
"blob_url": "https://github.com/PogChamp7/Eva/blob/e1c4edba9f95821c38b257e61856f1a8531f5376/red.py",
"raw_url": "https://github.com/PogChamp7/Eva/raw/e1c4edba9f95821c38b257e61856f1a8531f5376/red.py",
"contents_url": "https://api.github.com/repos/PogChamp7/Eva/contents/red.py?ref=e1c4edba9f95821c38b257e61856f1a8531f5376",
"patch": "@@ -1131,7 +1131,7 @@ async def setVolume(message):\n \t\tmsg = msg.split(\" \")\n \t\ttry:\n \t\t\tvol = float(msg[1])\n-\t\t\tif vol >= 0 or vol <= 1:\n+\t\t\tif vol >= 0 and vol <= 1:\n \t\t\t\tsettings[\"VOLUME\"] = vol\n \t\t\t\tawait(client.send_message(message.channel, \"`Volume set. Next track will have the desired volume.`\"))\n \t\t\t\tdataIO.fileIO(\"settings.json\", \"save\", settings)\n@@ -1519,4 +1519,4 @@ def main():\n \texcept:\n \t\tloop.run_until_complete(client.logout())\n \tfinally:\n-\t\tloop.close()\n\\ No newline at end of file\n+\t\tloop.close()"
}
] |
Eva | aaae7fbfe00f2d15648cfab3e09b87add5ed1038 | 2a073bbd50991b386bcedfa7806e0384451ae125 | red.py | https://github.com/PogChamp7/Eva | true | false | true | @@ -402,7 +402,7 @@ class Trivia():
def loadList(self, qlist):
- with open(qlist, "r") as f:
+ with open(qlist, "r", encoding="utf-8") as f:
qlist = f.readlines()
parsedList = []
for line in qlist:
| with open ( qlist , "r" ) as f : qlist = f . readlines ( ) | with open ( qlist , "r" , encoding = "utf-8" ) as f : qlist = f . readlines ( ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 12, 3, 24], [",:,", "T"], 4], ["Insert", ["argument_list", 3, 12, 3, 24], ["keyword_argument", "N0"], 5], ["Insert", "N0", ["identifier:encoding", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["string:\"utf-8\"", "T"], 2]] | PogChamp7/Eva@aaae7fbfe00f2d15648cfab3e09b87add5ed1038 | Fix for random encoding issue. Maybe. | [
{
"sha": "39457f4bf781ce4f1b04c01c3f4e6b1f1980e636",
"filename": "red.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/PogChamp7/Eva/blob/aaae7fbfe00f2d15648cfab3e09b87add5ed1038/red.py",
"raw_url": "https://github.com/PogChamp7/Eva/raw/aaae7fbfe00f2d15648cfab3e09b87add5ed1038/red.py",
"contents_url": "https://api.github.com/repos/PogChamp7/Eva/contents/red.py?ref=aaae7fbfe00f2d15648cfab3e09b87add5ed1038",
"patch": "@@ -402,7 +402,7 @@ async def endGame(self):\n \n \n \tdef loadList(self, qlist):\n-\t\twith open(qlist, \"r\") as f:\n+\t\twith open(qlist, \"r\", encoding=\"utf-8\") as f:\n \t\t\tqlist = f.readlines()\n \t\tparsedList = []\n \t\tfor line in qlist:"
}
] |
Eva | d06345dbe2cfdb1de85312d4872e2a90c925c528 | 1763c76d69db30240a09159eade8612a8c68e5a1 | red.py | https://github.com/PogChamp7/Eva | true | false | true | @@ -984,7 +984,7 @@ async def imdb(message): # Method added by BananaWaffles.
try:
msg.remove(msg[0])
msg = "+".join(msg)
- search = "http://api.myapifilms.com/imdb/title?format=json&title=" + msg + "&token=" + "yourtokenhere"
+ search = "http://api.myapifilms.com/imdb/title?format=json&title=" + msg + "&token=" + apis["MYAPIFILMS_TOKEN"]
async with aiohttp.get(search) as r:
result = await r.json()
title = result['data']['movies'][0]['title']
| search = "http://api.myapifilms.com/imdb/title?format=json&title=" + msg + "&token=" + "yourtokenhere" | search = "http://api.myapifilms.com/imdb/title?format=json&title=" + msg + "&token=" + apis [ "MYAPIFILMS_TOKEN" ] | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 16, 3, 109], ["subscript", "N0"], 2], ["Insert", "N0", ["identifier:apis", "T"], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["string:\"MYAPIFILMS_TOKEN\"", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Delete", ["string:\"yourtokenhere\"", 3, 94, 3, 109]]] | PogChamp7/Eva@d06345dbe2cfdb1de85312d4872e2a90c925c528 | fix !imdb | [
{
"sha": "70c6dfc06c971a94c9936520100383af4c852924",
"filename": "red.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/PogChamp7/Eva/blob/d06345dbe2cfdb1de85312d4872e2a90c925c528/red.py",
"raw_url": "https://github.com/PogChamp7/Eva/raw/d06345dbe2cfdb1de85312d4872e2a90c925c528/red.py",
"contents_url": "https://api.github.com/repos/PogChamp7/Eva/contents/red.py?ref=d06345dbe2cfdb1de85312d4872e2a90c925c528",
"patch": "@@ -984,7 +984,7 @@ async def imdb(message): # Method added by BananaWaffles.\n \t\t\t\t\ttry:\n \t\t\t\t\t\tmsg.remove(msg[0])\n \t\t\t\t\t\tmsg = \"+\".join(msg)\n-\t\t\t\t\t\tsearch = \"http://api.myapifilms.com/imdb/title?format=json&title=\" + msg + \"&token=\" + \"yourtokenhere\"\n+\t\t\t\t\t\tsearch = \"http://api.myapifilms.com/imdb/title?format=json&title=\" + msg + \"&token=\" + apis[\"MYAPIFILMS_TOKEN\"]\n \t\t\t\t\t\tasync with aiohttp.get(search) as r:\n \t\t\t\t\t\t\tresult = await r.json()\n \t\t\t\t\t\t\ttitle = result['data']['movies'][0]['title']"
}
] |
visbrain | fdb9a58528d6da552d3988bbe0fdfdc019717701 | 1ac3bb0bca94a8817078f87261f8882783de4b73 | visbrain/sleep/visuals/visuals.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -568,7 +568,7 @@ class Hypnogram(object):
# Hypno conversion :
- if (self._hconv is not None) and convert:
+ if (self._hconv != self._hconvinv) and convert:
data = self.hyp2GUI(data)
# Build color array :
color = np.zeros((len(data), 4), dtype=np.float32)
| if ( self . _hconv is not None ) and convert : data = self . hyp2GUI ( data ) | if ( self . _hconv != self . _hconvinv ) and convert : data = self . hyp2GUI ( data ) | SINGLE_STMT | [["Insert", ["comparison_operator", 1, 13, 1, 36], ["!=:!=", "T"], 1], ["Insert", ["comparison_operator", 1, 13, 1, 36], ["attribute", "N0"], 2], ["Insert", "N0", ["identifier:self", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:_hconvinv", "T"], 2], ["Delete", ["is:is", 1, 25, 1, 27]], ["Delete", ["not:not", 1, 28, 1, 31]], ["Delete", ["none:None", 1, 32, 1, 36]]] | kdeleeuw11/visbrain@fdb9a58528d6da552d3988bbe0fdfdc019717701 | Fix comparison | [
{
"sha": "23bfd858c36642d8e200124a38c0cb7ab3ac6a11",
"filename": "visbrain/sleep/visuals/visuals.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/fdb9a58528d6da552d3988bbe0fdfdc019717701/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/fdb9a58528d6da552d3988bbe0fdfdc019717701/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fvisuals%2Fvisuals.py?ref=fdb9a58528d6da552d3988bbe0fdfdc019717701",
"patch": "@@ -568,7 +568,7 @@ def set_data(self, sf, data, time, convert=True):\n Specify if hypnogram data have to be converted.\n \"\"\"\n # Hypno conversion :\n- if (self._hconv is not None) and convert:\n+ if (self._hconv != self._hconvinv) and convert:\n data = self.hyp2GUI(data)\n # Build color array :\n color = np.zeros((len(data), 4), dtype=np.float32)"
}
] |
visbrain | 5ef73d1e40173ecca9ffba1eef4cf185b7f30fa3 | 15ee35fb2429d58a482c4b07f91c412c88246b75 | visbrain/sleep/sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -75,7 +75,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):
def __init__(self, file=None, hypno_file=None, config_file=None,
data=None, channels=None, sf=None, hypno=None,
downsample=100., axis=False, line='gl', hypedit=False,
- href=['art', 'wake', 'n1', 'n2', 'n3', 'rem']):
+ href=['art', 'wake', 'rem', 'n1', 'n2', 'n3']):
"""Init."""
# ====================== APP CREATION ======================
# Create the app and initialize all graphical elements :
| def __init__ ( self , file = None , hypno_file = None , config_file = None , data = None , channels = None , sf = None , hypno = None , downsample = 100. , axis = False , line = 'gl' , hypedit = False , href = [ 'art' , 'wake' , 'n1' , 'n2' , 'n3' , 'rem' ] ) : """Init.""" | def __init__ ( self , file = None , hypno_file = None , config_file = None , data = None , channels = None , sf = None , hypno = None , downsample = 100. , axis = False , line = 'gl' , hypedit = False , href = [ 'art' , 'wake' , 'rem' , 'n1' , 'n2' , 'n3' ] ) : """Init.""" | SINGLE_STMT | [["Move", ["string:'n1'", 3, 39, 3, 43], ["list", 3, 23, 3, 63], 6], ["Move", ["string:'n2'", 3, 45, 3, 49], ["list", 3, 23, 3, 63], 9], ["Move", ["string:'n3'", 3, 51, 3, 55], ["list", 3, 23, 3, 63], 11], ["Move", ["string:'rem'", 3, 57, 3, 62], ["list", 3, 23, 3, 63], 5]] | kdeleeuw11/visbrain@5ef73d1e40173ecca9ffba1eef4cf185b7f30fa3 | Change the default stage order | [
{
"sha": "08ef706950206295e718cedf10886320fc046ea1",
"filename": "visbrain/sleep/sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/5ef73d1e40173ecca9ffba1eef4cf185b7f30fa3/visbrain%2Fsleep%2Fsleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/5ef73d1e40173ecca9ffba1eef4cf185b7f30fa3/visbrain%2Fsleep%2Fsleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fsleep.py?ref=5ef73d1e40173ecca9ffba1eef4cf185b7f30fa3",
"patch": "@@ -75,7 +75,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):\n def __init__(self, file=None, hypno_file=None, config_file=None,\n data=None, channels=None, sf=None, hypno=None,\n downsample=100., axis=False, line='gl', hypedit=False,\n- href=['art', 'wake', 'n1', 'n2', 'n3', 'rem']):\n+ href=['art', 'wake', 'rem', 'n1', 'n2', 'n3']):\n \"\"\"Init.\"\"\"\n # ====================== APP CREATION ======================\n # Create the app and initialize all graphical elements :"
}
] |
visbrain | 64d61afbb9156ae2196cd9986c5dd571e9471ea7 | 32a36b1dd94e2c995cfe6aecd3f5e1fb5ce43cf5 | visbrain/sleep/interface/uiElements/uiTools.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -30,7 +30,7 @@ class uiTools(object):
# Get it :
self._reChecks.append(box)
# Add checkbox to the grid :
- self._ToolsRefIgnGrd.addWidget(self._reChecks[i], i, 0, 1, 1)
+ self._ToolsRefIgnGrd.addWidget(box, i, 0, 1, 1)
# Connections :
self._ToolsRefIgn.clicked.connect(self._fcn_refChanIgnore)
self._ToolsRefLst.addItems(np.array(self._channels)[~self._noneeg])
| self . _ToolsRefIgnGrd . addWidget ( self . _reChecks [ i ] , i , 0 , 1 , 1 ) | self . _ToolsRefIgnGrd . addWidget ( box , i , 0 , 1 , 1 ) | SINGLE_STMT | [["Move", [",:,", 3, 65, 3, 66], ["argument_list", 3, 47, 3, 78], 4], ["Update", ["identifier:self", 3, 48, 3, 52], "box"], ["Move", ["argument_list", 3, 47, 3, 78], ["identifier:self", 3, 48, 3, 52], 1], ["Insert", ["argument_list", 3, 47, 3, 78], [",:,", "T"], 2], ["Move", ["argument_list", 3, 47, 3, 78], ["identifier:i", 3, 63, 3, 64], 3], ["Insert", ["argument_list", 3, 47, 3, 78], ["integer:1", "T"], 10], ["Delete", [".:.", 3, 52, 3, 53]], ["Delete", ["identifier:_reChecks", 3, 53, 3, 62]], ["Delete", ["attribute", 3, 48, 3, 62]], ["Delete", ["[:[", 3, 62, 3, 63]], ["Delete", ["]:]", 3, 64, 3, 65]], ["Delete", ["subscript", 3, 48, 3, 65]], ["Delete", ["identifier:i", 3, 67, 3, 68]], ["Delete", [",:,", 3, 74, 3, 75]], ["Delete", ["integer:1", 3, 76, 3, 77]]] | kdeleeuw11/visbrain@64d61afbb9156ae2196cd9986c5dd571e9471ea7 | Fix box | [
{
"sha": "255b4e73c284c2d60590e4de1ebcdf2641c56abb",
"filename": "visbrain/sleep/interface/uiElements/uiTools.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/64d61afbb9156ae2196cd9986c5dd571e9471ea7/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiTools.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/64d61afbb9156ae2196cd9986c5dd571e9471ea7/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiTools.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiTools.py?ref=64d61afbb9156ae2196cd9986c5dd571e9471ea7",
"patch": "@@ -30,7 +30,7 @@ def __init__(self):\n # Get it :\n self._reChecks.append(box)\n # Add checkbox to the grid :\n- self._ToolsRefIgnGrd.addWidget(self._reChecks[i], i, 0, 1, 1)\n+ self._ToolsRefIgnGrd.addWidget(box, i, 0, 1, 1)\n # Connections :\n self._ToolsRefIgn.clicked.connect(self._fcn_refChanIgnore)\n self._ToolsRefLst.addItems(np.array(self._channels)[~self._noneeg])"
}
] |
visbrain | 70672b07b05a2163a90bb04b6a03517bf9a7903a | ed5a4bc2e4ae20cf337361344674670ece5eb454 | visbrain/sleep/sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -336,7 +336,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):
# =========================== SCALING =============================
# Check amplitude of the data and if necessary apply re-scaling
- if np.abs(np.ptp(data).mean()) < 0.001:
+ if np.abs(np.ptp(data, 0).mean()) < 0.001:
data *= 1e6
# ========================== CONVERSION ===========================
| if np . abs ( np . ptp ( data ) . mean ( ) ) < 0.001 : data *= 1e6 | if np . abs ( np . ptp ( data , 0 ) . mean ( ) ) < 0.001 : data *= 1e6 | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 25, 3, 31], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 25, 3, 31], ["integer:0", "T"], 3]] | kdeleeuw11/visbrain@70672b07b05a2163a90bb04b6a03517bf9a7903a | fixed check_amplitude | [
{
"sha": "692ea4e3a8cd8e16415d5b499a57c790477a2a11",
"filename": "visbrain/sleep/sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/70672b07b05a2163a90bb04b6a03517bf9a7903a/visbrain%2Fsleep%2Fsleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/70672b07b05a2163a90bb04b6a03517bf9a7903a/visbrain%2Fsleep%2Fsleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fsleep.py?ref=70672b07b05a2163a90bb04b6a03517bf9a7903a",
"patch": "@@ -336,7 +336,7 @@ def _check_data(self, sf, data, channels, hypno=None, downsample=None,\n \n # =========================== SCALING =============================\n # Check amplitude of the data and if necessary apply re-scaling\n- if np.abs(np.ptp(data).mean()) < 0.001:\n+ if np.abs(np.ptp(data, 0).mean()) < 0.001:\n data *= 1e6\n \n # ========================== CONVERSION ==========================="
}
] |
visbrain | 224816fc3a5a4997e6a8a1c636c29a5d73a163b8 | a99bf95d6ff88b88b84b2cddab058d1e592dc92e | visbrain/sleep/interface/uiElements/uiInfo.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -1,6 +1,6 @@
"""Main class for info managment."""
-from PyQt5 import QtGui, QtWidgets
+from PyQt5 import QtWidgets
import os
from ....utils import sleepstats, listToCsv, listToTxt
| from PyQt5 import QtGui , QtWidgets | from PyQt5 import QtWidgets | SINGLE_STMT | [["Delete", ["identifier:QtGui", 2, 19, 2, 24]], ["Delete", ["dotted_name", 2, 19, 2, 24]], ["Delete", [",:,", 2, 24, 2, 25]]] | kdeleeuw11/visbrain@224816fc3a5a4997e6a8a1c636c29a5d73a163b8 | Fix imports | [
{
"sha": "0979413d40ededea2658de284498005ab20d3645",
"filename": "visbrain/sleep/interface/uiElements/uiInfo.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/224816fc3a5a4997e6a8a1c636c29a5d73a163b8/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/224816fc3a5a4997e6a8a1c636c29a5d73a163b8/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiInfo.py?ref=224816fc3a5a4997e6a8a1c636c29a5d73a163b8",
"patch": "@@ -1,6 +1,6 @@\n \"\"\"Main class for info managment.\"\"\"\n \n-from PyQt5 import QtGui, QtWidgets\n+from PyQt5 import QtWidgets\n import os\n \n from ....utils import sleepstats, listToCsv, listToTxt"
}
] |
visbrain | 6be39888d8eacb9c9c1f7f949658fb68a8f90f93 | d2b3f39c401837f379f0fc790a37bb3b62bd3dfa | visbrain/sleep/interface/uiElements/uiPanels.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -433,7 +433,7 @@ class uiPanels(object):
# Get reversed colormap :
if self._PanSpecCmapInv.isChecked():
cmap += '_r'
- self._specLabel.setText(self._channels[chan])
+ self._specLabel.setText(self._addspace + self._channels[chan])
# Set data :
self._spec.set_data(self._sf, self._data[chan, ...], self._time,
nfft=nfft, overlap=over, fstart=fstart, fend=fend,
| self . _specLabel . setText ( self . _channels [ chan ] ) | self . _specLabel . setText ( self . _addspace + self . _channels [ chan ] ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 32, 3, 54], ["binary_operator", "N0"], 1], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["+:+", "T"], 1], ["Move", "N0", ["subscript", 3, 33, 3, 53], 2], ["Insert", "N1", ["identifier:self", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:_addspace", "T"], 2]] | kdeleeuw11/visbrain@6be39888d8eacb9c9c1f7f949658fb68a8f90f93 | Fix spectrogram label space when changing the channel | [
{
"sha": "b0ef9b46bdc42942cadced4d0bda930f56a14a14",
"filename": "visbrain/sleep/interface/uiElements/uiPanels.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/6be39888d8eacb9c9c1f7f949658fb68a8f90f93/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiPanels.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/6be39888d8eacb9c9c1f7f949658fb68a8f90f93/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiPanels.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiPanels.py?ref=6be39888d8eacb9c9c1f7f949658fb68a8f90f93",
"patch": "@@ -433,7 +433,7 @@ def _fcn_specSetData(self):\n # Get reversed colormap :\n if self._PanSpecCmapInv.isChecked():\n cmap += '_r'\n- self._specLabel.setText(self._channels[chan])\n+ self._specLabel.setText(self._addspace + self._channels[chan])\n # Set data :\n self._spec.set_data(self._sf, self._data[chan, ...], self._time,\n nfft=nfft, overlap=over, fstart=fstart, fend=fend,"
}
] |
visbrain | 74c9082fb628f3061255a2b3cd3b2e62f8aff4dd | 310d4dccc6b33f37b56f6883b447f46867d305f7 | visbrain/sleep/sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -350,7 +350,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):
# =========================== SCALING =============================
# Check amplitude of the data and if necessary apply re-scaling
- if np.abs(np.ptp(data, 0).mean()) < 0.001:
+ if np.abs(np.ptp(data, 0).mean()) < 0.1:
data *= 1e6
# ========================== CONVERSION ===========================
| if np . abs ( np . ptp ( data , 0 ) . mean ( ) ) < 0.001 : data *= 1e6 | if np . abs ( np . ptp ( data , 0 ) . mean ( ) ) < 0.1 : data *= 1e6 | CHANGE_NUMERIC_LITERAL | [["Update", ["float:0.001", 3, 45, 3, 50], "0.1"]] | kdeleeuw11/visbrain@74c9082fb628f3061255a2b3cd3b2e62f8aff4dd | fix amplitude data | [
{
"sha": "b328bcafee0e35621c6450d36e741c7030a77c50",
"filename": "visbrain/sleep/sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/74c9082fb628f3061255a2b3cd3b2e62f8aff4dd/visbrain%2Fsleep%2Fsleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/74c9082fb628f3061255a2b3cd3b2e62f8aff4dd/visbrain%2Fsleep%2Fsleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fsleep.py?ref=74c9082fb628f3061255a2b3cd3b2e62f8aff4dd",
"patch": "@@ -350,7 +350,7 @@ def _check_data(self, sf, data, channels, hypno=None, downsample=None,\n \n # =========================== SCALING =============================\n # Check amplitude of the data and if necessary apply re-scaling\n- if np.abs(np.ptp(data, 0).mean()) < 0.001:\n+ if np.abs(np.ptp(data, 0).mean()) < 0.1:\n data *= 1e6\n \n # ========================== CONVERSION ==========================="
}
] |
visbrain | c02adc5f8afd139ac0d60b91d9d6fec4be5d9aa7 | 22a61d845bb3eaf0a162513aceee4220ff420945 | visbrain/brain/interface/uiElements/uiAtlas.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -322,7 +322,7 @@ class uiAtlas(object):
# Set new center position :
bgd = (self.bgd_red.value(), self.bgd_green.value(),
self.bgd_blue.value())
- self.volume.set_cs_data(dx, dy, dz, bgcolor=bgd, alpha=0.2, cmap=cmap)
+ self.volume.set_cs_data(dx, dy, dz, bgcolor=bgd, alpha=0., cmap=cmap)
def _fcn_crossec_viz(self):
"""Control cross-sections visibility."""
| self . volume . set_cs_data ( dx , dy , dz , bgcolor = bgd , alpha = 0.2 , cmap = cmap ) | self . volume . set_cs_data ( dx , dy , dz , bgcolor = bgd , alpha = 0. , cmap = cmap ) | CHANGE_NUMERIC_LITERAL | [["Update", ["float:0.2", 3, 64, 3, 67], "0."]] | kdeleeuw11/visbrain@c02adc5f8afd139ac0d60b91d9d6fec4be5d9aa7 | Default crossec alpha => 0. | [
{
"sha": "2c470403d174af032eec711a9ed95559bca1831a",
"filename": "visbrain/brain/interface/uiElements/uiAtlas.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/c02adc5f8afd139ac0d60b91d9d6fec4be5d9aa7/visbrain%2Fbrain%2Finterface%2FuiElements%2FuiAtlas.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/c02adc5f8afd139ac0d60b91d9d6fec4be5d9aa7/visbrain%2Fbrain%2Finterface%2FuiElements%2FuiAtlas.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Finterface%2FuiElements%2FuiAtlas.py?ref=c02adc5f8afd139ac0d60b91d9d6fec4be5d9aa7",
"patch": "@@ -322,7 +322,7 @@ def _fcn_crossec_move(self):\n # Set new center position :\n bgd = (self.bgd_red.value(), self.bgd_green.value(),\n self.bgd_blue.value())\n- self.volume.set_cs_data(dx, dy, dz, bgcolor=bgd, alpha=0.2, cmap=cmap)\n+ self.volume.set_cs_data(dx, dy, dz, bgcolor=bgd, alpha=0., cmap=cmap)\n \n def _fcn_crossec_viz(self):\n \"\"\"Control cross-sections visibility.\"\"\""
}
] |
visbrain | 3a2a0bd81b7852ca98fc738ac019e34e04957f25 | d333db6bed840724dc57a27e4c12b50bb6a47b17 | visbrain/io/dependencies.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -15,7 +15,7 @@ def is_mne_installed():
def is_nibabel_installed():
"""Test if nibabel is installed."""
try:
- import mne
+ import nibabel
return True
except:
return False
| import mne | import nibabel | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:mne", 3, 16, 3, 19], "nibabel"]] | kdeleeuw11/visbrain@3a2a0bd81b7852ca98fc738ac019e34e04957f25 | Fixed is_nibabel_installed | [
{
"sha": "3aabccd51fb62eeb0cae839524397620a4b8496b",
"filename": "visbrain/io/dependencies.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/3a2a0bd81b7852ca98fc738ac019e34e04957f25/visbrain%2Fio%2Fdependencies.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/3a2a0bd81b7852ca98fc738ac019e34e04957f25/visbrain%2Fio%2Fdependencies.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fio%2Fdependencies.py?ref=3a2a0bd81b7852ca98fc738ac019e34e04957f25",
"patch": "@@ -15,7 +15,7 @@ def is_mne_installed():\n def is_nibabel_installed():\n \"\"\"Test if nibabel is installed.\"\"\"\n try:\n- import mne\n+ import nibabel\n return True\n except:\n return False"
}
] |
visbrain | 1ce16d13b9ef64910c0c72edda0dc17541bf2c7d | 98d1d18b943efec6b3fe80171cff782c4a3b4cd8 | visbrain/utils/cbar/CbarVisual.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -82,7 +82,7 @@ class CbarVisual(CbarBase):
# --------------------- Node ---------------------
# Define node parent and limit node :
self._cbNode = Node(name='Colorbar', parent=parent)
- self._limNode = Node(name='Colorbar', parent=self._cbNode)
+ self._limNode = Node(name='Limits', parent=self._cbNode)
# Rescale between (-1., 1.) :
self._rsc = vist.STTransform(scale=(self._width, 2 / self._n, 1),
translate=(0, -1., 0))
| self . _limNode = Node ( name = 'Colorbar' , parent = self . _cbNode ) | self . _limNode = Node ( name = 'Limits' , parent = self . _cbNode ) | CHANGE_STRING_LITERAL | [["Update", ["string:'Colorbar'", 3, 35, 3, 45], "'Limits'"]] | kdeleeuw11/visbrain@1ce16d13b9ef64910c0c72edda0dc17541bf2c7d | Fix name of the node limits of CbarVisual | [
{
"sha": "c24f9b53e53b4e97328c2cc0371401682affb2b3",
"filename": "visbrain/utils/cbar/CbarVisual.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/1ce16d13b9ef64910c0c72edda0dc17541bf2c7d/visbrain%2Futils%2Fcbar%2FCbarVisual.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/1ce16d13b9ef64910c0c72edda0dc17541bf2c7d/visbrain%2Futils%2Fcbar%2FCbarVisual.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fcbar%2FCbarVisual.py?ref=1ce16d13b9ef64910c0c72edda0dc17541bf2c7d",
"patch": "@@ -82,7 +82,7 @@ def __init__(self, parent=None, **kwargs):\n # --------------------- Node ---------------------\n # Define node parent and limit node :\n self._cbNode = Node(name='Colorbar', parent=parent)\n- self._limNode = Node(name='Colorbar', parent=self._cbNode)\n+ self._limNode = Node(name='Limits', parent=self._cbNode)\n # Rescale between (-1., 1.) :\n self._rsc = vist.STTransform(scale=(self._width, 2 / self._n, 1),\n translate=(0, -1., 0))"
}
] |
visbrain | 2a128662d3a4590039140809f62542b4bd7edd25 | 3ce2b84598000de83b3b260a68c64c98560f711b | visbrain/brain/interface/uiElements/uiSettings.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -94,7 +94,7 @@ class uiSettings(object):
def _fcn_openDoc(self):
"""Open documentation."""
import webbrowser
- webbrowser.open('http://etiennecmb.github.io/visbrain/brain.html')
+ webbrowser.open('http://visbrain.org/brain.html')
def _fcn_tab_changed(self):
"""Executed function when the user change the tab."""
| webbrowser . open ( 'http://etiennecmb.github.io/visbrain/brain.html' ) | webbrowser . open ( 'http://visbrain.org/brain.html' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'http://etiennecmb.github.io/visbrain/brain.html'", 3, 25, 3, 74], "'http://visbrain.org/brain.html'"]] | kdeleeuw11/visbrain@2a128662d3a4590039140809f62542b4bd7edd25 | fix help url | [
{
"sha": "c97ee53a5d675e1265a8668f41bc0f5424088e09",
"filename": "visbrain/brain/interface/uiElements/uiSettings.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/2a128662d3a4590039140809f62542b4bd7edd25/visbrain%2Fbrain%2Finterface%2FuiElements%2FuiSettings.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/2a128662d3a4590039140809f62542b4bd7edd25/visbrain%2Fbrain%2Finterface%2FuiElements%2FuiSettings.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Finterface%2FuiElements%2FuiSettings.py?ref=2a128662d3a4590039140809f62542b4bd7edd25",
"patch": "@@ -94,7 +94,7 @@ def _fcn_showShortPopup(self):\n def _fcn_openDoc(self):\n \"\"\"Open documentation.\"\"\"\n import webbrowser\n- webbrowser.open('http://etiennecmb.github.io/visbrain/brain.html')\n+ webbrowser.open('http://visbrain.org/brain.html')\n \n def _fcn_tab_changed(self):\n \"\"\"Executed function when the user change the tab.\"\"\""
}
] |
visbrain | 7a2787ada903709ac173b1550c40542f61972d80 | 9908f7b12076d4a5ed0a2f2db57ffe643fa2d847 | visbrain/sleep/interface/uiInit.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -89,7 +89,7 @@ class TimeAxis(object):
pos[:, 2] = -10
else:
pos = np.full((1, 3), -10, dtype=np.float32)
- self.markers.set_data(pos=pos, symbol='triangle_down',
+ self.markers.set_data(pos=pos, symbol='triangle_down', size=20.,
face_color='#42ab46', edge_width=0.)
def set_camera(self, camera):
| self . markers . set_data ( pos = pos , symbol = 'triangle_down' , face_color = '#42ab46' , edge_width = 0. ) | self . markers . set_data ( pos = pos , symbol = 'triangle_down' , size = 20. , face_color = '#42ab46' , edge_width = 0. ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 34, 4, 71], ["keyword_argument", "N0"], 5], ["Insert", ["argument_list", 3, 34, 4, 71], [",:,", "T"], 6], ["Insert", "N0", ["identifier:size", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["float:20.", "T"], 2]] | kdeleeuw11/visbrain@7a2787ada903709ac173b1550c40542f61972d80 | Increase default marker size of annotations | [
{
"sha": "8590a47c04c000f6c2377c9055b5b01e928d74a0",
"filename": "visbrain/sleep/interface/uiInit.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/7a2787ada903709ac173b1550c40542f61972d80/visbrain%2Fsleep%2Finterface%2FuiInit.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/7a2787ada903709ac173b1550c40542f61972d80/visbrain%2Fsleep%2Finterface%2FuiInit.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiInit.py?ref=7a2787ada903709ac173b1550c40542f61972d80",
"patch": "@@ -89,7 +89,7 @@ def set_data(self, tox=None, width=None, time=None, unit='seconds',\n pos[:, 2] = -10\n else:\n pos = np.full((1, 3), -10, dtype=np.float32)\n- self.markers.set_data(pos=pos, symbol='triangle_down',\n+ self.markers.set_data(pos=pos, symbol='triangle_down', size=20.,\n face_color='#42ab46', edge_width=0.)\n \n def set_camera(self, camera):"
}
] |
visbrain | a2cb2389997dd830c3f774312c0cde09d76dfa2e | 7f77a0a0804b5f973714e386cb7df93667a6997d | visbrain/sleep/interface/uiElements/uiMenu.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -283,7 +283,7 @@ class uiMenu(HelpMenu):
"All files (*.*)")
if filename:
# Load the hypnogram :
- self._hypno = read_hypno(filename, self._N).astype(np.float32)
+ self._hypno = read_hypno(filename, len(self._hypno))
self._hyp.set_data(self._sf, self._hypno, self._time)
# Update info table :
self._fcn_infoUpdate()
| self . _hypno = read_hypno ( filename , self . _N ) . astype ( np . float32 ) | self . _hypno = read_hypno ( filename , len ( self . _hypno ) ) | SINGLE_STMT | [["Move", ["call", 3, 27, 3, 75], ["identifier:read_hypno", 3, 27, 3, 37], 0], ["Insert", ["call", 3, 27, 3, 75], ["argument_list", "N0"], 1], ["Move", "N0", ["(:(", 3, 37, 3, 38], 0], ["Move", "N0", ["identifier:filename", 3, 38, 3, 46], 1], ["Move", "N0", [",:,", 3, 46, 3, 47], 2], ["Insert", "N0", ["call", "N1"], 3], ["Move", "N0", ["):)", 3, 74, 3, 75], 4], ["Insert", "N1", ["identifier:len", "T"], 0], ["Move", "N1", ["argument_list", 3, 63, 3, 75], 1], ["Move", ["argument_list", 3, 63, 3, 75], ["):)", 3, 55, 3, 56], 2], ["Move", ["attribute", 3, 64, 3, 74], ["identifier:self", 3, 48, 3, 52], 0], ["Move", ["attribute", 3, 64, 3, 74], [".:.", 3, 56, 3, 57], 1], ["Update", ["identifier:float32", 3, 67, 3, 74], "_hypno"], ["Delete", [".:.", 3, 52, 3, 53]], ["Delete", ["identifier:_N", 3, 53, 3, 55]], ["Delete", ["attribute", 3, 48, 3, 55]], ["Delete", ["argument_list", 3, 37, 3, 56]], ["Delete", ["call", 3, 27, 3, 56]], ["Delete", ["identifier:astype", 3, 57, 3, 63]], ["Delete", ["attribute", 3, 27, 3, 63]], ["Delete", ["identifier:np", 3, 64, 3, 66]], ["Delete", [".:.", 3, 66, 3, 67]]] | kdeleeuw11/visbrain@a2cb2389997dd830c3f774312c0cde09d76dfa2e | Fix reading hypnogram | [
{
"sha": "c6ab2c71c3a8467ddf357024223ae71178a78d64",
"filename": "visbrain/sleep/interface/uiElements/uiMenu.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/a2cb2389997dd830c3f774312c0cde09d76dfa2e/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiMenu.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/a2cb2389997dd830c3f774312c0cde09d76dfa2e/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiMenu.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiMenu.py?ref=a2cb2389997dd830c3f774312c0cde09d76dfa2e",
"patch": "@@ -283,7 +283,7 @@ def loadHypno(self):\n \"All files (*.*)\")\n if filename:\n # Load the hypnogram :\n- self._hypno = read_hypno(filename, self._N).astype(np.float32)\n+ self._hypno = read_hypno(filename, len(self._hypno))\n self._hyp.set_data(self._sf, self._hypno, self._time)\n # Update info table :\n self._fcn_infoUpdate()"
}
] |
visbrain | fb75f96174f01b022ae3471b0c376fc5ca657a65 | 6008f8b21ebdd5c447d7e959832824018d53ae5e | setup.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -66,7 +66,7 @@ setup(
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Visualization',
"Programming Language :: Python :: 3 :: Only",
- "Programming Language :: Python :: 3.5"
+ "Programming Language :: Python :: 3.5",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
| "Programming Language :: Python :: 3.5" | "Programming Language :: Python :: 3.5" , | SINGLE_STMT | [["Insert", ["expression_statement", 3, 18, 3, 57], [",:,", "T"], 1]] | kdeleeuw11/visbrain@fb75f96174f01b022ae3471b0c376fc5ca657a65 | Fix missing , | [
{
"sha": "e4128959f7b42cb65b2344a13df2ce0b96647dfa",
"filename": "setup.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/fb75f96174f01b022ae3471b0c376fc5ca657a65/setup.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/fb75f96174f01b022ae3471b0c376fc5ca657a65/setup.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/setup.py?ref=fb75f96174f01b022ae3471b0c376fc5ca657a65",
"patch": "@@ -66,7 +66,7 @@ def read(fname):\n 'Intended Audience :: Developers',\n 'Topic :: Scientific/Engineering :: Visualization',\n \"Programming Language :: Python :: 3 :: Only\",\n- \"Programming Language :: Python :: 3.5\"\n+ \"Programming Language :: Python :: 3.5\",\n \"Operating System :: MacOS\",\n \"Operating System :: POSIX :: Linux\",\n \"Operating System :: Microsoft :: Windows\","
}
] |
MySmallTrip | 0ca802b474c1018da5dace4593e09f1094867ab2 | 5772b5bb3f2d7cc116daf62c623861901ed0c728 | app/config/settings/production.py | https://github.com/kahee/MySmallTrip | true | false | false | @@ -3,7 +3,7 @@ from .base import *
secrets_base = json.loads(open(SECRETS_PRODUCTION, 'rt').read())
DATABASES = secrets_base['DATABASES']
-DEBUG = False
+DEBUG = True
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
| DEBUG = False | DEBUG = True | CHANGE_BOOLEAN_LITERAL | [["Insert", ["assignment", 3, 1, 3, 14], ["true:True", "T"], 2], ["Delete", ["false:False", 3, 9, 3, 14]]] | kahee/MySmallTrip@0ca802b474c1018da5dace4593e09f1094867ab2 | debug true로변경... | [
{
"sha": "ab3571c73256b621ad63691b4f96d2c2bc1f8c0e",
"filename": "app/config/settings/production.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kahee/MySmallTrip/blob/0ca802b474c1018da5dace4593e09f1094867ab2/app%2Fconfig%2Fsettings%2Fproduction.py",
"raw_url": "https://github.com/kahee/MySmallTrip/raw/0ca802b474c1018da5dace4593e09f1094867ab2/app%2Fconfig%2Fsettings%2Fproduction.py",
"contents_url": "https://api.github.com/repos/kahee/MySmallTrip/contents/app%2Fconfig%2Fsettings%2Fproduction.py?ref=0ca802b474c1018da5dace4593e09f1094867ab2",
"patch": "@@ -3,7 +3,7 @@\n secrets_base = json.loads(open(SECRETS_PRODUCTION, 'rt').read())\n \n DATABASES = secrets_base['DATABASES']\n-DEBUG = False\n+DEBUG = True\n ALLOWED_HOSTS = [\n 'localhost',\n '127.0.0.1',"
}
] |
visbrain | 3caf315e2c5560e475e9fdab3fe2952dc5b18d62 | f4a19ab37ed388dca04700e0d79e694c992e03ae | visbrain/brain/base/projection.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -64,8 +64,8 @@ class Projections(object):
# ============= MODULATIONS =============
r, c = self._proj_radius, self._proj_contribute
log_str = ("Project {} onto the %s (radius=%f contribute="
- "%r" % (self._proj_on, float(self._proj_radius),
- self._proj_contribute))
+ "%r)" % (self._proj_on, float(self._proj_radius),
+ self._proj_contribute))
if self._proj_type == 'activity':
logger.info(log_str.format("source's activity"))
mod = self.sources.project_modulation(v, r, c)
| log_str = ( "Project {} onto the %s (radius=%f contribute=" "%r" % ( self . _proj_on , float ( self . _proj_radius ) , self . _proj_contribute ) ) | log_str = ( "Project {} onto the %s (radius=%f contribute=" "%r)" % ( self . _proj_on , float ( self . _proj_radius ) , self . _proj_contribute ) ) | CHANGE_STRING_LITERAL | [["Update", ["string:\"%r\"", 3, 20, 3, 24], "\"%r)\""]] | kdeleeuw11/visbrain@3caf315e2c5560e475e9fdab3fe2952dc5b18d62 | Fix missing ) | [
{
"sha": "8318761c4d544d3dd7840620edfe979d3684e601",
"filename": "visbrain/brain/base/projection.py",
"status": "modified",
"additions": 2,
"deletions": 2,
"changes": 4,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/3caf315e2c5560e475e9fdab3fe2952dc5b18d62/visbrain%2Fbrain%2Fbase%2Fprojection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/3caf315e2c5560e475e9fdab3fe2952dc5b18d62/visbrain%2Fbrain%2Fbase%2Fprojection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Fbase%2Fprojection.py?ref=3caf315e2c5560e475e9fdab3fe2952dc5b18d62",
"patch": "@@ -64,8 +64,8 @@ def _run_source_projection(self):\n # ============= MODULATIONS =============\n r, c = self._proj_radius, self._proj_contribute\n log_str = (\"Project {} onto the %s (radius=%f contribute=\"\n- \"%r\" % (self._proj_on, float(self._proj_radius),\n- self._proj_contribute))\n+ \"%r)\" % (self._proj_on, float(self._proj_radius),\n+ self._proj_contribute))\n if self._proj_type == 'activity':\n logger.info(log_str.format(\"source's activity\"))\n mod = self.sources.project_modulation(v, r, c)"
}
] |
visbrain | 0f9e986c7d7b39ad7c1de5756808ee4e870cc28c | 3581233e1ed509b0958facae67c29e5812d2e3d8 | visbrain/objects/brain_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -444,7 +444,7 @@ class BrainObj(VisbrainObject):
roi_labs.append(labels[sub_idx][0])
mask[color_index] = 1.
else:
- logger.error("An error occured for index %i" % k)
+ logger.warning("No corresponding parcellates for index %i" % k)
logger.info("Selected parcellates : \n - %s" % "\n - ".join(roi_labs))
# Keep an eye on data color and mask :
self._data_color.append(color)
| else : logger . error ( "An error occured for index %i" % k ) | else : logger . warning ( "No corresponding parcellates for index %i" % k ) | SINGLE_STMT | [["Update", ["identifier:error", 3, 24, 3, 29], "warning"], ["Update", ["string:\"An error occured for index %i\"", 3, 30, 3, 61], "\"No corresponding parcellates for index %i\""]] | kdeleeuw11/visbrain@0f9e986c7d7b39ad7c1de5756808ee4e870cc28c | Replace error by warning for unfound parcellates | [
{
"sha": "006d70142121ae0483712e99310cda8bca4b75d8",
"filename": "visbrain/objects/brain_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/0f9e986c7d7b39ad7c1de5756808ee4e870cc28c/visbrain%2Fobjects%2Fbrain_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/0f9e986c7d7b39ad7c1de5756808ee4e870cc28c/visbrain%2Fobjects%2Fbrain_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fbrain_obj.py?ref=0f9e986c7d7b39ad7c1de5756808ee4e870cc28c",
"patch": "@@ -444,7 +444,7 @@ def parcellize(self, file, select=None, hemisphere=None, data=None,\n roi_labs.append(labels[sub_idx][0])\n mask[color_index] = 1.\n else:\n- logger.error(\"An error occured for index %i\" % k)\n+ logger.warning(\"No corresponding parcellates for index %i\" % k)\n logger.info(\"Selected parcellates : \\n - %s\" % \"\\n - \".join(roi_labs))\n # Keep an eye on data color and mask :\n self._data_color.append(color)"
}
] |
visbrain | ec0c2fba0f441b379d495927ff87ff6952abcc11 | 89dfbe37b7650c2fd2f50a9d46382c66aba13b83 | examples/brain/11_convert_mesh_data.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -38,7 +38,7 @@ vertices, faces, normals = convert_meshdata(vert, faces, invert_normals=True,
# Add the template :
add_brain_template('Custom', vertices, faces, normals)
-vb = Brain(a_template='Custom')
+vb = Brain(brain_template='Custom')
vb.show()
# If you want to remove the template :
| vb = Brain ( a_template = 'Custom' ) | vb = Brain ( brain_template = 'Custom' ) | CHANGE_KEYWORD_ARGUMENT_USED | [["Update", ["identifier:a_template", 3, 12, 3, 22], "brain_template"]] | kdeleeuw11/visbrain@ec0c2fba0f441b379d495927ff87ff6952abcc11 | Fix typo | [
{
"sha": "a6352a45d70b817c71b26ceba843c9b638bc6a4d",
"filename": "examples/brain/11_convert_mesh_data.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/ec0c2fba0f441b379d495927ff87ff6952abcc11/examples%2Fbrain%2F11_convert_mesh_data.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/ec0c2fba0f441b379d495927ff87ff6952abcc11/examples%2Fbrain%2F11_convert_mesh_data.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/examples%2Fbrain%2F11_convert_mesh_data.py?ref=ec0c2fba0f441b379d495927ff87ff6952abcc11",
"patch": "@@ -38,7 +38,7 @@\n # Add the template :\n add_brain_template('Custom', vertices, faces, normals)\n \n-vb = Brain(a_template='Custom')\n+vb = Brain(brain_template='Custom')\n vb.show()\n \n # If you want to remove the template :"
}
] |
visbrain | 1b60b034257bb679e080fcc365eef3e50040b055 | ef4c78cc983c37522945809ab8f7f0771642b7ed | visbrain/objects/brain_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -343,7 +343,7 @@ class BrainObj(VisbrainObject):
if is_under:
mask[sm_mat.row[sm_data >= hide_under]] = 1.
else:
- mask[:] = 0.
+ mask[:] = 1.
elif isinstance(file, str):
assert os.path.isfile(file)
logger.info("Add overlay to the {} brain template "
| mask [ : ] = 0. | mask [ : ] = 1. | CHANGE_NUMERIC_LITERAL | [["Update", ["float:0.", 3, 27, 3, 29], "1."]] | kdeleeuw11/visbrain@1b60b034257bb679e080fcc365eef3e50040b055 | Fix mask for activation | [
{
"sha": "9653c2290a532ad546f767afa0d185aa16b50115",
"filename": "visbrain/objects/brain_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/1b60b034257bb679e080fcc365eef3e50040b055/visbrain%2Fobjects%2Fbrain_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/1b60b034257bb679e080fcc365eef3e50040b055/visbrain%2Fobjects%2Fbrain_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fbrain_obj.py?ref=1b60b034257bb679e080fcc365eef3e50040b055",
"patch": "@@ -343,7 +343,7 @@ def add_activation(self, data=None, vertices=None, smoothing_steps=20,\n if is_under:\n mask[sm_mat.row[sm_data >= hide_under]] = 1.\n else:\n- mask[:] = 0.\n+ mask[:] = 1.\n elif isinstance(file, str):\n assert os.path.isfile(file)\n logger.info(\"Add overlay to the {} brain template \""
}
] |
visbrain | e3396d01dbccc6b805db407a9848598e1d4d42fb | febbb9a8ddfec58f4a8727e20df5da7f6a2612cd | visbrain/objects/brain_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -281,7 +281,7 @@ class BrainObj(VisbrainObject):
kw = self._update_cbar_args(cmap, clim, vmin, vmax, under, over)
- self._default_cblabel = "Source's %s" % project
+ self._default_cblabel = "Source %s" % project
_project_sources_data(s_obj, self, project, radius, contribute,
mask_color=mask_color, **kw)
| self . _default_cblabel = "Source's %s" % project | self . _default_cblabel = "Source %s" % project | CHANGE_BINARY_OPERAND | [["Update", ["string:\"Source's %s\"", 1, 33, 1, 46], "\"Source %s\""]] | kdeleeuw11/visbrain@e3396d01dbccc6b805db407a9848598e1d4d42fb | Fix automatique title | [
{
"sha": "d3a11b8cf0c69f2629134d5d52290e69733e49db",
"filename": "visbrain/objects/brain_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/e3396d01dbccc6b805db407a9848598e1d4d42fb/visbrain%2Fobjects%2Fbrain_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/e3396d01dbccc6b805db407a9848598e1d4d42fb/visbrain%2Fobjects%2Fbrain_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fbrain_obj.py?ref=e3396d01dbccc6b805db407a9848598e1d4d42fb",
"patch": "@@ -281,7 +281,7 @@ def project_sources(self, s_obj, project='modulation', radius=10.,\n the color of the masked sources is going to be used.\n \"\"\"\n kw = self._update_cbar_args(cmap, clim, vmin, vmax, under, over)\n- self._default_cblabel = \"Source's %s\" % project\n+ self._default_cblabel = \"Source %s\" % project\n _project_sources_data(s_obj, self, project, radius, contribute,\n mask_color=mask_color, **kw)\n "
}
] |
visbrain | 570aade6b249709749c72c362e1bfc895955a2bf | 568ac68bb4c37cda464c65c716b8dbccf45c170a | visbrain/utils/physio.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -402,7 +402,7 @@ def remove_predefined_roi(name):
raise ValueError("Can not remove a default ROI template.")
path_to_file = get_data_path(folder='roi', file=name + '.npz')
os.remove(path_to_file)
- logger.info("%s ROI object removed.")
+ logger.info("%s ROI object removed." % name)
def generate_eeg(sf=512., n_pts=1000, n_channels=1, n_trials=1, n_sines=100,
| logger . info ( "%s ROI object removed." ) | logger . info ( "%s ROI object removed." % name ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 16, 3, 42], ["binary_operator", "N0"], 1], ["Move", "N0", ["string:\"%s ROI object removed.\"", 3, 17, 3, 41], 0], ["Insert", "N0", ["%:%", "T"], 1], ["Insert", "N0", ["identifier:name", "T"], 2]] | kdeleeuw11/visbrain@570aade6b249709749c72c362e1bfc895955a2bf | Fix logging when remove | [
{
"sha": "8a6d112247087a5e3261208661f5b08b145a0c51",
"filename": "visbrain/utils/physio.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/570aade6b249709749c72c362e1bfc895955a2bf/visbrain%2Futils%2Fphysio.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/570aade6b249709749c72c362e1bfc895955a2bf/visbrain%2Futils%2Fphysio.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fphysio.py?ref=570aade6b249709749c72c362e1bfc895955a2bf",
"patch": "@@ -402,7 +402,7 @@ def remove_predefined_roi(name):\n raise ValueError(\"Can not remove a default ROI template.\")\n path_to_file = get_data_path(folder='roi', file=name + '.npz')\n os.remove(path_to_file)\n- logger.info(\"%s ROI object removed.\")\n+ logger.info(\"%s ROI object removed.\" % name)\n \n \n def generate_eeg(sf=512., n_pts=1000, n_channels=1, n_trials=1, n_sines=100,"
}
] |
visbrain | 7e9f621c65b1190d786a6ea65a7c7640dc54d7a6 | 4e9120972c8f585027c228d53856c310091ab58e | visbrain/objects/roi_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -228,7 +228,7 @@ class RoiObj(_Volume):
save_as_predefined_roi(self.name, self.vol, labels, index, self.hdr)
def remove(self):
- """Remove an ROI object."""
+ """Remove the ROI object."""
remove_predefined_roi(self.name)
def get_labels(self, save_to_path=None):
| """Remove an ROI object.""" | """Remove the ROI object.""" | CHANGE_STRING_LITERAL | [["Update", ["string:\"\"\"Remove an ROI object.\"\"\"", 3, 9, 3, 36], "\"\"\"Remove the ROI object.\"\"\""]] | kdeleeuw11/visbrain@7e9f621c65b1190d786a6ea65a7c7640dc54d7a6 | Fix doc | [
{
"sha": "1585b78839098fc7dd0edd586b6f00c2b87e26fc",
"filename": "visbrain/objects/roi_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/7e9f621c65b1190d786a6ea65a7c7640dc54d7a6/visbrain%2Fobjects%2Froi_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/7e9f621c65b1190d786a6ea65a7c7640dc54d7a6/visbrain%2Fobjects%2Froi_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Froi_obj.py?ref=7e9f621c65b1190d786a6ea65a7c7640dc54d7a6",
"patch": "@@ -228,7 +228,7 @@ def save(self):\n save_as_predefined_roi(self.name, self.vol, labels, index, self.hdr)\n \n def remove(self):\n- \"\"\"Remove an ROI object.\"\"\"\n+ \"\"\"Remove the ROI object.\"\"\"\n remove_predefined_roi(self.name)\n \n def get_labels(self, save_to_path=None):"
}
] |
visbrain | 4e1b72602aceac8466e4b2d4a276415c4e110f16 | 7e9f621c65b1190d786a6ea65a7c7640dc54d7a6 | visbrain/objects/brain_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -443,7 +443,7 @@ class BrainObj(VisbrainObject):
u_colors = np.zeros((len(u_idx), 4), dtype=float)
kw = self._update_cbar_args(cmap, clim, vmin, vmax, under, over)
data_color = array2colormap(data, **kw)
- self._default_cblabel = "Parcellate's data"
+ self._default_cblabel = "Parcellates data"
else:
logger.info("Use default color included in the file")
u_colors = u_colors.astype(float) / 255.
| self . _default_cblabel = "Parcellate's data" | self . _default_cblabel = "Parcellates data" | CHANGE_STRING_LITERAL | [["Update", ["string:\"Parcellate's data\"", 3, 37, 3, 56], "\"Parcellates data\""]] | kdeleeuw11/visbrain@4e1b72602aceac8466e4b2d4a276415c4e110f16 | Fix default parcelletaes labels | [
{
"sha": "437cc0a905918e3e7c68eb5136b5c961b4ff8c8b",
"filename": "visbrain/objects/brain_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/4e1b72602aceac8466e4b2d4a276415c4e110f16/visbrain%2Fobjects%2Fbrain_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/4e1b72602aceac8466e4b2d4a276415c4e110f16/visbrain%2Fobjects%2Fbrain_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fbrain_obj.py?ref=4e1b72602aceac8466e4b2d4a276415c4e110f16",
"patch": "@@ -443,7 +443,7 @@ def parcellize(self, file, select=None, hemisphere=None, data=None,\n u_colors = np.zeros((len(u_idx), 4), dtype=float)\n kw = self._update_cbar_args(cmap, clim, vmin, vmax, under, over)\n data_color = array2colormap(data, **kw)\n- self._default_cblabel = \"Parcellate's data\"\n+ self._default_cblabel = \"Parcellates data\"\n else:\n logger.info(\"Use default color included in the file\")\n u_colors = u_colors.astype(float) / 255."
}
] |
visbrain | 13451452ef72cc26e80b8433058944d9c94f0b59 | 71c0f8c68f55ab76580dbb0aa77f380fb53f3624 | visbrain/objects/source_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -381,7 +381,7 @@ class SourceObj(VisbrainObject):
if isinstance(keep_only, (list, tuple)):
idx_to_keep = []
for k, i in product(df.keys(), keep_only):
- idx_to_keep.append(df[k].astype(str).str.contains(i))
+ idx_to_keep.append(np.array(df[k], dtype=object) == i)
idx_to_keep = np.vstack(idx_to_keep).sum(0).astype(bool)
df = df.loc[idx_to_keep]
self.visible = idx_to_keep
| idx_to_keep . append ( df [ k ] . astype ( str ) . str . contains ( i ) ) | idx_to_keep . append ( np . array ( df [ k ] , dtype = object ) == i ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 35, 3, 70], ["comparison_operator", "N0"], 1], ["Move", "N0", ["call", 3, 36, 3, 53], 0], ["Insert", "N0", ["==:==", "T"], 1], ["Move", "N0", ["identifier:i", 3, 67, 3, 68], 2], ["Insert", ["call", 3, 36, 3, 53], ["attribute", "N1"], 0], ["Insert", ["call", 3, 36, 3, 53], ["argument_list", "N2"], 1], ["Insert", "N1", ["identifier:np", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:array", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Move", "N2", ["subscript", 3, 36, 3, 41], 1], ["Insert", "N2", [",:,", "T"], 2], ["Insert", "N2", ["keyword_argument", "N3"], 3], ["Move", "N2", ["):)", 3, 52, 3, 53], 4], ["Update", ["identifier:astype", 3, 42, 3, 48], "dtype"], ["Move", "N3", ["identifier:astype", 3, 42, 3, 48], 0], ["Insert", "N3", ["=:=", "T"], 1], ["Update", ["identifier:str", 3, 49, 3, 52], "object"], ["Move", "N3", ["identifier:str", 3, 49, 3, 52], 2], ["Delete", [".:.", 3, 41, 3, 42]], ["Delete", ["attribute", 3, 36, 3, 48]], ["Delete", ["(:(", 3, 48, 3, 49]], ["Delete", ["argument_list", 3, 48, 3, 53]], ["Delete", [".:.", 3, 53, 3, 54]], ["Delete", ["identifier:str", 3, 54, 3, 57]], ["Delete", ["attribute", 3, 36, 3, 57]], ["Delete", [".:.", 3, 57, 3, 58]], ["Delete", ["identifier:contains", 3, 58, 3, 66]], ["Delete", ["attribute", 3, 36, 3, 66]], ["Delete", ["(:(", 3, 66, 3, 67]], ["Delete", ["):)", 3, 68, 3, 69]], ["Delete", ["argument_list", 3, 66, 3, 69]], ["Delete", ["call", 3, 36, 3, 69]]] | kdeleeuw11/visbrain@13451452ef72cc26e80b8433058944d9c94f0b59 | Fix idx_to_keep (back to previous version) | [
{
"sha": "fbf8e6f0cfcaa1bf450f5f78ce4435430203ba4d",
"filename": "visbrain/objects/source_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/13451452ef72cc26e80b8433058944d9c94f0b59/visbrain%2Fobjects%2Fsource_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/13451452ef72cc26e80b8433058944d9c94f0b59/visbrain%2Fobjects%2Fsource_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fsource_obj.py?ref=13451452ef72cc26e80b8433058944d9c94f0b59",
"patch": "@@ -381,7 +381,7 @@ def analyse_sources(self, roi_obj='talairach', replace_bad=True,\n if isinstance(keep_only, (list, tuple)):\n idx_to_keep = []\n for k, i in product(df.keys(), keep_only):\n- idx_to_keep.append(df[k].astype(str).str.contains(i))\n+ idx_to_keep.append(np.array(df[k], dtype=object) == i)\n idx_to_keep = np.vstack(idx_to_keep).sum(0).astype(bool)\n df = df.loc[idx_to_keep]\n self.visible = idx_to_keep"
}
] |
visbrain | b5337c5943e3e85534f03e2580deb57f0f7571b0 | c976e87eb4fe9918f468b49da37ff494ad575058 | visbrain/tests/_tests_visbrain.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -15,7 +15,7 @@ class _TestVisbrain(object):
"""Path to a needed file from visbrain-data."""
return download_file(file)
- def to_tmp_dir(self, file):
+ def to_tmp_dir(self, file=None):
"""Path to a tmp dir in visbrain-data."""
vb_path = os.path.join(path_to_visbrain_data(), 'tmp')
if not os.path.exists(vb_path):
| def to_tmp_dir ( self , file ) : """Path to a tmp dir in visbrain-data.""" vb_path = os . path . join ( path_to_visbrain_data ( ) , 'tmp' ) if not os . path . exists ( vb_path ) : | def to_tmp_dir ( self , file = None ) : """Path to a tmp dir in visbrain-data.""" vb_path = os . path . join ( path_to_visbrain_data ( ) , 'tmp' ) if not os . path . exists ( vb_path ) : | SINGLE_STMT | [["Insert", ["parameters", 3, 19, 3, 31], ["default_parameter", "N0"], 3], ["Move", "N0", ["identifier:file", 3, 26, 3, 30], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["none:None", "T"], 2]] | kdeleeuw11/visbrain@b5337c5943e3e85534f03e2580deb57f0f7571b0 | Default value for file is None | [
{
"sha": "235f0a087b0fd0777de1598ed0416ba51ebbef0c",
"filename": "visbrain/tests/_tests_visbrain.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/b5337c5943e3e85534f03e2580deb57f0f7571b0/visbrain%2Ftests%2F_tests_visbrain.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/b5337c5943e3e85534f03e2580deb57f0f7571b0/visbrain%2Ftests%2F_tests_visbrain.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Ftests%2F_tests_visbrain.py?ref=b5337c5943e3e85534f03e2580deb57f0f7571b0",
"patch": "@@ -15,7 +15,7 @@ def need_file(self, file):\n \"\"\"Path to a needed file from visbrain-data.\"\"\"\n return download_file(file)\n \n- def to_tmp_dir(self, file):\n+ def to_tmp_dir(self, file=None):\n \"\"\"Path to a tmp dir in visbrain-data.\"\"\"\n vb_path = os.path.join(path_to_visbrain_data(), 'tmp')\n if not os.path.exists(vb_path):"
}
] |
visbrain | 36183ee3e0b7aa5d03a711bb50b76860c7c572d7 | 8f947b435922a449e79abba37135a68be4322085 | visbrain/tests/test_files.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -1,7 +1,7 @@
"""Test if needed files are successfully installed with visbrain."""
import os
-from visbrain.utils import get_data_path
+from visbrain.io import get_data_path
def _test_file(name, path):
| from visbrain . utils import get_data_path | from visbrain . io import get_data_path | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:utils", 3, 15, 3, 20], "io"]] | kdeleeuw11/visbrain@36183ee3e0b7aa5d03a711bb50b76860c7c572d7 | Fix imports | [
{
"sha": "0588db3da10ba82ded6fe902bf495742bcda0524",
"filename": "visbrain/tests/test_files.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/36183ee3e0b7aa5d03a711bb50b76860c7c572d7/visbrain%2Ftests%2Ftest_files.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/36183ee3e0b7aa5d03a711bb50b76860c7c572d7/visbrain%2Ftests%2Ftest_files.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Ftests%2Ftest_files.py?ref=36183ee3e0b7aa5d03a711bb50b76860c7c572d7",
"patch": "@@ -1,7 +1,7 @@\n \"\"\"Test if needed files are successfully installed with visbrain.\"\"\"\n import os\n \n-from visbrain.utils import get_data_path\n+from visbrain.io import get_data_path\n \n \n def _test_file(name, path):"
}
] |
visbrain | 9ef51b1d2f6dd1105f76fba9da5dd17672443bc2 | f5e0f016e93a3563210a3ff06e30fc2298cfc927 | visbrain/brain/user.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -175,7 +175,7 @@ class BrainUserMethods(object):
self._objsPage.setCurrentIndex(1)
self._csView.canvas.show(True)
canvas = self._csView.canvas
- widget = self._csGrid['grid']
+ widget = self._csView.wc
else:
raise ValueError("The canvas " + canvas + " doesn't exist. Use "
"either 'main', 'colorbar' or 'cross-sections'")
| widget = self . _csGrid [ 'grid' ] | widget = self . _csView . wc | SINGLE_STMT | [["Insert", ["assignment", 3, 13, 3, 42], ["attribute", "N0"], 2], ["Move", "N0", ["attribute", 3, 22, 3, 34], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:wc", "T"], 2], ["Update", ["identifier:_csGrid", 3, 27, 3, 34], "_csView"], ["Delete", ["[:[", 3, 34, 3, 35]], ["Delete", ["string:'grid'", 3, 35, 3, 41]], ["Delete", ["]:]", 3, 41, 3, 42]], ["Delete", ["subscript", 3, 22, 3, 42]]] | kdeleeuw11/visbrain@9ef51b1d2f6dd1105f76fba9da5dd17672443bc2 | Fix cross-section screenshot | [
{
"sha": "7549ff4034aa7cd3c4d64057275be089117cd2b7",
"filename": "visbrain/brain/user.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/9ef51b1d2f6dd1105f76fba9da5dd17672443bc2/visbrain%2Fbrain%2Fuser.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/9ef51b1d2f6dd1105f76fba9da5dd17672443bc2/visbrain%2Fbrain%2Fuser.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Fuser.py?ref=9ef51b1d2f6dd1105f76fba9da5dd17672443bc2",
"patch": "@@ -175,7 +175,7 @@ def screenshot(self, saveas, canvas='main', print_size=None, dpi=300.,\n self._objsPage.setCurrentIndex(1)\n self._csView.canvas.show(True)\n canvas = self._csView.canvas\n- widget = self._csGrid['grid']\n+ widget = self._csView.wc\n else:\n raise ValueError(\"The canvas \" + canvas + \" doesn't exist. Use \"\n \"either 'main', 'colorbar' or 'cross-sections'\")"
}
] |
visbrain | ddc68b1cfb752b8837ef7b5a2b77bef69530bce6 | 9ef51b1d2f6dd1105f76fba9da5dd17672443bc2 | visbrain/brain/user.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -336,7 +336,7 @@ class BrainUserMethods(object):
obj.mask = mask
obj.mask_color = mask_color
obj.alpha = alpha
- obj.visible = visible
+ obj.visible_obj = visible
def sources_display(self, name=None, select='all'):
| obj . visible = visible | obj . visible_obj = visible | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:visible", 3, 13, 3, 20], "visible_obj"]] | kdeleeuw11/visbrain@ddc68b1cfb752b8837ef7b5a2b77bef69530bce6 | Fix visible sources | [
{
"sha": "89e31a641428c749272e7c9465bd6ec74710f55e",
"filename": "visbrain/brain/user.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/ddc68b1cfb752b8837ef7b5a2b77bef69530bce6/visbrain%2Fbrain%2Fuser.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/ddc68b1cfb752b8837ef7b5a2b77bef69530bce6/visbrain%2Fbrain%2Fuser.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Fuser.py?ref=ddc68b1cfb752b8837ef7b5a2b77bef69530bce6",
"patch": "@@ -336,7 +336,7 @@ def sources_control(self, name, data=None, color=None, symbol=None,\n obj.mask = mask\n obj.mask_color = mask_color\n obj.alpha = alpha\n- obj.visible = visible\n+ obj.visible_obj = visible\n \n def sources_display(self, name=None, select='all'):\n \"\"\"Select sources to display."
}
] |
visbrain | 9430b52560bbacca6c211ecb16278fd6bc1e7818 | 7c070af7f588498ed241db8c8914bee8e8b301b8 | visbrain/objects/pacmap_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -1,4 +1,4 @@
-"""Spectrogram object."""
+"""Pacmap object."""
import numpy as np
from .image_obj import ImageObj
| """Spectrogram object.""" | """Pacmap object.""" | CHANGE_STRING_LITERAL | [["Update", ["string:\"\"\"Spectrogram object.\"\"\"", 0, 1, 0, 26], "\"\"\"Pacmap object.\"\"\""]] | kdeleeuw11/visbrain@9430b52560bbacca6c211ecb16278fd6bc1e7818 | Fix input title | [
{
"sha": "c7adcf7d6f21d1b8b5edb5bc9ca02b83c9115460",
"filename": "visbrain/objects/pacmap_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/9430b52560bbacca6c211ecb16278fd6bc1e7818/visbrain%2Fobjects%2Fpacmap_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/9430b52560bbacca6c211ecb16278fd6bc1e7818/visbrain%2Fobjects%2Fpacmap_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fpacmap_obj.py?ref=9430b52560bbacca6c211ecb16278fd6bc1e7818",
"patch": "@@ -1,4 +1,4 @@\n-\"\"\"Spectrogram object.\"\"\"\n+\"\"\"Pacmap object.\"\"\"\n import numpy as np\n \n from .image_obj import ImageObj"
}
] |
visbrain | 0483d9bf2b28d12259093baa3e1869b513824fca | fcdd2dda386f90e4cf1a12deb22eb52eab3afb92 | visbrain/utils/sleep/detection.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -688,7 +688,7 @@ def mtdetect(data, sf, threshold, hypno, rem_only, fmin=0., fmax=50.,
idx_mt = _index_to_events(np.c_[idx_start, idx_stop][good_amp])
# Compute number, duration, density
- if idx_hard.size:
+ if idx_mt.size:
idx_start, idx_stop = _events_to_index(idx_mt).T
number = idx_start.size
| if idx_hard . size : idx_start , idx_stop = _events_to_index ( idx_mt ) . T number = idx_start . size | if idx_mt . size : idx_start , idx_stop = _events_to_index ( idx_mt ) . T number = idx_start . size | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:idx_hard", 3, 12, 3, 20], "idx_mt"]] | kdeleeuw11/visbrain@0483d9bf2b28d12259093baa3e1869b513824fca | fix test_mt.py | [
{
"sha": "a3d23045df59816d08980eb75aa0b709bced64bc",
"filename": "visbrain/utils/sleep/detection.py",
"status": "modified",
"additions": 2,
"deletions": 2,
"changes": 4,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/0483d9bf2b28d12259093baa3e1869b513824fca/visbrain%2Futils%2Fsleep%2Fdetection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/0483d9bf2b28d12259093baa3e1869b513824fca/visbrain%2Futils%2Fsleep%2Fdetection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fsleep%2Fdetection.py?ref=0483d9bf2b28d12259093baa3e1869b513824fca",
"patch": "@@ -688,7 +688,7 @@ def mtdetect(data, sf, threshold, hypno, rem_only, fmin=0., fmax=50.,\n idx_mt = _index_to_events(np.c_[idx_start, idx_stop][good_amp])\n \n # Compute number, duration, density\n- if idx_hard.size:\n+ if idx_mt.size:\n idx_start, idx_stop = _events_to_index(idx_mt).T\n number = idx_start.size\n duration_ms = (idx_stop - idx_start) * (1000 / sf)\n@@ -698,7 +698,7 @@ def mtdetect(data, sf, threshold, hypno, rem_only, fmin=0., fmax=50.,\n \n else:\n return np.array([], dtype=int), 0., 0., np.array([], dtype=int)\n- \n+\n else:\n return np.array([], dtype=int), 0., 0., np.array([], dtype=int)\n "
}
] |
visbrain | 42c34e6ecda1213755fab1e6409a0800ed2cc2aa | e505fc1426255b651c954f8dd87d09021748848f | visbrain/objects/tests/test_vector_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -42,7 +42,7 @@ class TestVectorObj(_TestObjects):
def test_attributes(self):
"""Test function connect_attributes."""
- from visbrain.visuals.arrow import ARROW_TYPES
+ from vispy.visuals.line.arrow import ARROW_TYPES
self.assert_and_test('line_width', 4.4)
for k in ARROW_TYPES:
self.assert_and_test('arrow_type', k)
| from visbrain . visuals . arrow import ARROW_TYPES | from vispy . visuals . line . arrow import ARROW_TYPES | SINGLE_STMT | [["Update", ["identifier:visbrain", 3, 14, 3, 22], "vispy"], ["Insert", ["dotted_name", 3, 14, 3, 36], [".:.", "T"], 3], ["Insert", ["dotted_name", 3, 14, 3, 36], ["identifier:line", "T"], 4]] | kdeleeuw11/visbrain@42c34e6ecda1213755fab1e6409a0800ed2cc2aa | Fix ARROW_TYPES | [
{
"sha": "d4e0be4a0a12e6e159a63426c65af2c6c4b75078",
"filename": "visbrain/objects/tests/test_vector_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/42c34e6ecda1213755fab1e6409a0800ed2cc2aa/visbrain%2Fobjects%2Ftests%2Ftest_vector_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/42c34e6ecda1213755fab1e6409a0800ed2cc2aa/visbrain%2Fobjects%2Ftests%2Ftest_vector_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Ftests%2Ftest_vector_obj.py?ref=42c34e6ecda1213755fab1e6409a0800ed2cc2aa",
"patch": "@@ -42,7 +42,7 @@ def test_builtin_methods(self):\n \n def test_attributes(self):\n \"\"\"Test function connect_attributes.\"\"\"\n- from visbrain.visuals.arrow import ARROW_TYPES\n+ from vispy.visuals.line.arrow import ARROW_TYPES\n self.assert_and_test('line_width', 4.4)\n for k in ARROW_TYPES:\n self.assert_and_test('arrow_type', k)"
}
] |
visbrain | 638175ca6ffafcb2734861691ec10f23ce3677b6 | c6dde2c5bfd9bda90e68655783a40e3d39f69e97 | visbrain/objects/hypno_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -63,7 +63,7 @@ class HypnogramObj(VisbrainObject):
file, ext = os.path.splitext(name)
if ext in ['.csv', '.txt', '.hyp']:
data, sf = read_hypno(name)
- name, time = file, np.arange(len(data)) / sf
+ name, time = os.path.split(name)[1], np.arange(len(data)) / sf
# Initialize VisbrainObject and Hypnogram visuam creation :
VisbrainObject.__init__(self, name, parent, transform, verbose, **kw)
self.line = Hypnogram(data, time, art, wake, n1, n2, n3, rem,
| name , time = file , np . arange ( len ( data ) ) / sf | name , time = os . path . split ( name ) [ 1 ] , np . arange ( len ( data ) ) / sf | SINGLE_STMT | [["Insert", ["expression_list", 3, 26, 3, 57], ["subscript", "N0"], 0], ["Insert", "N0", ["call", "N1"], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["integer:1", "T"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["argument_list", "N3"], 1], ["Insert", "N2", ["attribute", "N4"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:split", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["identifier:name", "T"], 1], ["Insert", "N3", ["):)", "T"], 2], ["Update", ["identifier:file", 3, 26, 3, 30], "os"], ["Move", "N4", ["identifier:file", 3, 26, 3, 30], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:path", "T"], 2]] | kdeleeuw11/visbrain@638175ca6ffafcb2734861691ec10f23ce3677b6 | Fix object name | [
{
"sha": "63cc75350ca491d2f0a99118f6b4a32dbd1bf8cc",
"filename": "visbrain/objects/hypno_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/638175ca6ffafcb2734861691ec10f23ce3677b6/visbrain%2Fobjects%2Fhypno_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/638175ca6ffafcb2734861691ec10f23ce3677b6/visbrain%2Fobjects%2Fhypno_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Fhypno_obj.py?ref=638175ca6ffafcb2734861691ec10f23ce3677b6",
"patch": "@@ -63,7 +63,7 @@ def __init__(self, name, data=None, time=None, art=-1, wake=0, n1=1, n2=2,\n file, ext = os.path.splitext(name)\n if ext in ['.csv', '.txt', '.hyp']:\n data, sf = read_hypno(name)\n- name, time = file, np.arange(len(data)) / sf\n+ name, time = os.path.split(name)[1], np.arange(len(data)) / sf\n # Initialize VisbrainObject and Hypnogram visuam creation :\n VisbrainObject.__init__(self, name, parent, transform, verbose, **kw)\n self.line = Hypnogram(data, time, art, wake, n1, n2, n3, rem,"
}
] |
visbrain | be9258ca252f6ac579bd08e8f12a8f2ea2252c60 | afe0bea74f8ba7dcf04036a7209589289a530b4f | visbrain/objects/tests/test_brain_obj.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -43,7 +43,7 @@ class TestBrainObj(_TestObjects):
b_obj._get_template_path()
b_obj._get_default_templates()
b_obj._get_downloadable_templates()
- b_obj._add_downloadable_templates()
+ b_obj._add_downloadable_templates('white')
def test_rotation(self):
"""Test function rotation."""
| b_obj . _add_downloadable_templates ( ) | b_obj . _add_downloadable_templates ( 'white' ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 42, 3, 44], ["string:'white'", "T"], 1]] | kdeleeuw11/visbrain@be9258ca252f6ac579bd08e8f12a8f2ea2252c60 | Fix BrainObj test | [
{
"sha": "14a5e1042f873a1e24ad7bde7758e90f647fc246",
"filename": "visbrain/objects/tests/test_brain_obj.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/be9258ca252f6ac579bd08e8f12a8f2ea2252c60/visbrain%2Fobjects%2Ftests%2Ftest_brain_obj.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/be9258ca252f6ac579bd08e8f12a8f2ea2252c60/visbrain%2Fobjects%2Ftests%2Ftest_brain_obj.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fobjects%2Ftests%2Ftest_brain_obj.py?ref=be9258ca252f6ac579bd08e8f12a8f2ea2252c60",
"patch": "@@ -43,7 +43,7 @@ def test_get_template_list(self):\n b_obj._get_template_path()\n b_obj._get_default_templates()\n b_obj._get_downloadable_templates()\n- b_obj._add_downloadable_templates()\n+ b_obj._add_downloadable_templates('white')\n \n def test_rotation(self):\n \"\"\"Test function rotation.\"\"\""
}
] |
visbrain | ac2e9917759c28bc301e287ef32d26c8266ec4f7 | f795a3d5d5890701219f0f20cec37fd9e4662f71 | visbrain/sleep/interface/ui_elements/ui_settings.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -62,7 +62,7 @@ class UiSettings(object):
hypref = int(self._hypno[t[0]])
hypconv = self._hconv[hypref]
hypcol = self._hypcolor[hypconv]
- stage = str(self._hypYLabels[hypconv + 1].text())
+ stage = str(self._hypYLabels[hypconv + 2].text())
# ================= MESH UPDATES =================
# ---------------------------------------
| stage = str ( self . _hypYLabels [ hypconv + 1 ] . text ( ) ) | stage = str ( self . _hypYLabels [ hypconv + 2 ] . text ( ) ) | CHANGE_NUMERIC_LITERAL | [["Update", ["integer:1", 3, 48, 3, 49], "2"]] | kdeleeuw11/visbrain@ac2e9917759c28bc301e287ef32d26c8266ec4f7 | Fix stage name in navigation bar | [
{
"sha": "e1e1d0674232d571cb33caafad74c1057be91883",
"filename": "visbrain/sleep/interface/ui_elements/ui_settings.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/ac2e9917759c28bc301e287ef32d26c8266ec4f7/visbrain%2Fsleep%2Finterface%2Fui_elements%2Fui_settings.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/ac2e9917759c28bc301e287ef32d26c8266ec4f7/visbrain%2Fsleep%2Finterface%2Fui_elements%2Fui_settings.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2Fui_elements%2Fui_settings.py?ref=ac2e9917759c28bc301e287ef32d26c8266ec4f7",
"patch": "@@ -62,7 +62,7 @@ def _fcn_slider_move(self):\n hypref = int(self._hypno[t[0]])\n hypconv = self._hconv[hypref]\n hypcol = self._hypcolor[hypconv]\n- stage = str(self._hypYLabels[hypconv + 1].text())\n+ stage = str(self._hypYLabels[hypconv + 2].text())\n \n # ================= MESH UPDATES =================\n # ---------------------------------------"
}
] |
visbrain | cb252c4b37d609d3614db9f359c2ff46dea501bc | 2c78410ef53824a65ed21b48283116afd7bc3650 | examples/brain/05_region_of_interest.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -66,7 +66,7 @@ vb = Brain(brain_obj=b_obj, source_obj=s_obj, roi_obj=roi_obj)
"""Select the colorbar of the ROI
"""
-vb.cbar_select('ROI')
+vb.cbar_select('roi')
"""Eventualy, take a screenshot
"""
| vb . cbar_select ( 'ROI' ) | vb . cbar_select ( 'roi' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'ROI'", 3, 16, 3, 21], "'roi'"]] | kdeleeuw11/visbrain@cb252c4b37d609d3614db9f359c2ff46dea501bc | Fix selecting colorbar object | [
{
"sha": "047e8468b78b5a6f9b3649872d58ea432e8f437b",
"filename": "examples/brain/05_region_of_interest.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/cb252c4b37d609d3614db9f359c2ff46dea501bc/examples%2Fbrain%2F05_region_of_interest.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/cb252c4b37d609d3614db9f359c2ff46dea501bc/examples%2Fbrain%2F05_region_of_interest.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/examples%2Fbrain%2F05_region_of_interest.py?ref=cb252c4b37d609d3614db9f359c2ff46dea501bc",
"patch": "@@ -66,7 +66,7 @@\n \n \"\"\"Select the colorbar of the ROI\n \"\"\"\n-vb.cbar_select('ROI')\n+vb.cbar_select('roi')\n \n \"\"\"Eventualy, take a screenshot\n \"\"\""
}
] |
scikit-image | e3287c8cda606d902a76926baaadbbb44625ee2a | 20e1fcdbbb33e54b664103284a01acd75d0d2478 | doc/examples/features_detection/plot_gabors_from_astronaut.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -51,7 +51,7 @@ np.random.seed(42)
patch_shape = 8, 8
n_filters = 49
-astro = color.rgb2gray(data.astronaut())
+astro = np.ascontiguousarray(color.rgb2gray(data.astronaut()))
# -- filterbank1 on original image
patches1 = view_as_windows(astro, patch_shape)
| astro = color . rgb2gray ( data . astronaut ( ) ) | astro = np . ascontiguousarray ( color . rgb2gray ( data . astronaut ( ) ) ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 3, 9, 3, 41], ["attribute", "N0"], 0], ["Insert", ["call", 3, 9, 3, 41], ["argument_list", "N1"], 1], ["Insert", "N0", ["identifier:np", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:ascontiguousarray", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["call", 3, 9, 3, 41], 1], ["Insert", "N1", ["):)", "T"], 2]] | matsuken92/scikit-image@e3287c8cda606d902a76926baaadbbb44625ee2a | Fix warning in plot_gabors_from_astronaut | [
{
"sha": "7f718014ce71809a8b75169a3d668c0cbcfbec63",
"filename": "doc/examples/features_detection/plot_gabors_from_astronaut.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e3287c8cda606d902a76926baaadbbb44625ee2a/doc%2Fexamples%2Ffeatures_detection%2Fplot_gabors_from_astronaut.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e3287c8cda606d902a76926baaadbbb44625ee2a/doc%2Fexamples%2Ffeatures_detection%2Fplot_gabors_from_astronaut.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Ffeatures_detection%2Fplot_gabors_from_astronaut.py?ref=e3287c8cda606d902a76926baaadbbb44625ee2a",
"patch": "@@ -51,7 +51,7 @@\n patch_shape = 8, 8\n n_filters = 49\n \n-astro = color.rgb2gray(data.astronaut())\n+astro = np.ascontiguousarray(color.rgb2gray(data.astronaut()))\n \n # -- filterbank1 on original image\n patches1 = view_as_windows(astro, patch_shape)"
}
] |
scikit-image | 976ac85e4520b0174f69e95dfcddde0dd7402386 | a7685738c9bd54a53858199b2225dbb4d1adce8e | doc/examples/numpy_operations/plot_view_as_blocks.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -25,7 +25,7 @@ from skimage.util.shape import view_as_blocks
# -- get `astronaut` from skimage.data in grayscale
-l = color.rgb2gray(data.astronaut())
+l = np.ascontiguousarray(color.rgb2gray(data.astronaut()))
# -- size of blocks
block_shape = (4, 4)
| l = color . rgb2gray ( data . astronaut ( ) ) | l = np . ascontiguousarray ( color . rgb2gray ( data . astronaut ( ) ) ) | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 3, 5, 3, 37], ["attribute", "N0"], 0], ["Insert", ["call", 3, 5, 3, 37], ["argument_list", "N1"], 1], ["Insert", "N0", ["identifier:np", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:ascontiguousarray", "T"], 2], ["Insert", "N1", ["(:(", "T"], 0], ["Move", "N1", ["call", 3, 5, 3, 37], 1], ["Insert", "N1", ["):)", "T"], 2]] | matsuken92/scikit-image@976ac85e4520b0174f69e95dfcddde0dd7402386 | Fix warning in plot_view_as_blocks | [
{
"sha": "862d8e32a3d81d7198b77b871022fbc5aec32b47",
"filename": "doc/examples/numpy_operations/plot_view_as_blocks.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/976ac85e4520b0174f69e95dfcddde0dd7402386/doc%2Fexamples%2Fnumpy_operations%2Fplot_view_as_blocks.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/976ac85e4520b0174f69e95dfcddde0dd7402386/doc%2Fexamples%2Fnumpy_operations%2Fplot_view_as_blocks.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fnumpy_operations%2Fplot_view_as_blocks.py?ref=976ac85e4520b0174f69e95dfcddde0dd7402386",
"patch": "@@ -25,7 +25,7 @@\n \n \n # -- get `astronaut` from skimage.data in grayscale\n-l = color.rgb2gray(data.astronaut())\n+l = np.ascontiguousarray(color.rgb2gray(data.astronaut()))\n \n # -- size of blocks\n block_shape = (4, 4)"
}
] |
scikit-image | 8c5d30c2ac9a3a27db2d2648bd6e84a2813d9c66 | 3bf2250b646d461769b9b32af09deaf92192bc2f | skimage/external/tifffile/tifffile.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -2208,7 +2208,7 @@ class TiffSequence(object):
The data shape and dtype of all files must match.
- Properties
+ Attributes
----------
files : list
List of file names.
| shape and dtype of all files must match . Properties | shape and dtype of all files must match . Attributes | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:Properties", 3, 5, 3, 15], "Attributes"]] | matsuken92/scikit-image@8c5d30c2ac9a3a27db2d2648bd6e84a2813d9c66 | Fix unknown Properties section warning | [
{
"sha": "44de0bb14eaa94f644b1cc03bd6291976d5611e3",
"filename": "skimage/external/tifffile/tifffile.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/8c5d30c2ac9a3a27db2d2648bd6e84a2813d9c66/skimage%2Fexternal%2Ftifffile%2Ftifffile.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/8c5d30c2ac9a3a27db2d2648bd6e84a2813d9c66/skimage%2Fexternal%2Ftifffile%2Ftifffile.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fexternal%2Ftifffile%2Ftifffile.py?ref=8c5d30c2ac9a3a27db2d2648bd6e84a2813d9c66",
"patch": "@@ -2208,7 +2208,7 @@ class TiffSequence(object):\n \n The data shape and dtype of all files must match.\n \n- Properties\n+ Attributes\n ----------\n files : list\n List of file names."
}
] |
scikit-image | f4cbcf29f394fb31df208cb7246614b5fa6ac442 | 3cd4d03cb2de99da4a2a4592f3541074335ad6e9 | skimage/_build.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -86,7 +86,7 @@ def process_tempita_pyx(fromfile):
raise Exception('Building requires Tempita: '
'pip install --user Tempita')
from_filename = tempita.Template.from_filename
- template = from_filename(fromfile) #, encoding=sys.getdefaultencoding())
+ template = from_filename(fromfile, encoding=sys.getdefaultencoding())
pyxcontent = template.substitute()
assert fromfile.endswith('.pyx.in')
pyxfile = fromfile[:-len('.pyx.in')] + '.pyx'
| template = from_filename ( fromfile ) | template = from_filename ( fromfile , encoding = sys . getdefaultencoding ( ) ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 29, 3, 39], [",:,", "T"], 2], ["Insert", ["argument_list", 3, 29, 3, 39], ["keyword_argument", "N0"], 3], ["Insert", ["argument_list", 3, 29, 3, 39], ["):)", "T"], 4], ["Insert", "N0", ["identifier:encoding", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["call", "N1"], 2], ["Insert", "N1", ["attribute", "N2"], 0], ["Insert", "N1", ["argument_list", "N3"], 1], ["Insert", "N2", ["identifier:sys", "T"], 0], ["Insert", "N2", [".:.", "T"], 1], ["Insert", "N2", ["identifier:getdefaultencoding", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Move", "N3", ["):)", 3, 38, 3, 39], 1]] | matsuken92/scikit-image@f4cbcf29f394fb31df208cb7246614b5fa6ac442 | BLD: use default encoding | [
{
"sha": "c5041340cb12378a5b444110d17edef21be0a6eb",
"filename": "skimage/_build.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/f4cbcf29f394fb31df208cb7246614b5fa6ac442/skimage%2F_build.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/f4cbcf29f394fb31df208cb7246614b5fa6ac442/skimage%2F_build.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2F_build.py?ref=f4cbcf29f394fb31df208cb7246614b5fa6ac442",
"patch": "@@ -86,7 +86,7 @@ def process_tempita_pyx(fromfile):\n raise Exception('Building requires Tempita: '\n 'pip install --user Tempita')\n from_filename = tempita.Template.from_filename\n- template = from_filename(fromfile) #, encoding=sys.getdefaultencoding())\n+ template = from_filename(fromfile, encoding=sys.getdefaultencoding())\n pyxcontent = template.substitute()\n assert fromfile.endswith('.pyx.in')\n pyxfile = fromfile[:-len('.pyx.in')] + '.pyx'"
}
] |
scikit-image | 926af0ff53a1f1eef9ed8e267a140e9e0b2e3098 | fc70f73064a072fda66dce50148653efee7fa518 | skimage/_build.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -91,6 +91,6 @@ def process_tempita_pyx(fromfile):
if not fromfile.endswith('.pyx.in'):
raise ValueError("Unexpected extension of %s." % fromfile)
- pyxfile = os.path.splitext(fromfile)[0] + '.pyx'
+ pyxfile = os.path.splitext(fromfile)[0] # split off the .in ending
with open(pyxfile, "w") as f:
f.write(pyxcontent)
| pyxfile = os . path . splitext ( fromfile ) [ 0 ] + '.pyx' | pyxfile = os . path . splitext ( fromfile ) [ 0 ] | SINGLE_STMT | [["Move", ["assignment", 3, 5, 3, 53], ["subscript", 3, 15, 3, 44], 2], ["Delete", ["+:+", 3, 45, 3, 46]], ["Delete", ["string:'.pyx'", 3, 47, 3, 53]], ["Delete", ["binary_operator", 3, 15, 3, 53]]] | matsuken92/scikit-image@926af0ff53a1f1eef9ed8e267a140e9e0b2e3098 | BUG: fix the conversion from .pyx.in to .pyx files
It got botched sometime around reviewing/merging/rebasing of gh-1924 | [
{
"sha": "f5db582d91ddd652e546d0602d8a4a8a6cd31dd7",
"filename": "skimage/_build.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/926af0ff53a1f1eef9ed8e267a140e9e0b2e3098/skimage%2F_build.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/926af0ff53a1f1eef9ed8e267a140e9e0b2e3098/skimage%2F_build.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2F_build.py?ref=926af0ff53a1f1eef9ed8e267a140e9e0b2e3098",
"patch": "@@ -91,6 +91,6 @@ def process_tempita_pyx(fromfile):\n if not fromfile.endswith('.pyx.in'):\n raise ValueError(\"Unexpected extension of %s.\" % fromfile)\n \n- pyxfile = os.path.splitext(fromfile)[0] + '.pyx'\n+ pyxfile = os.path.splitext(fromfile)[0] # split off the .in ending\n with open(pyxfile, \"w\") as f:\n f.write(pyxcontent)"
}
] |
scikit-image | 25d15c603d837a19f9d281ff8bee9dfbadc22ea9 | 5e6c98ac010416829c7839286e0a9bc647b062cc | skimage/feature/peak.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -4,7 +4,7 @@ from ..filters import rank_order
def peak_local_max(image, min_distance=1, threshold_abs=None,
- threshold_rel=None, exclude_border=1, indices=True,
+ threshold_rel=None, exclude_border=True, indices=True,
num_peaks=np.inf, footprint=None, labels=None):
| def peak_local_max ( image , min_distance = 1 , threshold_abs = None , threshold_rel = None , exclude_border = 1 , indices = True , num_peaks = np . inf , footprint = None , labels = None ) : | def peak_local_max ( image , min_distance = 1 , threshold_abs = None , threshold_rel = None , exclude_border = True , indices = True , num_peaks = np . inf , footprint = None , labels = None ) : | SINGLE_TOKEN | [["Insert", ["default_parameter", 3, 40, 3, 56], ["true:True", "T"], 2], ["Delete", ["integer:1", 3, 55, 3, 56]]] | matsuken92/scikit-image@25d15c603d837a19f9d281ff8bee9dfbadc22ea9 | Updated default value to be backwards compatible | [
{
"sha": "b4a0d44ae61730b795ddaea804e64f9db46a0cd7",
"filename": "skimage/feature/peak.py",
"status": "modified",
"additions": 2,
"deletions": 2,
"changes": 4,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/25d15c603d837a19f9d281ff8bee9dfbadc22ea9/skimage%2Ffeature%2Fpeak.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/25d15c603d837a19f9d281ff8bee9dfbadc22ea9/skimage%2Ffeature%2Fpeak.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fpeak.py?ref=25d15c603d837a19f9d281ff8bee9dfbadc22ea9",
"patch": "@@ -4,7 +4,7 @@\n \n \n def peak_local_max(image, min_distance=1, threshold_abs=None,\n- threshold_rel=None, exclude_border=1, indices=True,\n+ threshold_rel=None, exclude_border=True, indices=True,\n num_peaks=np.inf, footprint=None, labels=None):\n \"\"\"Find peaks in an image as coordinate list or boolean mask.\n \n@@ -92,7 +92,7 @@ def peak_local_max(image, min_distance=1, threshold_abs=None,\n array([[10, 10, 10]])\n \n \"\"\"\n- \n+\n if type(exclude_border) == bool:\n exclude_border = min_distance if exclude_border else 0\n "
}
] |
scikit-image | 20d4e7dde8dc528ad27fb3ee368d8af7ef108979 | c0e3dcc69f60045bec37eedf0469727f7b37c2b3 | skimage/feature/peak.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -139,7 +139,7 @@ def peak_local_max(image, min_distance=1, threshold_abs=None,
image_max = ndi.maximum_filter(image, size=size, mode='constant')
mask = image == image_max
- if exclude_border and (footprint is not None):
+ if exclude_border:
# zero out the image borders
for i in range(mask.ndim):
mask = mask.swapaxes(0, i)
| if exclude_border and ( footprint is not None ) : for i in range ( mask . ndim ) : mask = mask . swapaxes ( 0 , i ) | if exclude_border : for i in range ( mask . ndim ) : mask = mask . swapaxes ( 0 , i ) | SINGLE_STMT | [["Move", ["if_statement", 3, 5, 6, 39], ["identifier:exclude_border", 3, 8, 3, 22], 1], ["Delete", ["and:and", 3, 23, 3, 26]], ["Delete", ["(:(", 3, 27, 3, 28]], ["Delete", ["identifier:footprint", 3, 28, 3, 37]], ["Delete", ["is:is", 3, 38, 3, 40]], ["Delete", ["not:not", 3, 41, 3, 44]], ["Delete", ["none:None", 3, 45, 3, 49]], ["Delete", ["comparison_operator", 3, 28, 3, 49]], ["Delete", ["):)", 3, 49, 3, 50]], ["Delete", ["parenthesized_expression", 3, 27, 3, 50]], ["Delete", ["boolean_operator", 3, 8, 3, 50]]] | matsuken92/scikit-image@20d4e7dde8dc528ad27fb3ee368d8af7ef108979 | Finally fixed issue:
Issue Was with remnant of min_distance logic (i.e. `footprint is not
None` | [
{
"sha": "c4d1aa3231b737dbddd6c1c6ad655cb38e4d0327",
"filename": "skimage/feature/peak.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/20d4e7dde8dc528ad27fb3ee368d8af7ef108979/skimage%2Ffeature%2Fpeak.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/20d4e7dde8dc528ad27fb3ee368d8af7ef108979/skimage%2Ffeature%2Fpeak.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fpeak.py?ref=20d4e7dde8dc528ad27fb3ee368d8af7ef108979",
"patch": "@@ -139,7 +139,7 @@ def peak_local_max(image, min_distance=1, threshold_abs=None,\n image_max = ndi.maximum_filter(image, size=size, mode='constant')\n mask = image == image_max\n \n- if exclude_border and (footprint is not None):\n+ if exclude_border:\n # zero out the image borders\n for i in range(mask.ndim):\n mask = mask.swapaxes(0, i)"
}
] |
scikit-image | 5ac3255065f69a07d15080ac1e98536afde07de1 | a34a301f1f14537b537ff2374afe686f86c9e5fc | skimage/measure/_structural_similarity.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -102,7 +102,7 @@ def compare_ssim(X, Y, win_size=None, gradient=False,
if full:
S = np.empty(X.shape)
for ch in range(nch):
- ch_result = structural_similarity(X[..., ch], Y[..., ch], **args)
+ ch_result = compare_ssim(X[..., ch], Y[..., ch], **args)
if gradient and full:
mssim[..., ch], G[..., ch], S[..., ch] = ch_result
| ch_result = structural_similarity ( X [ ... , ch ] , Y [ ... , ch ] , ** args ) | ch_result = compare_ssim ( X [ ... , ch ] , Y [ ... , ch ] , ** args ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:structural_similarity", 3, 25, 3, 46], "compare_ssim"]] | matsuken92/scikit-image@5ac3255065f69a07d15080ac1e98536afde07de1 | FIX: remove use of deprecated call to structural_similarity from within compute_ssim | [
{
"sha": "2a491da8e75d02a43fc8925158ecb97f7c7290f4",
"filename": "skimage/measure/_structural_similarity.py",
"status": "modified",
"additions": 3,
"deletions": 3,
"changes": 6,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/5ac3255065f69a07d15080ac1e98536afde07de1/skimage%2Fmeasure%2F_structural_similarity.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/5ac3255065f69a07d15080ac1e98536afde07de1/skimage%2Fmeasure%2F_structural_similarity.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2F_structural_similarity.py?ref=5ac3255065f69a07d15080ac1e98536afde07de1",
"patch": "@@ -102,7 +102,7 @@ def compare_ssim(X, Y, win_size=None, gradient=False,\n if full:\n S = np.empty(X.shape)\n for ch in range(nch):\n- ch_result = structural_similarity(X[..., ch], Y[..., ch], **args)\n+ ch_result = compare_ssim(X[..., ch], Y[..., ch], **args)\n if gradient and full:\n mssim[..., ch], G[..., ch], S[..., ch] = ch_result\n elif gradient:\n@@ -226,6 +226,6 @@ def structural_similarity(X, Y, win_size=None, gradient=False,\n gaussian_weights=False, full=False, **kwargs):\n \"\"\"\"\"\" + compare_ssim.__doc__\n return compare_ssim(X, Y, win_size=win_size, gradient=gradient,\n- dynamic_range=dynamic_range, \n- multichannel=multichannel, \n+ dynamic_range=dynamic_range,\n+ multichannel=multichannel,\n gaussian_weights=gaussian_weights, full=full, **kwargs)"
}
] |
scikit-image | 795287875495c3a7e25fa15d714ee7d9d21003c9 | e146fa447c6c52d99d2ec8b9ff445c376d5d025f | skimage/transform/pyramids.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -259,7 +259,7 @@ def pyramid_laplacian(image, max_layer=-1, downscale=2, sigma=None, order=1,
References
----------
.. [1] http://web.mit.edu/persci/people/adelson/pub_pdfs/pyramid83.pdf
- .. [2] http://sepwww.stanford.edu/~morgan/texturematch/paper_html/node3.html
+ .. [2] http://sepwww.stanford.edu/data/media/public/sep/morgan/texturematch/paper_html/node3.html
| http : // sepwww . stanford . edu / ~ morgan / texturematch / paper_html / node3 . html | http : // sepwww . stanford . edu / data / media / public / sep / morgan / texturematch / paper_html / node3 . html | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 19, 3, 46], ["binary_operator", "N0"], 0], ["Insert", ["binary_operator", 3, 19, 3, 46], ["/:/", "T"], 1], ["Move", ["binary_operator", 3, 19, 3, 46], ["identifier:morgan", 3, 40, 3, 46], 2], ["Insert", "N0", ["binary_operator", "N1"], 0], ["Insert", "N0", ["/:/", "T"], 1], ["Insert", "N0", ["identifier:sep", "T"], 2], ["Insert", "N1", ["binary_operator", "N2"], 0], ["Insert", "N1", ["/:/", "T"], 1], ["Insert", "N1", ["identifier:public", "T"], 2], ["Insert", "N2", ["binary_operator", "N3"], 0], ["Insert", "N2", ["/:/", "T"], 1], ["Insert", "N2", ["identifier:media", "T"], 2], ["Move", "N3", ["attribute", 3, 19, 3, 38], 0], ["Move", "N3", ["/:/", 3, 38, 3, 39], 1], ["Insert", "N3", ["identifier:data", "T"], 2], ["Delete", ["~:~", 3, 39, 3, 40]], ["Delete", ["unary_operator", 3, 39, 3, 46]]] | matsuken92/scikit-image@795287875495c3a7e25fa15d714ee7d9d21003c9 | Fix URL to texturematch paper | [
{
"sha": "d582636f42c56c85f04f01e190207bd2151a086e",
"filename": "skimage/transform/pyramids.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/795287875495c3a7e25fa15d714ee7d9d21003c9/skimage%2Ftransform%2Fpyramids.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/795287875495c3a7e25fa15d714ee7d9d21003c9/skimage%2Ftransform%2Fpyramids.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2Fpyramids.py?ref=795287875495c3a7e25fa15d714ee7d9d21003c9",
"patch": "@@ -259,7 +259,7 @@ def pyramid_laplacian(image, max_layer=-1, downscale=2, sigma=None, order=1,\n References\n ----------\n .. [1] http://web.mit.edu/persci/people/adelson/pub_pdfs/pyramid83.pdf\n- .. [2] http://sepwww.stanford.edu/~morgan/texturematch/paper_html/node3.html\n+ .. [2] http://sepwww.stanford.edu/data/media/public/sep/morgan/texturematch/paper_html/node3.html\n \n \"\"\"\n "
}
] |
scikit-image | 8abe35797241cd8e496c7c0fb0dbc4964a51845a | d0bf9d614fd92cc4e3abbcd87b6ffad1dc714d5a | skimage/color/colorconv.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -331,7 +331,7 @@ rgb_from_yuv = linalg.inv(yuv_from_rgb)
yiq_from_rgb = np.array([[0.299 , 0.587 , 0.114 ],
[0.59590059, -0.27455667, -0.32134392],
- [0.21153661, -0.52273617, 0.31119955]]).T
+ [0.21153661, -0.52273617, 0.31119955]])
rgb_from_yiq = linalg.inv(yiq_from_rgb)
| yiq_from_rgb = np . array ( [ [ 0.299 , 0.587 , 0.114 ] , [ 0.59590059 , - 0.27455667 , - 0.32134392 ] , [ 0.21153661 , - 0.52273617 , 0.31119955 ] ] ) . T | yiq_from_rgb = np . array ( [ [ 0.299 , 0.587 , 0.114 ] , [ 0.59590059 , - 0.27455667 , - 0.32134392 ] , [ 0.21153661 , - 0.52273617 , 0.31119955 ] ] ) | SINGLE_STMT | [["Move", ["assignment", 1, 1, 3, 68], ["call", 1, 16, 3, 66], 2], ["Delete", [".:.", 3, 66, 3, 67]], ["Delete", ["identifier:T", 3, 67, 3, 68]], ["Delete", ["attribute", 1, 16, 3, 68]]] | matsuken92/scikit-image@8abe35797241cd8e496c7c0fb0dbc4964a51845a | Fix one more transpose | [
{
"sha": "4eb83743207ebff875669038ab1ee0fd6bde0176",
"filename": "skimage/color/colorconv.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/8abe35797241cd8e496c7c0fb0dbc4964a51845a/skimage%2Fcolor%2Fcolorconv.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/8abe35797241cd8e496c7c0fb0dbc4964a51845a/skimage%2Fcolor%2Fcolorconv.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fcolor%2Fcolorconv.py?ref=8abe35797241cd8e496c7c0fb0dbc4964a51845a",
"patch": "@@ -331,7 +331,7 @@ def hsv2rgb(hsv):\n \n yiq_from_rgb = np.array([[0.299 , 0.587 , 0.114 ],\n [0.59590059, -0.27455667, -0.32134392],\n- [0.21153661, -0.52273617, 0.31119955]]).T\n+ [0.21153661, -0.52273617, 0.31119955]])\n \n rgb_from_yiq = linalg.inv(yiq_from_rgb)\n "
}
] |
scikit-image | 6f4cbebd6d81cc2aa69dfddf354a01a8b5969a54 | 307a4e9936044c5f63e49aac5a2928b46bb11558 | skimage/measure/fit.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -765,7 +765,7 @@ def ransac(data, model_class, min_samples, residual_threshold,
where the probability (confidence) is typically set to a high value
such as 0.99, and e is the current fraction of inliers w.r.t. the
total number of samples.
- random_state : int, RandomState instance or None, optional (default=None)
+ random_state : int, RandomState instance or None, optional
If int, random_state is the seed used by the random number generator;
If RandomState instance, random_state is the random number generator;
If None, the random number generator is the RandomState instance used
| samples . random_state : int , RandomState instance or None , optional ( default = None ) | samples . random_state : int , RandomState instance or None , optional | SINGLE_STMT | [["Move", ["type", 3, 55, 3, 78], ["identifier:optional", 3, 55, 3, 63], 0], ["Delete", ["(:(", 3, 64, 3, 65]], ["Delete", ["identifier:default", 3, 65, 3, 72]], ["Delete", ["=:=", 3, 72, 3, 73]], ["Delete", ["none:None", 3, 73, 3, 77]], ["Delete", ["keyword_argument", 3, 65, 3, 77]], ["Delete", ["):)", 3, 77, 3, 78]], ["Delete", ["argument_list", 3, 64, 3, 78]], ["Delete", ["call", 3, 55, 3, 78]]] | matsuken92/scikit-image@6f4cbebd6d81cc2aa69dfddf354a01a8b5969a54 | remove default value in docstring | [
{
"sha": "660b86f6945ad0cefc02a31cc6fb75b3381ec807",
"filename": "skimage/measure/fit.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/6f4cbebd6d81cc2aa69dfddf354a01a8b5969a54/skimage%2Fmeasure%2Ffit.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/6f4cbebd6d81cc2aa69dfddf354a01a8b5969a54/skimage%2Fmeasure%2Ffit.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2Ffit.py?ref=6f4cbebd6d81cc2aa69dfddf354a01a8b5969a54",
"patch": "@@ -765,7 +765,7 @@ def ransac(data, model_class, min_samples, residual_threshold,\n where the probability (confidence) is typically set to a high value\n such as 0.99, and e is the current fraction of inliers w.r.t. the\n total number of samples.\n- random_state : int, RandomState instance or None, optional (default=None)\n+ random_state : int, RandomState instance or None, optional\n If int, random_state is the seed used by the random number generator;\n If RandomState instance, random_state is the random number generator;\n If None, the random number generator is the RandomState instance used"
}
] |
scikit-image | 8b6460b06eb333af9de44330b65fb6308e453f28 | 292a0bee3c2ce6d90475da1958f9edd6fbedfd58 | skimage/filters/thresholding.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -133,7 +133,7 @@ def threshold_otsu(image, nbins=256):
# Check if the image is multi-colored or not
if image.min() == image.max():
- raise TypeError("threshold_otsu is expected to work with images " \
+ raise ValueError("threshold_otsu is expected to work with images " \
"having more than one color. The input image seems " \
"to have just one color {0}.".format(image.min()))
| raise TypeError ( "threshold_otsu is expected to work with images " "having more than one color. The input image seems " "to have just one color {0}." . format ( image . min ( ) ) ) | raise ValueError ( "threshold_otsu is expected to work with images " "having more than one color. The input image seems " "to have just one color {0}." . format ( image . min ( ) ) ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:TypeError", 3, 15, 3, 24], "ValueError"]] | matsuken92/scikit-image@8b6460b06eb333af9de44330b65fb6308e453f28 | Correcting the Error raised for Otsu Threshold
The previous error, `TypeError` did not reflect the test done and would typically be raised while `image` indeed had the correct type. | [
{
"sha": "d21bd5794e967e5ba9e446d364fb53c0b4588dbf",
"filename": "skimage/filters/thresholding.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/8b6460b06eb333af9de44330b65fb6308e453f28/skimage%2Ffilters%2Fthresholding.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/8b6460b06eb333af9de44330b65fb6308e453f28/skimage%2Ffilters%2Fthresholding.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilters%2Fthresholding.py?ref=8b6460b06eb333af9de44330b65fb6308e453f28",
"patch": "@@ -133,7 +133,7 @@ def threshold_otsu(image, nbins=256):\n \n # Check if the image is multi-colored or not\n if image.min() == image.max():\n- raise TypeError(\"threshold_otsu is expected to work with images \" \\\n+ raise ValueError(\"threshold_otsu is expected to work with images \" \\\n \"having more than one color. The input image seems \" \\\n \"to have just one color {0}.\".format(image.min()))\n "
}
] |
scikit-image | 1d7c4fd535d27c69bb4106bf962c2805362e1ac8 | 9174110faa39807d4dd5bb715a530b5a0dd5af48 | skimage/filters/tests/test_thresholding.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -167,7 +167,7 @@ def test_otsu_astro_image():
def test_otsu_one_color_image():
img = np.ones((10, 10), dtype=np.uint8)
- assert_raises(TypeError, threshold_otsu, img)
+ assert_raises(ValueError, threshold_otsu, img)
def test_li_camera_image():
camera = skimage.img_as_ubyte(data.camera())
| assert_raises ( TypeError , threshold_otsu , img ) | assert_raises ( ValueError , threshold_otsu , img ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:TypeError", 3, 19, 3, 28], "ValueError"]] | matsuken92/scikit-image@1d7c4fd535d27c69bb4106bf962c2805362e1ac8 | Corrected Otsu test error raising assertion | [
{
"sha": "c5d583b28c1013c2ca0ee227e0230d548e328d21",
"filename": "skimage/filters/tests/test_thresholding.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/1d7c4fd535d27c69bb4106bf962c2805362e1ac8/skimage%2Ffilters%2Ftests%2Ftest_thresholding.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/1d7c4fd535d27c69bb4106bf962c2805362e1ac8/skimage%2Ffilters%2Ftests%2Ftest_thresholding.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilters%2Ftests%2Ftest_thresholding.py?ref=1d7c4fd535d27c69bb4106bf962c2805362e1ac8",
"patch": "@@ -167,7 +167,7 @@ def test_otsu_astro_image():\n \n def test_otsu_one_color_image():\n img = np.ones((10, 10), dtype=np.uint8)\n- assert_raises(TypeError, threshold_otsu, img)\n+ assert_raises(ValueError, threshold_otsu, img)\n \n def test_li_camera_image():\n camera = skimage.img_as_ubyte(data.camera())"
}
] |
scikit-image | dc81adad6a2f462dcc649c12dbe30210dcf42ff9 | 030e6233007f124f7de040f9e7bd29873839a231 | skimage/transform/_geometric.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -1147,7 +1147,7 @@ def _clip_warp_output(input_image, output_image, order, mode, cval, clip):
output_image[cval_mask] = cval
-def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,
+def warp(image, inverse_map, map_args={}, output_shape=None, order=1,
mode='constant', cval=0., clip=True, preserve_range=False):
| def warp ( image , inverse_map = None , map_args = { } , output_shape = None , order = 1 , mode = 'constant' , cval = 0. , clip = True , preserve_range = False ) : | def warp ( image , inverse_map , map_args = { } , output_shape = None , order = 1 , mode = 'constant' , cval = 0. , clip = True , preserve_range = False ) : | SINGLE_STMT | [["Move", ["parameters", 3, 9, 4, 68], ["identifier:inverse_map", 3, 17, 3, 28], 3], ["Delete", ["=:=", 3, 28, 3, 29]], ["Delete", ["none:None", 3, 29, 3, 33]], ["Delete", ["default_parameter", 3, 17, 3, 33]]] | matsuken92/scikit-image@dc81adad6a2f462dcc649c12dbe30210dcf42ff9 | BUGFIX: inverse_map should not be None | [
{
"sha": "3793c9f5014e15b5a0ee1d8f937b597c8e05cbfd",
"filename": "skimage/transform/_geometric.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/dc81adad6a2f462dcc649c12dbe30210dcf42ff9/skimage%2Ftransform%2F_geometric.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/dc81adad6a2f462dcc649c12dbe30210dcf42ff9/skimage%2Ftransform%2F_geometric.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ftransform%2F_geometric.py?ref=dc81adad6a2f462dcc649c12dbe30210dcf42ff9",
"patch": "@@ -1147,7 +1147,7 @@ def _clip_warp_output(input_image, output_image, order, mode, cval, clip):\n output_image[cval_mask] = cval\n \n \n-def warp(image, inverse_map=None, map_args={}, output_shape=None, order=1,\n+def warp(image, inverse_map, map_args={}, output_shape=None, order=1,\n mode='constant', cval=0., clip=True, preserve_range=False):\n \"\"\"Warp an image according to a given coordinate transformation.\n "
}
] |
scikit-image | 749f5876ce317c56224f700c4de488a472704a5b | 7960d296dd310567abcae5177c22a0b1345626db | skimage/data/__init__.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -160,7 +160,7 @@ def horse():
- with expected_warnings(['precision loss']):
+ with expected_warnings(['Possible precision loss', 'Possible sign loss']):
return img_as_bool(load("horse.png", as_grey=True))
| with expected_warnings ( [ 'precision loss' ] ) : return img_as_bool ( load ( "horse.png" , as_grey = True ) ) | with expected_warnings ( [ 'Possible precision loss' , 'Possible sign loss' ] ) : return img_as_bool ( load ( "horse.png" , as_grey = True ) ) | SINGLE_STMT | [["Update", ["string:'precision loss'", 0, 29, 0, 45], "'Possible precision loss'"], ["Insert", ["list", 0, 28, 0, 46], [",:,", "T"], 2], ["Insert", ["list", 0, 28, 0, 46], ["string:'Possible sign loss'", "T"], 3]] | matsuken92/scikit-image@749f5876ce317c56224f700c4de488a472704a5b | Fix catched warning | [
{
"sha": "3a506f850dd642db9853153c90a0826cc5a746b2",
"filename": "skimage/data/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/749f5876ce317c56224f700c4de488a472704a5b/skimage%2Fdata%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/749f5876ce317c56224f700c4de488a472704a5b/skimage%2Fdata%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fdata%2F__init__.py?ref=749f5876ce317c56224f700c4de488a472704a5b",
"patch": "@@ -160,7 +160,7 @@ def horse():\n (marauder).\n \n \"\"\"\n- with expected_warnings(['precision loss']):\n+ with expected_warnings(['Possible precision loss', 'Possible sign loss']):\n return img_as_bool(load(\"horse.png\", as_grey=True))\n \n "
}
] |
scikit-image | 72577e9764fe1cf1920f2f394d0de64c7be71fb7 | 6f3520b83eee7640ea466a8c090106a930f84931 | skimage/restoration/_denoise.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -463,7 +463,7 @@ def denoise_wavelet(img, sigma=None, wavelet='db1', mode='soft',
if multichannel:
out = np.empty_like(img)
- for c in range(img.ndim):
+ for c in range(img.shape[-1]):
out[..., c] = _wavelet_threshold(img[..., c], wavelet=wavelet,
mode=mode, sigma=sigma)
else:
| for c in range ( img . ndim ) : out [ ... , c ] = _wavelet_threshold ( img [ ... , c ] , wavelet = wavelet , mode = mode , sigma = sigma ) | for c in range ( img . shape [ - 1 ] ) : out [ ... , c ] = _wavelet_threshold ( img [ ... , c ] , wavelet = wavelet , mode = mode , sigma = sigma ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 23, 3, 33], ["subscript", "N0"], 1], ["Move", "N0", ["attribute", 3, 24, 3, 32], 0], ["Insert", "N0", ["[:[", "T"], 1], ["Insert", "N0", ["unary_operator", "N1"], 2], ["Insert", "N0", ["]:]", "T"], 3], ["Update", ["identifier:ndim", 3, 28, 3, 32], "shape"], ["Insert", "N1", ["-:-", "T"], 0], ["Insert", "N1", ["integer:1", "T"], 1]] | matsuken92/scikit-image@72577e9764fe1cf1920f2f394d0de64c7be71fb7 | FIX: correct channel range in the multichannel case | [
{
"sha": "7f6c6b7b1399ed444d0c5c8eaf243179273cb5cf",
"filename": "skimage/restoration/_denoise.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/72577e9764fe1cf1920f2f394d0de64c7be71fb7/skimage%2Frestoration%2F_denoise.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/72577e9764fe1cf1920f2f394d0de64c7be71fb7/skimage%2Frestoration%2F_denoise.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Frestoration%2F_denoise.py?ref=72577e9764fe1cf1920f2f394d0de64c7be71fb7",
"patch": "@@ -463,7 +463,7 @@ def denoise_wavelet(img, sigma=None, wavelet='db1', mode='soft',\n \n if multichannel:\n out = np.empty_like(img)\n- for c in range(img.ndim):\n+ for c in range(img.shape[-1]):\n out[..., c] = _wavelet_threshold(img[..., c], wavelet=wavelet,\n mode=mode, sigma=sigma)\n else:"
}
] |
scikit-image | cb5288a4658f453c0f1dfa9e20f4dd41962cebbc | c39426415f0ddf297a965682bc3aa75f6b8ddb99 | skimage/filters/thresholding.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -246,7 +246,7 @@ def threshold_otsu(image, nbins=256):
- if image.shape[-1] in (3, 4):
+ if len(image.shape) > 2 and image.shape[-1] in (3, 4):
msg = "threshold_otsu is expected to work correctly only for " \
"grayscale images; image shape {0} looks like an RGB image"
warn(msg.format(image.shape))
| if image . shape [ - 1 ] in ( 3 , 4 ) : msg = "threshold_otsu is expected to work correctly only for " "grayscale images; image shape {0} looks like an RGB image" warn ( msg . format ( image . shape ) ) | if len ( image . shape ) > 2 and image . shape [ - 1 ] in ( 3 , 4 ) : msg = "threshold_otsu is expected to work correctly only for " "grayscale images; image shape {0} looks like an RGB image" warn ( msg . format ( image . shape ) ) | MORE_SPECIFIC_IF | [["Insert", ["if_statement", 0, 5, 3, 38], ["boolean_operator", "N0"], 1], ["Insert", "N0", ["comparison_operator", "N1"], 0], ["Insert", "N0", ["and:and", "T"], 1], ["Move", "N0", ["comparison_operator", 0, 8, 0, 33], 2], ["Insert", "N1", ["call", "N2"], 0], ["Insert", "N1", [">:>", "T"], 1], ["Insert", "N1", ["integer:2", "T"], 2], ["Insert", "N2", ["identifier:len", "T"], 0], ["Insert", "N2", ["argument_list", "N3"], 1], ["Insert", "N3", ["(:(", "T"], 0], ["Insert", "N3", ["attribute", "N4"], 1], ["Insert", "N3", ["):)", "T"], 2], ["Insert", "N4", ["identifier:image", "T"], 0], ["Insert", "N4", [".:.", "T"], 1], ["Insert", "N4", ["identifier:shape", "T"], 2]] | matsuken92/scikit-image@cb5288a4658f453c0f1dfa9e20f4dd41962cebbc | Added more specific check for image shape in threshold_otsu warning
Currently a warning is emitted from threshold_otsu if image.shape[-1]
is 3 or 4, as this suggests the image may be a RGB or RGBA image. However,
this warning is often raised unnecessarily. For example, the following
shapes of array raise this warning even though they are unlikely to be a RGB
image:
(500, 4)
(4, 3)
(3,)
(4,)
Modifying the code to check whether len(image.shape) > 2 means that none
of these are caught, but all images that may potentially be RGB are still caught.
I'm aware that the logic may be to raise warnings liberally, but it can cause problems,
particularly for people running with 'warnings as errors' - and I think this alteration
still catches all genuine RGB(A) images. | [
{
"sha": "ab6e81f07017677806cc277763a170c304509045",
"filename": "skimage/filters/thresholding.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/cb5288a4658f453c0f1dfa9e20f4dd41962cebbc/skimage%2Ffilters%2Fthresholding.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/cb5288a4658f453c0f1dfa9e20f4dd41962cebbc/skimage%2Ffilters%2Fthresholding.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilters%2Fthresholding.py?ref=cb5288a4658f453c0f1dfa9e20f4dd41962cebbc",
"patch": "@@ -246,7 +246,7 @@ def threshold_otsu(image, nbins=256):\n -----\n The input image must be grayscale.\n \"\"\"\n- if image.shape[-1] in (3, 4):\n+ if len(image.shape) > 2 and image.shape[-1] in (3, 4):\n msg = \"threshold_otsu is expected to work correctly only for \" \\\n \"grayscale images; image shape {0} looks like an RGB image\"\n warn(msg.format(image.shape))"
}
] |
scikit-image | 2fb59b92435b9f67c091871cba701323b784ade7 | 1a27bea7da1018d2154d0ae8b487f1f9cd560095 | skimage/io/_plugins/pil_plugin.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -48,7 +48,7 @@ def imread(fname, dtype=None, img_num=None, **kwargs):
im = Image.open(f)
return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
else:
- im = Image.open(f)
+ im = Image.open(fname)
return pil_to_ndarray(im, dtype=dtype, img_num=img_num)
| else : im = Image . open ( f ) | else : im = Image . open ( fname ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:f", 3, 25, 3, 26], "fname"]] | matsuken92/scikit-image@2fb59b92435b9f67c091871cba701323b784ade7 | Fix variable name | [
{
"sha": "fcd185abd2adf22d6aac9beba4d7a8fcbe46ed35",
"filename": "skimage/io/_plugins/pil_plugin.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/2fb59b92435b9f67c091871cba701323b784ade7/skimage%2Fio%2F_plugins%2Fpil_plugin.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/2fb59b92435b9f67c091871cba701323b784ade7/skimage%2Fio%2F_plugins%2Fpil_plugin.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2F_plugins%2Fpil_plugin.py?ref=2fb59b92435b9f67c091871cba701323b784ade7",
"patch": "@@ -48,7 +48,7 @@ def imread(fname, dtype=None, img_num=None, **kwargs):\n im = Image.open(f)\n return pil_to_ndarray(im, dtype=dtype, img_num=img_num)\n else:\n- im = Image.open(f)\n+ im = Image.open(fname)\n return pil_to_ndarray(im, dtype=dtype, img_num=img_num)\n \n "
}
] |
scikit-image | f6653b781f0064298f174007c2c67e92bf48de61 | b67a4e3076b6481f0f24349cabde375562977977 | skimage/io/_plugins/pil_plugin.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -5,7 +5,7 @@ from six import string_types
from PIL import Image
from ...util import img_as_ubyte, img_as_uint
-from .tifffile import imread as tif_imread, imsave as tif_imsave
+from .tifffile_plugin import imread as tif_imread, imsave as tif_imsave
def imread(fname, dtype=None, img_num=None, **kwargs):
| from . tifffile import imread as tif_imread , imsave as tif_imsave | from . tifffile_plugin import imread as tif_imread , imsave as tif_imsave | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:tifffile", 3, 7, 3, 15], "tifffile_plugin"]] | matsuken92/scikit-image@f6653b781f0064298f174007c2c67e92bf48de61 | Fix tifffile plugin import | [
{
"sha": "4e83043895294bfe13160b5bf6ef85cff6e6f5e6",
"filename": "skimage/io/_plugins/pil_plugin.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/f6653b781f0064298f174007c2c67e92bf48de61/skimage%2Fio%2F_plugins%2Fpil_plugin.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/f6653b781f0064298f174007c2c67e92bf48de61/skimage%2Fio%2F_plugins%2Fpil_plugin.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2F_plugins%2Fpil_plugin.py?ref=f6653b781f0064298f174007c2c67e92bf48de61",
"patch": "@@ -5,7 +5,7 @@\n from PIL import Image\n \n from ...util import img_as_ubyte, img_as_uint\n-from .tifffile import imread as tif_imread, imsave as tif_imsave\n+from .tifffile_plugin import imread as tif_imread, imsave as tif_imsave\n \n \n def imread(fname, dtype=None, img_num=None, **kwargs):"
}
] |
scikit-image | 9fb7676c92019f3b04eb0dcc2f6227870473e703 | eaaea690f2869311037fdab209986168268396ca | skimage/io/_plugins/matplotlib_plugin.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -4,7 +4,7 @@ import warnings
import matplotlib.pyplot as plt
from ...util import dtype as dtypes
from ...exposure import is_low_contrast
-from ..util.colormap import viridis
+from ...util.colormap import viridis
_default_colormap = 'gray'
_nonstandard_colormap = viridis
| from . . util . colormap import viridis | from . . . util . colormap import viridis | SINGLE_STMT | [["Insert", ["import_prefix", 3, 6, 3, 8], [".:.", "T"], 2]] | matsuken92/scikit-image@9fb7676c92019f3b04eb0dcc2f6227870473e703 | Fix relative import | [
{
"sha": "7fb01c8eb0d21f82a0d1886a268e7557c70683ab",
"filename": "skimage/io/_plugins/matplotlib_plugin.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/9fb7676c92019f3b04eb0dcc2f6227870473e703/skimage%2Fio%2F_plugins%2Fmatplotlib_plugin.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/9fb7676c92019f3b04eb0dcc2f6227870473e703/skimage%2Fio%2F_plugins%2Fmatplotlib_plugin.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2F_plugins%2Fmatplotlib_plugin.py?ref=9fb7676c92019f3b04eb0dcc2f6227870473e703",
"patch": "@@ -4,7 +4,7 @@\n import matplotlib.pyplot as plt\n from ...util import dtype as dtypes\n from ...exposure import is_low_contrast\n-from ..util.colormap import viridis\n+from ...util.colormap import viridis\n \n _default_colormap = 'gray'\n _nonstandard_colormap = viridis"
}
] |
scikit-image | f45a72ee1f9ccdf48ad79622343817dc06a82194 | 75edad1448fce0721558704df35d094e2bad4668 | doc/examples/plot_edge_modes.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -7,7 +7,7 @@ This example illustrates the different edge modes available during
-from skimage._shared._interpolation_test import extend_image
+from skimage._shared.interpolation import extend_image
import skimage.data
import matplotlib.pyplot as plt
import numpy as np
| from skimage . _shared . _interpolation_test import extend_image | from skimage . _shared . interpolation import extend_image | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:_interpolation_test", 0, 22, 0, 41], "interpolation"]] | matsuken92/scikit-image@f45a72ee1f9ccdf48ad79622343817dc06a82194 | BUG: fix import in plot_edge_modes.py | [
{
"sha": "f48d7aed9e99fa7f0383b4ad14c6865724c2324a",
"filename": "doc/examples/plot_edge_modes.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/f45a72ee1f9ccdf48ad79622343817dc06a82194/doc%2Fexamples%2Fplot_edge_modes.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/f45a72ee1f9ccdf48ad79622343817dc06a82194/doc%2Fexamples%2Fplot_edge_modes.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_edge_modes.py?ref=f45a72ee1f9ccdf48ad79622343817dc06a82194",
"patch": "@@ -7,7 +7,7 @@\n interpolation in routines such as ``skimage.transform.rescale`` and\n ``skimage.transform.resize``.\n \"\"\"\n-from skimage._shared._interpolation_test import extend_image\n+from skimage._shared.interpolation import extend_image\n import skimage.data\n import matplotlib.pyplot as plt\n import numpy as np"
}
] |
scikit-image | 81764d8ed57829ebed43a3f33b73c3d3b963a5f7 | 81ea7a6e342d805cc02629369870641b4a3166fa | doc/examples/plot_edge_modes.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -19,7 +19,7 @@ img[:2, :2] += 1
img[:1, :1] += 2
img[8, 8] = 4
-modes = ['constant', 'nearest', 'wrap', 'reflect', 'mirror']
+modes = ['constant', 'edge', 'wrap', 'reflect', 'symmetric']
fig, axes = plt.subplots(1, 5, figsize=(15, 5))
for n, mode in enumerate(modes):
img_extended = extend_image(img, pad=img.shape[0], mode=mode)
| modes = [ 'constant' , 'nearest' , 'wrap' , 'reflect' , 'mirror' ] | modes = [ 'constant' , 'edge' , 'wrap' , 'reflect' , 'symmetric' ] | SINGLE_STMT | [["Update", ["string:'nearest'", 3, 22, 3, 31], "'edge'"], ["Update", ["string:'mirror'", 3, 52, 3, 60], "'symmetric'"]] | matsuken92/scikit-image@81764d8ed57829ebed43a3f33b73c3d3b963a5f7 | BUG: update the edge modes in the example to match the current naming convention | [
{
"sha": "d68abf02bbada3b8ab13ffb8310907c22558b79c",
"filename": "doc/examples/plot_edge_modes.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/81764d8ed57829ebed43a3f33b73c3d3b963a5f7/doc%2Fexamples%2Fplot_edge_modes.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/81764d8ed57829ebed43a3f33b73c3d3b963a5f7/doc%2Fexamples%2Fplot_edge_modes.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_edge_modes.py?ref=81764d8ed57829ebed43a3f33b73c3d3b963a5f7",
"patch": "@@ -19,7 +19,7 @@\n img[:1, :1] += 2\n img[8, 8] = 4\n \n-modes = ['constant', 'nearest', 'wrap', 'reflect', 'mirror']\n+modes = ['constant', 'edge', 'wrap', 'reflect', 'symmetric']\n fig, axes = plt.subplots(1, 5, figsize=(15, 5))\n for n, mode in enumerate(modes):\n img_extended = extend_image(img, pad=img.shape[0], mode=mode)"
}
] |
scikit-image | 6c421cd366ef53c5222b6e0542568e2127871740 | 21f655edf7a2afdcd3a81302c8da1b6913b31bf1 | doc/examples/plot_adapt_rgb.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -57,7 +57,7 @@ ax_each.set_xticks([]), ax_each.set_yticks([])
ax_each.set_title("Sobel filter computed\n on individual RGB channels")
# We use 1 - sobel_hsv(image) but this will not work if image is not normalized
-ax_hsv.imshow( rescale_intensity((1-sobel_hsv(image))))
+ax_hsv.imshow(rescale_intensity(1 - sobel_hsv(image)))
ax_hsv.set_xticks([]), ax_hsv.set_yticks([])
ax_hsv.set_title("Sobel filter computed\n on (V)alue converted image (HSV)")
| ax_hsv . imshow ( rescale_intensity ( ( 1 - sobel_hsv ( image ) ) ) ) | ax_hsv . imshow ( rescale_intensity ( 1 - sobel_hsv ( image ) ) ) | SINGLE_STMT | [["Move", ["argument_list", 3, 33, 3, 55], ["binary_operator", 3, 35, 3, 53], 1], ["Move", ["argument_list", 3, 33, 3, 55], ["):)", 3, 53, 3, 54], 2], ["Delete", ["(:(", 3, 34, 3, 35]], ["Delete", ["parenthesized_expression", 3, 34, 3, 54]], ["Delete", ["):)", 3, 54, 3, 55]]] | matsuken92/scikit-image@6c421cd366ef53c5222b6e0542568e2127871740 | Fix style (pep8) | [
{
"sha": "f6aca943e3989646551eb561d435bd260f54053d",
"filename": "doc/examples/plot_adapt_rgb.py",
"status": "modified",
"additions": 4,
"deletions": 4,
"changes": 8,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/6c421cd366ef53c5222b6e0542568e2127871740/doc%2Fexamples%2Fplot_adapt_rgb.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/6c421cd366ef53c5222b6e0542568e2127871740/doc%2Fexamples%2Fplot_adapt_rgb.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fexamples%2Fplot_adapt_rgb.py?ref=6c421cd366ef53c5222b6e0542568e2127871740",
"patch": "@@ -47,7 +47,7 @@ def sobel_hsv(image):\n \n image = data.astronaut()\n \n-fig = plt.figure( figsize=(14,7) )\n+fig = plt.figure(figsize=(14, 7))\n ax_each = fig.add_subplot(121)\n ax_hsv = fig.add_subplot(122)\n \n@@ -57,7 +57,7 @@ def sobel_hsv(image):\n ax_each.set_title(\"Sobel filter computed\\n on individual RGB channels\")\n \n # We use 1 - sobel_hsv(image) but this will not work if image is not normalized\n-ax_hsv.imshow( rescale_intensity((1-sobel_hsv(image))))\n+ax_hsv.imshow(rescale_intensity(1 - sobel_hsv(image)))\n ax_hsv.set_xticks([]), ax_hsv.set_yticks([])\n ax_hsv.set_title(\"Sobel filter computed\\n on (V)alue converted image (HSV)\")\n \n@@ -105,11 +105,11 @@ def as_gray(image_filter, image, *args, **kwargs):\n def sobel_gray(image):\n return filters.sobel(image)\n \n-fig = plt.figure( figsize=(7,7) )\n+fig = plt.figure(figsize=(7, 7))\n ax = fig.add_subplot(111)\n \n # We use 1 - sobel_gray(image) but this will not work if image is not normalized \n-ax.imshow( rescale_intensity(1-sobel_gray(image)), cmap=plt.cm.gray)\n+ax.imshow( rescale_intensity(1 - sobel_gray(image)), cmap=plt.cm.gray)\n ax.set_xticks([]), ax.set_yticks([])\n ax.set_title(\"Sobel filter computed\\n on the converted grayscale image\")\n "
}
] |
scikit-image | 6638c92125080694eb751d7b7f4db5089b09b7f6 | 87adb532e7f5311b22853ceab50f0576b4dbac48 | skimage/measure/_regionprops.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -111,7 +111,7 @@ class _RegionProperties(object):
if intensity_image is not None:
if not intensity_image.shape == label_image.shape:
- raise ValueError('Label and intensity image must be the same shape.')
+ raise ValueError('Label and intensity image must have the same shape.')
self.label = label
self._slice = slice
| raise ValueError ( 'Label and intensity image must be the same shape.' ) | raise ValueError ( 'Label and intensity image must have the same shape.' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'Label and intensity image must be the same shape.'", 3, 34, 3, 85], "'Label and intensity image must have the same shape.'"]] | matsuken92/scikit-image@6638c92125080694eb751d7b7f4db5089b09b7f6 | fixed error language | [
{
"sha": "d0a06bacbe99ddef206429d80e0b6e4189d0b50f",
"filename": "skimage/measure/_regionprops.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/6638c92125080694eb751d7b7f4db5089b09b7f6/skimage%2Fmeasure%2F_regionprops.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/6638c92125080694eb751d7b7f4db5089b09b7f6/skimage%2Fmeasure%2F_regionprops.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2F_regionprops.py?ref=6638c92125080694eb751d7b7f4db5089b09b7f6",
"patch": "@@ -111,7 +111,7 @@ def __init__(self, slice, label, label_image, intensity_image,\n \n if intensity_image is not None:\n if not intensity_image.shape == label_image.shape:\n- raise ValueError('Label and intensity image must be the same shape.')\n+ raise ValueError('Label and intensity image must have the same shape.')\n \n self.label = label\n self._slice = slice"
}
] |
scikit-image | 3a2acb2adfebe2f94426f1e1b4cc83e0990cf33b | 4bc1c587ede3a5b74ef5525bd884d84914742483 | skimage/filters/rank/generic.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -373,7 +373,7 @@ def geometric_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=Fal
>>> from skimage.morphology import disk
>>> from skimage.filters.rank import mean
>>> img = data.camera()
- >>> avg = geomtric_mean(img, disk(5))
+ >>> avg = geometric_mean(img, disk(5))
| avg = geomtric_mean ( img , disk ( 5 ) ) | avg = geometric_mean ( img , disk ( 5 ) ) | WRONG_FUNCTION_NAME | [["Update", ["identifier:geomtric_mean", 3, 15, 3, 28], "geometric_mean"]] | matsuken92/scikit-image@3a2acb2adfebe2f94426f1e1b4cc83e0990cf33b | Update the documentation with spelling error | [
{
"sha": "9dd23aa0b6cd08aa566fc73508d5a80ba6b18ae6",
"filename": "skimage/filters/rank/generic.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/3a2acb2adfebe2f94426f1e1b4cc83e0990cf33b/skimage%2Ffilters%2Frank%2Fgeneric.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/3a2acb2adfebe2f94426f1e1b4cc83e0990cf33b/skimage%2Ffilters%2Frank%2Fgeneric.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilters%2Frank%2Fgeneric.py?ref=3a2acb2adfebe2f94426f1e1b4cc83e0990cf33b",
"patch": "@@ -373,7 +373,7 @@ def geometric_mean(image, selem, out=None, mask=None, shift_x=False, shift_y=Fal\n >>> from skimage.morphology import disk\n >>> from skimage.filters.rank import mean\n >>> img = data.camera()\n- >>> avg = geomtric_mean(img, disk(5))\n+ >>> avg = geometric_mean(img, disk(5))\n \n \"\"\"\n "
}
] |
scikit-image | be7161d3501a44b90eefe8ce974ff28278461f79 | a6f4419da4d2db4e82b31833d63eabefd439b398 | skimage/util/tests/test_dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -77,7 +77,7 @@ def test_downcast():
with expected_warnings('Downcasting'):
y = img_as_int(x)
assert np.allclose(y, x.astype(np.int16))
- assert y.dtype == np.uint16
+ assert y.dtype == np.uint16, y.dtype
def test_float_out_of_range():
| assert y . dtype == np . uint16 | assert y . dtype == np . uint16 , y . dtype | SINGLE_STMT | [["Insert", ["assert_statement", 3, 5, 3, 32], [",:,", "T"], 2], ["Insert", ["assert_statement", 3, 5, 3, 32], ["attribute", "N0"], 3], ["Insert", "N0", ["identifier:y", "T"], 0], ["Insert", "N0", [".:.", "T"], 1], ["Insert", "N0", ["identifier:dtype", "T"], 2]] | matsuken92/scikit-image@be7161d3501a44b90eefe8ce974ff28278461f79 | Add debug print | [
{
"sha": "67c5a0a8e3b85ab2c47d1a3c4f6078b4dc057d93",
"filename": "skimage/util/tests/test_dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/be7161d3501a44b90eefe8ce974ff28278461f79/skimage%2Futil%2Ftests%2Ftest_dtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/be7161d3501a44b90eefe8ce974ff28278461f79/skimage%2Futil%2Ftests%2Ftest_dtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Ftests%2Ftest_dtype.py?ref=be7161d3501a44b90eefe8ce974ff28278461f79",
"patch": "@@ -77,7 +77,7 @@ def test_downcast():\n with expected_warnings('Downcasting'):\n y = img_as_int(x)\n assert np.allclose(y, x.astype(np.int16))\n- assert y.dtype == np.uint16\n+ assert y.dtype == np.uint16, y.dtype\n \n \n def test_float_out_of_range():"
}
] |
scikit-image | f3965885e88e37ea95fcb61340ae5fc3542df1e8 | be7161d3501a44b90eefe8ce974ff28278461f79 | skimage/util/tests/test_dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -77,7 +77,7 @@ def test_downcast():
with expected_warnings('Downcasting'):
y = img_as_int(x)
assert np.allclose(y, x.astype(np.int16))
- assert y.dtype == np.uint16, y.dtype
+ assert y.dtype == np.int16, y.dtype
def test_float_out_of_range():
| assert y . dtype == np . uint16 , y . dtype | assert y . dtype == np . int16 , y . dtype | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:uint16", 3, 26, 3, 32], "int16"]] | matsuken92/scikit-image@f3965885e88e37ea95fcb61340ae5fc3542df1e8 | Fix failing test | [
{
"sha": "b8e775439eaf2707dd53f4bf843f9c33065538d5",
"filename": "skimage/util/tests/test_dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/f3965885e88e37ea95fcb61340ae5fc3542df1e8/skimage%2Futil%2Ftests%2Ftest_dtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/f3965885e88e37ea95fcb61340ae5fc3542df1e8/skimage%2Futil%2Ftests%2Ftest_dtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Ftests%2Ftest_dtype.py?ref=f3965885e88e37ea95fcb61340ae5fc3542df1e8",
"patch": "@@ -77,7 +77,7 @@ def test_downcast():\n with expected_warnings('Downcasting'):\n y = img_as_int(x)\n assert np.allclose(y, x.astype(np.int16))\n- assert y.dtype == np.uint16, y.dtype\n+ assert y.dtype == np.int16, y.dtype\n \n \n def test_float_out_of_range():"
}
] |
scikit-image | 49aa7cf999093019493568815edd985ed1bc9714 | d5819f664ab8bb14653915b4b5d99d5eb713359f | skimage/future/graph/rag.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -124,7 +124,7 @@ class RAG(nx.Graph):
function=_add_edge_filter,
footprint=fp,
mode='nearest',
- output=np.empty(labels_image.shape, dtype=np.uint8),
+ output=np.empty(label_image.shape, dtype=np.uint8),
extra_arguments=(self,))
try:
| output = np . empty ( labels_image . shape , dtype = np . uint8 ) , | output = np . empty ( label_image . shape , dtype = np . uint8 ) , | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:labels_image", 3, 33, 3, 45], "label_image"]] | matsuken92/scikit-image@49aa7cf999093019493568815edd985ed1bc9714 | Fix typo in variable name | [
{
"sha": "da5d860612da114f652274e0cfce1bc10a655ba5",
"filename": "skimage/future/graph/rag.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/49aa7cf999093019493568815edd985ed1bc9714/skimage%2Ffuture%2Fgraph%2Frag.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/49aa7cf999093019493568815edd985ed1bc9714/skimage%2Ffuture%2Fgraph%2Frag.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffuture%2Fgraph%2Frag.py?ref=49aa7cf999093019493568815edd985ed1bc9714",
"patch": "@@ -124,7 +124,7 @@ def __init__(self, label_image=None, connectivity=1, data=None, **attr):\n function=_add_edge_filter,\n footprint=fp,\n mode='nearest',\n- output=np.empty(labels_image.shape, dtype=np.uint8),\n+ output=np.empty(label_image.shape, dtype=np.uint8),\n extra_arguments=(self,))\n \n try:"
}
] |
scikit-image | 753c8caf4ee0f6d18dfd6b6722568979f1550735 | 79c9637e1124fadbcba56b84e5a675425ad1f6a5 | skimage/future/graph/rag.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -48,7 +48,7 @@ def _edge_generator_from_csr(csr_matrix):
col_indices = csr_matrix.indices
for i in range(nrows):
for j in range(indptr[i], indptr[i + 1]):
- yield i, col_indices[j], data[j]
+ yield i, col_indices[j], values[j]
def min_weight(graph, src, dst, n):
| yield i , col_indices [ j ] , data [ j ] | yield i , col_indices [ j ] , values [ j ] | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:data", 3, 38, 3, 42], "values"]] | matsuken92/scikit-image@753c8caf4ee0f6d18dfd6b6722568979f1550735 | correct variable name mistake | [
{
"sha": "739c3010d15478b188e8bed9a85d082f20154966",
"filename": "skimage/future/graph/rag.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/753c8caf4ee0f6d18dfd6b6722568979f1550735/skimage%2Ffuture%2Fgraph%2Frag.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/753c8caf4ee0f6d18dfd6b6722568979f1550735/skimage%2Ffuture%2Fgraph%2Frag.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffuture%2Fgraph%2Frag.py?ref=753c8caf4ee0f6d18dfd6b6722568979f1550735",
"patch": "@@ -48,7 +48,7 @@ def _edge_generator_from_csr(csr_matrix):\n col_indices = csr_matrix.indices\n for i in range(nrows):\n for j in range(indptr[i], indptr[i + 1]):\n- yield i, col_indices[j], data[j]\n+ yield i, col_indices[j], values[j]\n \n \n def min_weight(graph, src, dst, n):"
}
] |
scikit-image | acef02667620bb4b1137132c55120c5a03b575c8 | a8124166c1b0ee875a055b976529fe002ecaf4cc | skimage/measure/__init__.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -2,7 +2,7 @@ from ._find_contours import find_contours
from ._marching_cubes import (marching_cubes, mesh_surface_area,
correct_mesh_orientation)
from ._regionprops import regionprops, perimeter
-from ._simple_metrics import mse, nrmse, psnr
+from .simple_metrics import mse, nrmse, psnr
from ._structural_similarity import structural_similarity
from ._polygon import approximate_polygon, subdivide_polygon
from ._pnpoly import points_in_poly, grid_points_in_poly
| from . _simple_metrics import mse , nrmse , psnr | from . simple_metrics import mse , nrmse , psnr | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:_simple_metrics", 3, 7, 3, 22], "simple_metrics"]] | matsuken92/scikit-image@acef02667620bb4b1137132c55120c5a03b575c8 | fixed outdated import name _simple_metrics in __init__.py | [
{
"sha": "de865f9ea5a43d24e2cbbbc423021b64872c7067",
"filename": "skimage/measure/__init__.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/acef02667620bb4b1137132c55120c5a03b575c8/skimage%2Fmeasure%2F__init__.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/acef02667620bb4b1137132c55120c5a03b575c8/skimage%2Fmeasure%2F__init__.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fmeasure%2F__init__.py?ref=acef02667620bb4b1137132c55120c5a03b575c8",
"patch": "@@ -2,7 +2,7 @@\n from ._marching_cubes import (marching_cubes, mesh_surface_area,\n correct_mesh_orientation)\n from ._regionprops import regionprops, perimeter\n-from ._simple_metrics import mse, nrmse, psnr\n+from .simple_metrics import mse, nrmse, psnr\n from ._structural_similarity import structural_similarity\n from ._polygon import approximate_polygon, subdivide_polygon\n from ._pnpoly import points_in_poly, grid_points_in_poly"
}
] |
scikit-image | e74da89ede6f1e4d6100bc9885b312d00dd5ccad | 024c4328f20a5d4e98779259f9bc67126311e95d | skimage/feature/corner.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -610,7 +610,7 @@ def corner_fast(image, n=12, threshold=0.15):
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])
- >>> corner_peaks(corner_fast(square, 9), min_distance=1)
+ >>> corner_peaks(corner_fast(square, 9), min_distance=1, threshold_rel=0.1)
array([[3, 3],
[3, 8],
[8, 3],
| [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] ] ) >> > corner_peaks ( corner_fast ( square , 9 ) , min_distance = 1 ) | [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ] ] ) >> > corner_peaks ( corner_fast ( square , 9 ) , min_distance = 1 , threshold_rel = 0.1 ) | SAME_FUNCTION_MORE_ARGS | [["Insert", ["argument_list", 3, 21, 3, 61], [",:,", "T"], 4], ["Insert", ["argument_list", 3, 21, 3, 61], ["keyword_argument", "N0"], 5], ["Insert", "N0", ["identifier:threshold_rel", "T"], 0], ["Insert", "N0", ["=:=", "T"], 1], ["Insert", "N0", ["float:0.1", "T"], 2]] | matsuken92/scikit-image@e74da89ede6f1e4d6100bc9885b312d00dd5ccad | Fix corner_fast doctest | [
{
"sha": "fef9b046c9dbd03f4deeb0d9cc314513ab3ab5d3",
"filename": "skimage/feature/corner.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/e74da89ede6f1e4d6100bc9885b312d00dd5ccad/skimage%2Ffeature%2Fcorner.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/e74da89ede6f1e4d6100bc9885b312d00dd5ccad/skimage%2Ffeature%2Fcorner.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fcorner.py?ref=e74da89ede6f1e4d6100bc9885b312d00dd5ccad",
"patch": "@@ -610,7 +610,7 @@ def corner_fast(image, n=12, threshold=0.15):\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])\n- >>> corner_peaks(corner_fast(square, 9), min_distance=1)\n+ >>> corner_peaks(corner_fast(square, 9), min_distance=1, threshold_rel=0.1)\n array([[3, 3],\n [3, 8],\n [8, 3],"
}
] |
scikit-image | bbb427b9eab3e966c70c7142c1048c9fa9df6eb6 | e74da89ede6f1e4d6100bc9885b312d00dd5ccad | skimage/feature/peak.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -3,7 +3,7 @@ import scipy.ndimage as ndi
from ..filters import rank_order
-def peak_local_max(image, min_distance=1, threshold_abs=None,
+def peak_local_max(image, min_distance=1, threshold_abs=0,
threshold_rel=None, exclude_border=True, indices=True,
num_peaks=np.inf, footprint=None, labels=None):
| def peak_local_max ( image , min_distance = 1 , threshold_abs = None , threshold_rel = None , exclude_border = True , indices = True , num_peaks = np . inf , footprint = None , labels = None ) : | def peak_local_max ( image , min_distance = 1 , threshold_abs = 0 , threshold_rel = None , exclude_border = True , indices = True , num_peaks = np . inf , footprint = None , labels = None ) : | SINGLE_TOKEN | [["Insert", ["default_parameter", 3, 43, 3, 61], ["integer:0", "T"], 2], ["Delete", ["none:None", 3, 57, 3, 61]]] | matsuken92/scikit-image@bbb427b9eab3e966c70c7142c1048c9fa9df6eb6 | Fix peak_local_max doctest | [
{
"sha": "76f27a7632c17545e6a16c91565f942905c7485b",
"filename": "skimage/feature/peak.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/bbb427b9eab3e966c70c7142c1048c9fa9df6eb6/skimage%2Ffeature%2Fpeak.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/bbb427b9eab3e966c70c7142c1048c9fa9df6eb6/skimage%2Ffeature%2Fpeak.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Fpeak.py?ref=bbb427b9eab3e966c70c7142c1048c9fa9df6eb6",
"patch": "@@ -3,7 +3,7 @@\n from ..filters import rank_order\n \n \n-def peak_local_max(image, min_distance=1, threshold_abs=None,\n+def peak_local_max(image, min_distance=1, threshold_abs=0,\n threshold_rel=None, exclude_border=True, indices=True,\n num_peaks=np.inf, footprint=None, labels=None):\n \"\"\"Find peaks in an image as coordinate list or boolean mask."
}
] |
visbrain | 4fa582938b4faaf1fce1b42a6b497c3886205a85 | 8278e46e5e477b7103a8a154f78d8c51ebe61cf7 | visbrain/utils/sleep/detection.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -65,7 +65,7 @@ def spindlesdetect(data, sf, threshold, hypno, nrem_only, min_freq=12.,
hypLoaded = True if np.unique(hypno).size > 1 and nrem_only else False
if hypLoaded:
- data[(np.where(np.logical_or(hypno < 1, hypno == 4)))] = 0
+ data.copy()[(np.where(np.logical_or(hypno < 1, hypno == 4)))] = 0.
length = np.count_nonzero(data)
idx_zero = np.where(data == 0)[0]
else:
| data [ ( np . where ( np . logical_or ( hypno < 1 , hypno == 4 ) ) ) ] = 0 | data . copy ( ) [ ( np . where ( np . logical_or ( hypno < 1 , hypno == 4 ) ) ) ] = 0. | SINGLE_STMT | [["Insert", ["assignment", 3, 9, 3, 67], ["float:0.", "T"], 2], ["Insert", ["subscript", 3, 9, 3, 63], ["call", "N0"], 0], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Move", "N1", ["identifier:data", 3, 9, 3, 13], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:copy", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["):)", "T"], 1], ["Delete", ["integer:0", 3, 66, 3, 67]]] | kdeleeuw11/visbrain@4fa582938b4faaf1fce1b42a6b497c3886205a85 | Fix spindles for NREM only (need a data copy) | [
{
"sha": "28af65b7ca6037ba0cff0f909f433f2258e26d36",
"filename": "visbrain/utils/sleep/detection.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/4fa582938b4faaf1fce1b42a6b497c3886205a85/visbrain%2Futils%2Fsleep%2Fdetection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/4fa582938b4faaf1fce1b42a6b497c3886205a85/visbrain%2Futils%2Fsleep%2Fdetection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fsleep%2Fdetection.py?ref=4fa582938b4faaf1fce1b42a6b497c3886205a85",
"patch": "@@ -65,7 +65,7 @@ def spindlesdetect(data, sf, threshold, hypno, nrem_only, min_freq=12.,\n hypLoaded = True if np.unique(hypno).size > 1 and nrem_only else False\n \n if hypLoaded:\n- data[(np.where(np.logical_or(hypno < 1, hypno == 4)))] = 0\n+ data.copy()[(np.where(np.logical_or(hypno < 1, hypno == 4)))] = 0.\n length = np.count_nonzero(data)\n idx_zero = np.where(data == 0)[0]\n else:"
}
] |
visbrain | fc70ad5524678c587ef84c23abe7e21be02ecbbb | b35187080154511d5ec6d7bb028bfb25d860803f | visbrain/utils/sleep/detection.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -18,7 +18,7 @@ __all__ = ['peakdetect', 'remdetect', 'spindlesdetect']
def spindlesdetect(elec, sf, threshold, hypno, nrem_only, min_freq=12.,
max_freq=14., min_dur_ms=500, max_dur_ms=1500,
- method='hilbert'):
+ method='wavelet'):
| def spindlesdetect ( elec , sf , threshold , hypno , nrem_only , min_freq = 12. , max_freq = 14. , min_dur_ms = 500 , max_dur_ms = 1500 , method = 'hilbert' ) : | def spindlesdetect ( elec , sf , threshold , hypno , nrem_only , min_freq = 12. , max_freq = 14. , min_dur_ms = 500 , max_dur_ms = 1500 , method = 'wavelet' ) : | CHANGE_STRING_LITERAL | [["Update", ["string:'hilbert'", 3, 27, 3, 36], "'wavelet'"]] | kdeleeuw11/visbrain@fc70ad5524678c587ef84c23abe7e21be02ecbbb | Set wavelets as default spindles detection method | [
{
"sha": "2d37ec6b368f36cf050ab69f395b6402eeaa8e55",
"filename": "visbrain/utils/sleep/detection.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/fc70ad5524678c587ef84c23abe7e21be02ecbbb/visbrain%2Futils%2Fsleep%2Fdetection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/fc70ad5524678c587ef84c23abe7e21be02ecbbb/visbrain%2Futils%2Fsleep%2Fdetection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fsleep%2Fdetection.py?ref=fc70ad5524678c587ef84c23abe7e21be02ecbbb",
"patch": "@@ -18,7 +18,7 @@\n \n def spindlesdetect(elec, sf, threshold, hypno, nrem_only, min_freq=12.,\n max_freq=14., min_dur_ms=500, max_dur_ms=1500,\n- method='hilbert'):\n+ method='wavelet'):\n \"\"\"Perform a sleep spindles detection.\n \n Args:"
}
] |
visbrain | 72fd8b0574d13ea969cb2fe0c79d03b462e6de89 | c627c5f6d3fb5fb4e7545912a9e8e94ef5097b74 | examples/brain/5_DeepStructures.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -17,7 +17,7 @@ s_data = np.load('Px.npy').mean(1)
# Define a Brain instance :
vb = Brain(s_xyz=s_xyz, s_data=s_data, s_cmap='viridis')
# Rotate the brain in axial view :
-vb.rotate(fixed='axial')
+vb.rotate(fixed='axial_0')
# Select the thalamus index (77 for the left and 78 for the right). If you
# don't know what is the index of your ROI, open the GUI and look at the
# number in front of the name. Otherwise, use print(vb.get_ROI_list()) to print
| vb . rotate ( fixed = 'axial' ) | vb . rotate ( fixed = 'axial_0' ) | CHANGE_STRING_LITERAL | [["Update", ["string:'axial'", 3, 17, 3, 24], "'axial_0'"]] | kdeleeuw11/visbrain@72fd8b0574d13ea969cb2fe0c79d03b462e6de89 | Fix example 5 on deep structures | [
{
"sha": "0d85437939d5c143fc04845ca5f0211010bf8705",
"filename": "examples/brain/5_DeepStructures.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/72fd8b0574d13ea969cb2fe0c79d03b462e6de89/examples%2Fbrain%2F5_DeepStructures.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/72fd8b0574d13ea969cb2fe0c79d03b462e6de89/examples%2Fbrain%2F5_DeepStructures.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/examples%2Fbrain%2F5_DeepStructures.py?ref=72fd8b0574d13ea969cb2fe0c79d03b462e6de89",
"patch": "@@ -17,7 +17,7 @@\n # Define a Brain instance :\n vb = Brain(s_xyz=s_xyz, s_data=s_data, s_cmap='viridis')\n # Rotate the brain in axial view :\n-vb.rotate(fixed='axial')\n+vb.rotate(fixed='axial_0')\n # Select the thalamus index (77 for the left and 78 for the right). If you\n # don't know what is the index of your ROI, open the GUI and look at the\n # number in front of the name. Otherwise, use print(vb.get_ROI_list()) to print"
}
] |
visbrain | 89ba080bd26ae0f96b4fffd8773f9fa83e200d47 | 82f67f0a0b8014a4591490dd307a47f4a2778874 | visbrain/brain/base/transformations/SourcesTransform.py | https://github.com/kdeleeuw11/visbrain | true | false | false | @@ -456,7 +456,7 @@ class SourcesTransform(object):
self.atlas.mesh.set_color(data=cortmask)
elif self._tprojecton == 'roi':
# Apply general color to the brain :
- cortmask[nnz, 0:3] = self.area.color
+ cortmask[nnz, 0:3] = self.atlas.color
# cortmask[nnz, 0:3] = self.area.mesh.get_color[nnz, 0:3]
# Update mesh with cmap :
self.area.mesh.set_color(data=cortmask)
| self . area . color | self . atlas . color | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:area", 3, 39, 3, 43], "atlas"]] | kdeleeuw11/visbrain@89ba080bd26ae0f96b4fffd8773f9fa83e200d47 | Fix nnz area color | [
{
"sha": "8a28e10fa184c7cb9533ab23f006a11d796b3d99",
"filename": "visbrain/brain/base/transformations/SourcesTransform.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/89ba080bd26ae0f96b4fffd8773f9fa83e200d47/visbrain%2Fbrain%2Fbase%2Ftransformations%2FSourcesTransform.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/89ba080bd26ae0f96b4fffd8773f9fa83e200d47/visbrain%2Fbrain%2Fbase%2Ftransformations%2FSourcesTransform.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Fbase%2Ftransformations%2FSourcesTransform.py?ref=89ba080bd26ae0f96b4fffd8773f9fa83e200d47",
"patch": "@@ -456,7 +456,7 @@ def _array2cmap(self, x, non_zero=False, smask=None,\n self.atlas.mesh.set_color(data=cortmask)\n elif self._tprojecton == 'roi':\n # Apply general color to the brain :\n- cortmask[nnz, 0:3] = self.area.color\n+ cortmask[nnz, 0:3] = self.atlas.color\n # cortmask[nnz, 0:3] = self.area.mesh.get_color[nnz, 0:3]\n # Update mesh with cmap :\n self.area.mesh.set_color(data=cortmask)"
}
] |
visbrain | 63309491dd34ce198390d8d55c1f383cca7a633a | 20d5b25a391362a2345b4f5a0eeb47fbd8cde3cb | visbrain/sleep/interface/uiElements/uiDetection.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -235,7 +235,7 @@ class uiDetection(object):
# Set header label :
self._DetectLocHead.setText(kind + ' detection on channel ' + channel)
# Clean table :
- self._scoreTable.setRowCount(0)
+ self._DetectLocations.setRowCount(0)
if (kind in ['REM', 'Spindles']) and self._ToolRdSelected.isChecked():
# Define the length of the table:
self._DetectLocations.setRowCount(int(len(index) / 2))
| self . _scoreTable . setRowCount ( 0 ) | self . _DetectLocations . setRowCount ( 0 ) | CHANGE_ATTRIBUTE_USED | [["Update", ["identifier:_scoreTable", 3, 14, 3, 25], "_DetectLocations"]] | kdeleeuw11/visbrain@63309491dd34ce198390d8d55c1f383cca7a633a | Fix erasing scoring table on detection | [
{
"sha": "25962983c897e3204ddc864aff09d7edc433afbb",
"filename": "visbrain/sleep/interface/uiElements/uiDetection.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/63309491dd34ce198390d8d55c1f383cca7a633a/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/63309491dd34ce198390d8d55c1f383cca7a633a/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py?ref=63309491dd34ce198390d8d55c1f383cca7a633a",
"patch": "@@ -235,7 +235,7 @@ def _fcn_fillLocations(self, channel, kind, index, duration):\n # Set header label :\n self._DetectLocHead.setText(kind + ' detection on channel ' + channel)\n # Clean table :\n- self._scoreTable.setRowCount(0)\n+ self._DetectLocations.setRowCount(0)\n if (kind in ['REM', 'Spindles']) and self._ToolRdSelected.isChecked():\n # Define the length of the table:\n self._DetectLocations.setRowCount(int(len(index) / 2))"
}
] |
visbrain | a3aa5cabe517c9aba7f1183137a9acbdf1fee9da | ab56137c273b376ba9fc19811d3cd90b1b350ace | visbrain/brain/base/ConnectBase.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -225,7 +225,7 @@ class ConnectBase(_colormap):
color = np.array([])
index = np.arange(self.blinterp)
idx = np.c_[index[:-1], index[1:]].flatten()
- for num, k in enumerate(cut[1:]):
+ for num, k in enumerate(cut):
tckp, u = splprep(np.ndarray.tolist(k.T), k=2, s=0.)
y2 = np.array(splev(np.linspace(0, 1, self.blinterp), tckp)).T[idx]
pos = np.vstack((pos, y2)) if pos.size else y2
| for num , k in enumerate ( cut [ 1 : ] ) : tckp , u = splprep ( np . ndarray . tolist ( k . T ) , k = 2 , s = 0. ) y2 = np . array ( splev ( np . linspace ( 0 , 1 , self . blinterp ) , tckp ) ) . T [ idx ] pos = np . vstack ( ( pos , y2 ) ) if pos . size else y2 | for num , k in enumerate ( cut ) : tckp , u = splprep ( np . ndarray . tolist ( k . T ) , k = 2 , s = 0. ) y2 = np . array ( splev ( np . linspace ( 0 , 1 , self . blinterp ) , tckp ) ) . T [ idx ] pos = np . vstack ( ( pos , y2 ) ) if pos . size else y2 | SINGLE_STMT | [["Move", ["argument_list", 3, 32, 3, 41], ["identifier:cut", 3, 33, 3, 36], 1], ["Delete", ["[:[", 3, 36, 3, 37]], ["Delete", ["integer:1", 3, 37, 3, 38]], ["Delete", [":::", 3, 38, 3, 39]], ["Delete", ["slice", 3, 37, 3, 39]], ["Delete", ["]:]", 3, 39, 3, 40]], ["Delete", ["subscript", 3, 33, 3, 40]]] | kdeleeuw11/visbrain@a3aa5cabe517c9aba7f1183137a9acbdf1fee9da | Fix line coloring when bundle | [
{
"sha": "7db9299f09288e9ec3cddf392ff8e2ccac062989",
"filename": "visbrain/brain/base/ConnectBase.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/a3aa5cabe517c9aba7f1183137a9acbdf1fee9da/visbrain%2Fbrain%2Fbase%2FConnectBase.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/a3aa5cabe517c9aba7f1183137a9acbdf1fee9da/visbrain%2Fbrain%2Fbase%2FConnectBase.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fbrain%2Fbase%2FConnectBase.py?ref=a3aa5cabe517c9aba7f1183137a9acbdf1fee9da",
"patch": "@@ -225,7 +225,7 @@ def bundling(self):\n color = np.array([])\n index = np.arange(self.blinterp)\n idx = np.c_[index[:-1], index[1:]].flatten()\n- for num, k in enumerate(cut[1:]):\n+ for num, k in enumerate(cut):\n tckp, u = splprep(np.ndarray.tolist(k.T), k=2, s=0.)\n y2 = np.array(splev(np.linspace(0, 1, self.blinterp), tckp)).T[idx]\n pos = np.vstack((pos, y2)) if pos.size else y2"
}
] |
visbrain | 1f8da08ff6a00c9dfe1c3fc6551ca03e44c67638 | 06a810822efe4f12421387691c42aab74e445ec3 | visbrain/sleep/sleep.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -61,7 +61,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):
def __init__(self, file=None, hypno_file=None, data=None, channels=None,
- sf=None, hypno=None, downsample=1000., axis=False, line='gl'):
+ sf=None, hypno=None, downsample=100., axis=False, line='gl'):
"""Init."""
# ====================== APP CREATION ======================
# Create the app and initialize all graphical elements :
| def __init__ ( self , file = None , hypno_file = None , data = None , channels = None , sf = None , hypno = None , downsample = 1000. , axis = False , line = 'gl' ) : """Init.""" | def __init__ ( self , file = None , hypno_file = None , data = None , channels = None , sf = None , hypno = None , downsample = 100. , axis = False , line = 'gl' ) : """Init.""" | CHANGE_NUMERIC_LITERAL | [["Update", ["float:1000.", 2, 50, 2, 55], "100."]] | kdeleeuw11/visbrain@1f8da08ff6a00c9dfe1c3fc6551ca03e44c67638 | Set default ds back to 100. | [
{
"sha": "f4f06ba97ee09425177b7ed402cb663c68b05856",
"filename": "visbrain/sleep/sleep.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/1f8da08ff6a00c9dfe1c3fc6551ca03e44c67638/visbrain%2Fsleep%2Fsleep.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/1f8da08ff6a00c9dfe1c3fc6551ca03e44c67638/visbrain%2Fsleep%2Fsleep.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Fsleep.py?ref=1f8da08ff6a00c9dfe1c3fc6551ca03e44c67638",
"patch": "@@ -61,7 +61,7 @@ class Sleep(uiInit, visuals, uiElements, Tools):\n \"\"\"\n \n def __init__(self, file=None, hypno_file=None, data=None, channels=None,\n- sf=None, hypno=None, downsample=1000., axis=False, line='gl'):\n+ sf=None, hypno=None, downsample=100., axis=False, line='gl'):\n \"\"\"Init.\"\"\"\n # ====================== APP CREATION ======================\n # Create the app and initialize all graphical elements :"
}
] |
visbrain | 3f7c338fc816a09930bd746b099c2cb34bcb9222 | 3a32f6401f56b5fb94011b9fad7f2df1fc455027 | visbrain/sleep/interface/uiElements/uiScoring.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -168,7 +168,7 @@ class uiScoring(object):
path = QtGui.QFileDialog.getSaveFileName(
self, "Save File", "scoring_info",
filter=selected_ext)
- if filename:
+ if path:
file = os.path.splitext(str(path))[0]
if selected_ext.find('csv') + 1:
listToCsv(file + '.csv', zip(staInd, endInd, stage))
| if filename : file = os . path . splitext ( str ( path ) ) [ 0 ] if selected_ext . find ( 'csv' ) + 1 : listToCsv ( file + '.csv' , zip ( staInd , endInd , stage ) ) | if path : file = os . path . splitext ( str ( path ) ) [ 0 ] if selected_ext . find ( 'csv' ) + 1 : listToCsv ( file + '.csv' , zip ( staInd , endInd , stage ) ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:filename", 3, 12, 3, 20], "path"]] | kdeleeuw11/visbrain@3f7c338fc816a09930bd746b099c2cb34bcb9222 | Fix uiScoring exportation name | [
{
"sha": "50034388b06e8061b5433e0ed751cc32fbb007fc",
"filename": "visbrain/sleep/interface/uiElements/uiScoring.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/3f7c338fc816a09930bd746b099c2cb34bcb9222/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiScoring.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/3f7c338fc816a09930bd746b099c2cb34bcb9222/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiScoring.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiScoring.py?ref=3f7c338fc816a09930bd746b099c2cb34bcb9222",
"patch": "@@ -168,7 +168,7 @@ def _fcn_exportScore(self):\n path = QtGui.QFileDialog.getSaveFileName(\n self, \"Save File\", \"scoring_info\",\n filter=selected_ext)\n- if filename:\n+ if path:\n file = os.path.splitext(str(path))[0]\n if selected_ext.find('csv') + 1:\n listToCsv(file + '.csv', zip(staInd, endInd, stage))"
}
] |
visbrain | 785ce45f27fe24940ad1bb11a3d0bab83beff17b | d00f86af60f0cb895535f777304e9264cbaf4695 | visbrain/sleep/interface/uiElements/uiSettings.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -228,7 +228,7 @@ class uiSettings(object):
self._SlVal.setMinimum(self._time.min())
# Set maximum :
step = self._SigSlStep.value()
- self._SlVal.setMaximum((self._time.max() - win)/step)
+ self._SlVal.setMaximum(((self._time.max() - win)/step) + 1)
self._SlVal.setTickInterval(step)
self._SlVal.setSingleStep(step)
self._SlGoto.setMaximum((self._time.max() - win))
| self . _SlVal . setMaximum ( ( self . _time . max ( ) - win ) / step ) | self . _SlVal . setMaximum ( ( ( self . _time . max ( ) - win ) / step ) + 1 ) | SINGLE_STMT | [["Insert", ["binary_operator", 3, 32, 3, 61], ["parenthesized_expression", "N0"], 0], ["Insert", ["binary_operator", 3, 32, 3, 61], ["+:+", "T"], 1], ["Insert", ["binary_operator", 3, 32, 3, 61], ["integer:1", "T"], 2], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["binary_operator", 3, 32, 3, 61], 1], ["Insert", "N0", ["):)", "T"], 2]] | kdeleeuw11/visbrain@785ce45f27fe24940ad1bb11a3d0bab83beff17b | Fix last window on slider | [
{
"sha": "09a6b63baf7c81ec667d7eaff7e48d509d034f80",
"filename": "visbrain/sleep/interface/uiElements/uiSettings.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/785ce45f27fe24940ad1bb11a3d0bab83beff17b/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiSettings.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/785ce45f27fe24940ad1bb11a3d0bab83beff17b/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiSettings.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiSettings.py?ref=785ce45f27fe24940ad1bb11a3d0bab83beff17b",
"patch": "@@ -228,7 +228,7 @@ def _fcn_sliderSettings(self):\n self._SlVal.setMinimum(self._time.min())\n # Set maximum :\n step = self._SigSlStep.value()\n- self._SlVal.setMaximum((self._time.max() - win)/step)\n+ self._SlVal.setMaximum(((self._time.max() - win)/step) + 1)\n self._SlVal.setTickInterval(step)\n self._SlVal.setSingleStep(step)\n self._SlGoto.setMaximum((self._time.max() - win))"
}
] |
visbrain | 4bc46aab35b0b94941ed3603e7105878da9ab8ea | 9a386e41c9b5ea25b56c5dbad2e8cc73e6bd413a | visbrain/sleep/interface/uiElements/uiDetection.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -352,7 +352,7 @@ class uiDetection(object):
path = QtGui.QFileDialog.getSaveFileName(
self, "Save File", method + "_locinfo",
filter=selected_ext)
- if filename:
+ if path:
file = os.path.splitext(str(path))[0]
if selected_ext.find('csv') + 1:
listToCsv(file + '.csv', zip(staInd, duration, stage))
| if filename : file = os . path . splitext ( str ( path ) ) [ 0 ] if selected_ext . find ( 'csv' ) + 1 : listToCsv ( file + '.csv' , zip ( staInd , duration , stage ) ) | if path : file = os . path . splitext ( str ( path ) ) [ 0 ] if selected_ext . find ( 'csv' ) + 1 : listToCsv ( file + '.csv' , zip ( staInd , duration , stage ) ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:filename", 3, 12, 3, 20], "path"]] | kdeleeuw11/visbrain@4bc46aab35b0b94941ed3603e7105878da9ab8ea | Fix locations export name (filename doesn't exist) | [
{
"sha": "8bc6757fa3d1ad78db200fb3be5a1ea6041e945b",
"filename": "visbrain/sleep/interface/uiElements/uiDetection.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/4bc46aab35b0b94941ed3603e7105878da9ab8ea/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/4bc46aab35b0b94941ed3603e7105878da9ab8ea/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py?ref=4bc46aab35b0b94941ed3603e7105878da9ab8ea",
"patch": "@@ -352,7 +352,7 @@ def _fcn_exportLocation(self):\n path = QtGui.QFileDialog.getSaveFileName(\n self, \"Save File\", method + \"_locinfo\",\n filter=selected_ext)\n- if filename:\n+ if path:\n file = os.path.splitext(str(path))[0]\n if selected_ext.find('csv') + 1:\n listToCsv(file + '.csv', zip(staInd, duration, stage))"
}
] |
visbrain | b78018c86a8143a38fa6533c92e8e1d9db64514c | 4bc46aab35b0b94941ed3603e7105878da9ab8ea | visbrain/utils/sleep/event.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -38,7 +38,7 @@ def _events_duration(index, sf):
idx_start = np.hstack([np.array([0]), np.where(bool_break)[0] + 1])
idx_stop = np.hstack((idx_start[1::], len(index)-1))
# Compute duration :
- duration_ms = np.diff(idx_start) * (1000. / sf)
+ duration_ms = np.diff(np.hstack((idx_start, idx_stop[-1]))) * (1000. / sf)
return number, duration_ms, idx_start, idx_stop
| duration_ms = np . diff ( idx_start ) * ( 1000. / sf ) | duration_ms = np . diff ( np . hstack ( ( idx_start , idx_stop [ - 1 ] ) ) ) * ( 1000. / sf ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 26, 3, 37], ["call", "N0"], 1], ["Insert", ["argument_list", 3, 26, 3, 37], ["):)", "T"], 2], ["Insert", "N0", ["attribute", "N1"], 0], ["Insert", "N0", ["argument_list", "N2"], 1], ["Insert", "N1", ["identifier:np", "T"], 0], ["Insert", "N1", [".:.", "T"], 1], ["Insert", "N1", ["identifier:hstack", "T"], 2], ["Insert", "N2", ["(:(", "T"], 0], ["Insert", "N2", ["tuple", "N3"], 1], ["Insert", "N2", ["):)", "T"], 2], ["Insert", "N3", ["(:(", "T"], 0], ["Move", "N3", ["identifier:idx_start", 3, 27, 3, 36], 1], ["Insert", "N3", [",:,", "T"], 2], ["Insert", "N3", ["subscript", "N4"], 3], ["Move", "N3", ["):)", 3, 36, 3, 37], 4], ["Insert", "N4", ["identifier:idx_stop", "T"], 0], ["Insert", "N4", ["[:[", "T"], 1], ["Insert", "N4", ["unary_operator", "N5"], 2], ["Insert", "N4", ["]:]", "T"], 3], ["Insert", "N5", ["-:-", "T"], 0], ["Insert", "N5", ["integer:1", "T"], 1]] | kdeleeuw11/visbrain@b78018c86a8143a38fa6533c92e8e1d9db64514c | Fix missing last event in duration computation | [
{
"sha": "e63c9cd75542f98df12588473c2bedf9852c8b11",
"filename": "visbrain/utils/sleep/event.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/b78018c86a8143a38fa6533c92e8e1d9db64514c/visbrain%2Futils%2Fsleep%2Fevent.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/b78018c86a8143a38fa6533c92e8e1d9db64514c/visbrain%2Futils%2Fsleep%2Fevent.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Futils%2Fsleep%2Fevent.py?ref=b78018c86a8143a38fa6533c92e8e1d9db64514c",
"patch": "@@ -38,7 +38,7 @@ def _events_duration(index, sf):\n idx_start = np.hstack([np.array([0]), np.where(bool_break)[0] + 1])\n idx_stop = np.hstack((idx_start[1::], len(index)-1))\n # Compute duration :\n- duration_ms = np.diff(idx_start) * (1000. / sf)\n+ duration_ms = np.diff(np.hstack((idx_start, idx_stop[-1]))) * (1000. / sf)\n \n return number, duration_ms, idx_start, idx_stop\n "
}
] |
visbrain | 1fa9ca40eb63be059b7e0f0f04ce502d24fead01 | a55f06b12c06ebd8c6119681d2968b20f2657561 | visbrain/sleep/interface/uiElements/uiDetection.py | https://github.com/kdeleeuw11/visbrain | true | false | true | @@ -352,7 +352,7 @@ class uiDetection(object):
path = QtGui.QFileDialog.getSaveFileName(
self, "Save File", method + "_locinfo",
filter=selected_ext)
- if filename:
+ if path:
file = os.path.splitext(str(path))[0]
if selected_ext.find('csv') + 1:
listToCsv(file + '.csv', zip(staInd, duration, stage))
| if filename : file = os . path . splitext ( str ( path ) ) [ 0 ] if selected_ext . find ( 'csv' ) + 1 : listToCsv ( file + '.csv' , zip ( staInd , duration , stage ) ) | if path : file = os . path . splitext ( str ( path ) ) [ 0 ] if selected_ext . find ( 'csv' ) + 1 : listToCsv ( file + '.csv' , zip ( staInd , duration , stage ) ) | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:filename", 3, 12, 3, 20], "path"]] | kdeleeuw11/visbrain@1fa9ca40eb63be059b7e0f0f04ce502d24fead01 | Fix again exportation (too much ctrl z...) | [
{
"sha": "f8600fb4f29c8ffede3d1a73410772364e04cb49",
"filename": "visbrain/sleep/interface/uiElements/uiDetection.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kdeleeuw11/visbrain/blob/1fa9ca40eb63be059b7e0f0f04ce502d24fead01/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py",
"raw_url": "https://github.com/kdeleeuw11/visbrain/raw/1fa9ca40eb63be059b7e0f0f04ce502d24fead01/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py",
"contents_url": "https://api.github.com/repos/kdeleeuw11/visbrain/contents/visbrain%2Fsleep%2Finterface%2FuiElements%2FuiDetection.py?ref=1fa9ca40eb63be059b7e0f0f04ce502d24fead01",
"patch": "@@ -352,7 +352,7 @@ def _fcn_exportLocation(self):\n path = QtGui.QFileDialog.getSaveFileName(\n self, \"Save File\", method + \"_locinfo\",\n filter=selected_ext)\n- if filename:\n+ if path:\n file = os.path.splitext(str(path))[0]\n if selected_ext.find('csv') + 1:\n listToCsv(file + '.csv', zip(staInd, duration, stage))"
}
] |
MySmallTrip | 67a351c0836932060d2b20cc16bb94c403b8c98e | 7c712d5b55e4c81f01ae42dde79dbc1d85891f8c | app/travel/serializer/travel_serializer_detail_calender.py | https://github.com/kahee/MySmallTrip | true | false | true | @@ -20,7 +20,7 @@ class TravelInformationScheduleSerializer(serializers.ModelSerializer):
reserved_people = attrs.reserved_people
reserve_people = self.context['people']
- if maxPeople < reserve_people + reserved_people:
+ if maxPeople <= reserve_people + reserved_people:
return False
else:
return True
| if maxPeople < reserve_people + reserved_people : return False else : return True | if maxPeople <= reserve_people + reserved_people : return False else : return True | CHANGE_BINARY_OPERATOR | [["Insert", ["comparison_operator", 3, 12, 3, 56], ["<=:<=", "T"], 1], ["Delete", ["<:<", 3, 22, 3, 23]]] | kahee/MySmallTrip@67a351c0836932060d2b20cc16bb94c403b8c98e | bug fix | [
{
"sha": "520c80422ab2031b046967110fea5f8e0ccf3a69",
"filename": "app/travel/serializer/travel_serializer_detail_calender.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/kahee/MySmallTrip/blob/67a351c0836932060d2b20cc16bb94c403b8c98e/app%2Ftravel%2Fserializer%2Ftravel_serializer_detail_calender.py",
"raw_url": "https://github.com/kahee/MySmallTrip/raw/67a351c0836932060d2b20cc16bb94c403b8c98e/app%2Ftravel%2Fserializer%2Ftravel_serializer_detail_calender.py",
"contents_url": "https://api.github.com/repos/kahee/MySmallTrip/contents/app%2Ftravel%2Fserializer%2Ftravel_serializer_detail_calender.py?ref=67a351c0836932060d2b20cc16bb94c403b8c98e",
"patch": "@@ -20,7 +20,7 @@ def get_is_possible(self, attrs):\n reserved_people = attrs.reserved_people\n reserve_people = self.context['people']\n \n- if maxPeople < reserve_people + reserved_people:\n+ if maxPeople <= reserve_people + reserved_people:\n return False\n else:\n return True"
}
] |
scikit-image | 2608816885866a264d4b9c3e574a87a1deee54b2 | bd89d6df442cf69dc780cf19f80fa56fb8110f6b | skimage/filters/rank/tests/test_rank.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -98,7 +98,7 @@ class TestRank():
# make sure the size is not a problem
elem = np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]], dtype=np.uint8)
- for m, n in np.random.random_integers(1, 100, size=(10, 2)):
+ for m, n in np.random.randint(1, 101, size=(10, 2)):
mask = np.ones((m, n), dtype=np.uint8)
image8 = np.ones((m, n), dtype=np.uint8)
| for m , n in np . random . random_integers ( 1 , 100 , size = ( 10 , 2 ) ) : mask = np . ones ( ( m , n ) , dtype = np . uint8 ) image8 = np . ones ( ( m , n ) , dtype = np . uint8 ) | for m , n in np . random . randint ( 1 , 101 , size = ( 10 , 2 ) ) : mask = np . ones ( ( m , n ) , dtype = np . uint8 ) image8 = np . ones ( ( m , n ) , dtype = np . uint8 ) | SINGLE_STMT | [["Update", ["identifier:random_integers", 3, 31, 3, 46], "randint"], ["Update", ["integer:100", 3, 50, 3, 53], "101"]] | matsuken92/scikit-image@2608816885866a264d4b9c3e574a87a1deee54b2 | MAINT: Fix numpy deprecation | [
{
"sha": "6686f15eb079a8f28a68f1c5380d7274b51efd38",
"filename": "skimage/filters/rank/tests/test_rank.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/2608816885866a264d4b9c3e574a87a1deee54b2/skimage%2Ffilters%2Frank%2Ftests%2Ftest_rank.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/2608816885866a264d4b9c3e574a87a1deee54b2/skimage%2Ffilters%2Frank%2Ftests%2Ftest_rank.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilters%2Frank%2Ftests%2Ftest_rank.py?ref=2608816885866a264d4b9c3e574a87a1deee54b2",
"patch": "@@ -98,7 +98,7 @@ def test_random_sizes(self):\n # make sure the size is not a problem\n \n elem = np.array([[1, 1, 1], [1, 1, 1], [1, 1, 1]], dtype=np.uint8)\n- for m, n in np.random.random_integers(1, 100, size=(10, 2)):\n+ for m, n in np.random.randint(1, 101, size=(10, 2)):\n mask = np.ones((m, n), dtype=np.uint8)\n \n image8 = np.ones((m, n), dtype=np.uint8)"
}
] |
scikit-image | 6d8c8544b5caacff6d14efa3c85250549b8d4c55 | 43c46a7a87b505ab1efd27433397dfd4f82a839a | skimage/feature/tests/test_corner.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -60,7 +60,7 @@ def test_hessian_matrix():
[0, 0, 0, 0, 0],
[0, 0, 2, 0, 0]]))
- matrix2d = np.random.rand((3,3))
+ matrix2d = np.random.rand(3,3)
Arr, Arc, Acc = hessian_matrix(matrix2d, sigma=0.1)
assert_warns(Warning, hessian_matrix, matrix2d, sigma=0.1)
| matrix2d = np . random . rand ( ( 3 , 3 ) ) | matrix2d = np . random . rand ( 3 , 3 ) | SINGLE_STMT | [["Insert", ["argument_list", 3, 30, 3, 37], ["integer:3", "T"], 1], ["Move", ["argument_list", 3, 30, 3, 37], [",:,", 3, 33, 3, 34], 2], ["Move", ["argument_list", 3, 30, 3, 37], ["integer:3", 3, 32, 3, 33], 3], ["Move", ["argument_list", 3, 30, 3, 37], ["):)", 3, 35, 3, 36], 4], ["Delete", ["(:(", 3, 31, 3, 32]], ["Delete", ["integer:3", 3, 34, 3, 35]], ["Delete", ["tuple", 3, 31, 3, 36]], ["Delete", ["):)", 3, 36, 3, 37]]] | matsuken92/scikit-image@6d8c8544b5caacff6d14efa3c85250549b8d4c55 | got rid of bug in functional call of np.random.rand to generate a test matrix | [
{
"sha": "57f6bc8f54efc2e36f37b4b7f28e7a70b7dbe8d1",
"filename": "skimage/feature/tests/test_corner.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/6d8c8544b5caacff6d14efa3c85250549b8d4c55/skimage%2Ffeature%2Ftests%2Ftest_corner.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/6d8c8544b5caacff6d14efa3c85250549b8d4c55/skimage%2Ffeature%2Ftests%2Ftest_corner.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffeature%2Ftests%2Ftest_corner.py?ref=6d8c8544b5caacff6d14efa3c85250549b8d4c55",
"patch": "@@ -60,7 +60,7 @@ def test_hessian_matrix():\n [0, 0, 0, 0, 0],\n [0, 0, 2, 0, 0]]))\n \n- matrix2d = np.random.rand((3,3))\n+ matrix2d = np.random.rand(3,3)\n Arr, Arc, Acc = hessian_matrix(matrix2d, sigma=0.1)\n assert_warns(Warning, hessian_matrix, matrix2d, sigma=0.1)\n "
}
] |
scikit-image | 38870086e46fef81d545e3b4151f18e406ad34a5 | 66743dc3c344b0f3c8bc60fd45d49ea465fe0784 | skimage/io/_plugins/pil_plugin.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -250,7 +250,7 @@ def imsave(fname, arr, format_str=None, **kwargs):
arr = arr.astype(np.uint8)
if arr.ndim not in (2, 3):
- raise ValueError("Invalid shape for image array: %s" % arr.shape)
+ raise ValueError("Invalid shape for image array: %s" % (arr.shape, ))
if arr.ndim == 3:
if arr.shape[2] not in (3, 4):
| raise ValueError ( "Invalid shape for image array: %s" % arr . shape ) | raise ValueError ( "Invalid shape for image array: %s" % ( arr . shape , ) ) | CHANGE_BINARY_OPERAND | [["Insert", ["binary_operator", 3, 26, 3, 73], ["tuple", "N0"], 2], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["attribute", 3, 64, 3, 73], 1], ["Insert", "N0", [",:,", "T"], 2], ["Insert", "N0", ["):)", "T"], 3]] | matsuken92/scikit-image@38870086e46fef81d545e3b4151f18e406ad34a5 | Fix display problem when printing error messages | [
{
"sha": "ee0bb94ba7018b0642e2f6dd47456bce4b344dca",
"filename": "skimage/io/_plugins/pil_plugin.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/38870086e46fef81d545e3b4151f18e406ad34a5/skimage%2Fio%2F_plugins%2Fpil_plugin.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/38870086e46fef81d545e3b4151f18e406ad34a5/skimage%2Fio%2F_plugins%2Fpil_plugin.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Fio%2F_plugins%2Fpil_plugin.py?ref=38870086e46fef81d545e3b4151f18e406ad34a5",
"patch": "@@ -250,7 +250,7 @@ def imsave(fname, arr, format_str=None, **kwargs):\n arr = arr.astype(np.uint8)\n \n if arr.ndim not in (2, 3):\n- raise ValueError(\"Invalid shape for image array: %s\" % arr.shape)\n+ raise ValueError(\"Invalid shape for image array: %s\" % (arr.shape, ))\n \n if arr.ndim == 3:\n if arr.shape[2] not in (3, 4):"
}
] |
scikit-image | 2212522a7ca79a8a9dc089392e632195dec04b1f | 9d7fcca030e224b74826680d29dda3e4fed75002 | doc/source/conf.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -274,7 +274,7 @@ latex_preamble = r'''
#latex_appendices = []
# If false, no module index is generated.
-latex_use_modindex = False
+latex_domain_indices = False
# -----------------------------------------------------------------------------
# Numpy extensions
| latex_use_modindex = False | latex_domain_indices = False | CHANGE_IDENTIFIER_USED | [["Update", ["identifier:latex_use_modindex", 3, 1, 3, 19], "latex_domain_indices"]] | matsuken92/scikit-image@2212522a7ca79a8a9dc089392e632195dec04b1f | Fix deprecated option | [
{
"sha": "c90c6462810daac17e5ba03e49fdb4900d849af8",
"filename": "doc/source/conf.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/2212522a7ca79a8a9dc089392e632195dec04b1f/doc%2Fsource%2Fconf.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/2212522a7ca79a8a9dc089392e632195dec04b1f/doc%2Fsource%2Fconf.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/doc%2Fsource%2Fconf.py?ref=2212522a7ca79a8a9dc089392e632195dec04b1f",
"patch": "@@ -274,7 +274,7 @@\n #latex_appendices = []\n \n # If false, no module index is generated.\n-latex_use_modindex = False\n+latex_domain_indices = False\n \n # -----------------------------------------------------------------------------\n # Numpy extensions"
}
] |
scikit-image | 00d9947509f49678577e1cc0acf35458796cf935 | 412a342ebcdf0b42117fea1a0fbff33ca93953ff | skimage/filters/rank/generic.py | https://github.com/matsuken92/scikit-image | true | false | false | @@ -1040,7 +1040,7 @@ def windowed_histogram(image, selem, out=None, mask=None,
if n_bins is None:
- n_bins = image.max() + 1
+ n_bins = int(image.max()) + 1
return _apply_vector_per_pixel(generic_cy._windowed_hist, image, selem,
out=out, mask=mask,
| n_bins = image . max ( ) + 1 | n_bins = int ( image . max ( ) ) + 1 | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 2, 18, 2, 29], ["identifier:int", "T"], 0], ["Insert", ["call", 2, 18, 2, 29], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["call", 2, 18, 2, 29], 1], ["Insert", "N0", ["):)", "T"], 2]] | matsuken92/scikit-image@00d9947509f49678577e1cc0acf35458796cf935 | Fix shape type for histogram
The number of bins is always an integer, independently of the image data type. This fixes a build problem with numpy 1.12, [in Debian](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=848112#40):
``
`======================================================================
ERROR: skimage.filters.rank.tests.test_rank.test_all
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/build/skimage-0.12.3/debian/tmp/usr/lib/python2.7/dist-packages/skimage/filters/rank/tests/test_rank.py", line 16, in test_all
check_all()
File "/build/skimage-0.12.3/debian/tmp/usr/lib/python2.7/dist-packages/skimage/_shared/testing.py", line 232, in inner
result = func(*args, **kwargs)
File "/build/skimage-0.12.3/debian/tmp/usr/lib/python2.7/dist-packages/skimage/filters/rank/tests/test_rank.py", line 89, in check_all
rank.windowed_histogram(image, selem))
File "/build/skimage-0.12.3/debian/tmp/usr/lib/python2.7/dist-packages/skimage/filters/rank/generic.py", line 986, in windowed_histogram
pixel_size=n_bins)
File "/build/skimage-0.12.3/debian/tmp/usr/lib/python2.7/dist-packages/skimage/filters/rank/generic.py", line 90, in _apply_vector_per_pixel
pixel_size=pixel_size)
File "/build/skimage-0.12.3/debian/tmp/usr/lib/python2.7/dist-packages/skimage/filters/rank/generic.py", line 53, in _handle_input
out = np.empty(image.shape+(pixel_size,), dtype=out_dtype)
TypeError: 'numpy.float64' object cannot be interpreted as an index
----------------------------------------------------------------------
Ran 1383 tests in 181.697s
FAILED (SKIP=54, errors=1)
``` | [
{
"sha": "cdba1cebfe529a2983d8ea745b6b930c91b49a3b",
"filename": "skimage/filters/rank/generic.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/00d9947509f49678577e1cc0acf35458796cf935/skimage%2Ffilters%2Frank%2Fgeneric.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/00d9947509f49678577e1cc0acf35458796cf935/skimage%2Ffilters%2Frank%2Fgeneric.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Ffilters%2Frank%2Fgeneric.py?ref=00d9947509f49678577e1cc0acf35458796cf935",
"patch": "@@ -1040,7 +1040,7 @@ def windowed_histogram(image, selem, out=None, mask=None,\n \"\"\"\n \n if n_bins is None:\n- n_bins = image.max() + 1\n+ n_bins = int(image.max()) + 1\n \n return _apply_vector_per_pixel(generic_cy._windowed_hist, image, selem,\n out=out, mask=mask,"
}
] |
scikit-image | 86af2e6321aaa99830bc79b5c3372a62b271cbaa | 261d5f77eb99cd999620382a046b9158966daa3b | skimage/util/dtype.py | https://github.com/matsuken92/scikit-image | true | false | true | @@ -123,7 +123,7 @@ def convert(image, dtype, force_copy=False, uniform=False):
def _dtype_itemsize(itemsize, *dtypes):
# Return first of `dtypes` with itemsize greater than `itemsize`
- return next(dt for dt in dtypes if itemsize < np.dtype(dt).itemsize)
+ return next(dt for dt in dtypes if np.dtype(dt).itemsize >= itemsize)
def _dtype_bits(kind, bits, itemsize=1):
# Return dtype of `kind` that can store a `bits` wide unsigned int
| return next ( dt for dt in dtypes if itemsize < np . dtype ( dt ) . itemsize ) | return next ( dt for dt in dtypes if np . dtype ( dt ) . itemsize >= itemsize ) | SINGLE_STMT | [["Insert", ["comparison_operator", 3, 44, 3, 76], [">=:>=", "T"], 2], ["Insert", ["comparison_operator", 3, 44, 3, 76], ["identifier:itemsize", "T"], 3], ["Delete", ["identifier:itemsize", 3, 44, 3, 52]], ["Delete", ["<:<", 3, 53, 3, 54]]] | matsuken92/scikit-image@86af2e6321aaa99830bc79b5c3372a62b271cbaa | Fix bug in int64 to float64 conversion | [
{
"sha": "0859c7024f2a079019966408f565465d9600e806",
"filename": "skimage/util/dtype.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/scikit-image/blob/86af2e6321aaa99830bc79b5c3372a62b271cbaa/skimage%2Futil%2Fdtype.py",
"raw_url": "https://github.com/matsuken92/scikit-image/raw/86af2e6321aaa99830bc79b5c3372a62b271cbaa/skimage%2Futil%2Fdtype.py",
"contents_url": "https://api.github.com/repos/matsuken92/scikit-image/contents/skimage%2Futil%2Fdtype.py?ref=86af2e6321aaa99830bc79b5c3372a62b271cbaa",
"patch": "@@ -123,7 +123,7 @@ def prec_loss():\n \n def _dtype_itemsize(itemsize, *dtypes):\n # Return first of `dtypes` with itemsize greater than `itemsize`\n- return next(dt for dt in dtypes if itemsize < np.dtype(dt).itemsize)\n+ return next(dt for dt in dtypes if np.dtype(dt).itemsize >= itemsize)\n \n def _dtype_bits(kind, bits, itemsize=1):\n # Return dtype of `kind` that can store a `bits` wide unsigned int"
}
] |
folium | 70d7f5c7a409a6081a35ed547e7b9a10c032ff5c | 488a4642160416f06d3a4ee2e4859643649866e1 | folium/folium.py | https://github.com/matsuken92/folium | true | false | false | @@ -570,7 +570,7 @@ class Map(object):
self.template_vars.setdefault('map_legends', []).append(legend)
#Style with color brewer colors
- matchColor = 'matchKey({0}, {1})'.format(key_on, data_var)
+ matchColor = 'color(matchKey({0}, {1}))'.format(key_on, data_var)
style = json_style(style_count, line_color, line_weight,
line_opacity, None, fill_opacity, matchColor)
else:
| matchColor = 'matchKey({0}, {1})' . format ( key_on , data_var ) | matchColor = 'color(matchKey({0}, {1}))' . format ( key_on , data_var ) | CHANGE_STRING_LITERAL | [["Update", ["string:'matchKey({0}, {1})'", 3, 26, 3, 46], "'color(matchKey({0}, {1}))'"]] | matsuken92/folium@70d7f5c7a409a6081a35ed547e7b9a10c032ff5c | Reverted change to mathchColor in attempt to fix bug. | [
{
"sha": "ceabbc6366327f22c29decb06b8be9289b1bd438",
"filename": "folium/folium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/70d7f5c7a409a6081a35ed547e7b9a10c032ff5c/folium%2Ffolium.py",
"raw_url": "https://github.com/matsuken92/folium/raw/70d7f5c7a409a6081a35ed547e7b9a10c032ff5c/folium%2Ffolium.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/folium%2Ffolium.py?ref=70d7f5c7a409a6081a35ed547e7b9a10c032ff5c",
"patch": "@@ -570,7 +570,7 @@ def json_style(style_cnt, line_color, line_weight, line_opacity,\n self.template_vars.setdefault('map_legends', []).append(legend)\r\n \r\n #Style with color brewer colors\r\n- matchColor = 'matchKey({0}, {1})'.format(key_on, data_var)\r\n+ matchColor = 'color(matchKey({0}, {1}))'.format(key_on, data_var)\r\n style = json_style(style_count, line_color, line_weight,\r\n line_opacity, None, fill_opacity, matchColor)\r\n else:\r"
}
] |
folium | 154f0a52827223175295d77f7bdd94ca9df6f8e5 | 8f1cef296e49eb438f0e7c9201f0f4c6d776f030 | folium/folium.py | https://github.com/matsuken92/folium | true | false | true | @@ -243,7 +243,7 @@ class Map(object):
data_string = ''
for i, layer in enumerate(self.added_layers):
- name = layer.keys()[0]
+ name = list(layer.keys())[0]
data_string+='\"'
data_string+=name
data_string+='\"'
| name = layer . keys ( ) [ 0 ] | name = list ( layer . keys ( ) ) [ 0 ] | ADD_FUNCTION_AROUND_EXPRESSION | [["Insert", ["call", 3, 20, 3, 32], ["identifier:list", "T"], 0], ["Insert", ["call", 3, 20, 3, 32], ["argument_list", "N0"], 1], ["Insert", "N0", ["(:(", "T"], 0], ["Move", "N0", ["call", 3, 20, 3, 32], 1], ["Insert", "N0", ["):)", "T"], 2]] | matsuken92/folium@154f0a52827223175295d77f7bdd94ca9df6f8e5 | Fixed `add_wms_layer` py3k bug. | [
{
"sha": "53f3b7a8c1f8d59a35b1dc9ff30c2a8e2ab0d147",
"filename": "folium/folium.py",
"status": "modified",
"additions": 1,
"deletions": 1,
"changes": 2,
"blob_url": "https://github.com/matsuken92/folium/blob/154f0a52827223175295d77f7bdd94ca9df6f8e5/folium%2Ffolium.py",
"raw_url": "https://github.com/matsuken92/folium/raw/154f0a52827223175295d77f7bdd94ca9df6f8e5/folium%2Ffolium.py",
"contents_url": "https://api.github.com/repos/matsuken92/folium/contents/folium%2Ffolium.py?ref=154f0a52827223175295d77f7bdd94ca9df6f8e5",
"patch": "@@ -243,7 +243,7 @@ def add_layers_to_map(self):\n \n data_string = ''\n for i, layer in enumerate(self.added_layers):\n- name = layer.keys()[0]\n+ name = list(layer.keys())[0]\n data_string+='\\\"'\n data_string+=name\n data_string+='\\\"'"
}
] |