an error in codes
Closed this issue · 1 comments
kkasra12 commented
take a look at this:
density_peak_clustering/cluster.py
Line 54 in fe0898e
you cannot raise a string in python for example:
>>> raise "test"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: exceptions must derive from BaseException
The correct form is:
raise KeyError('Key error: key does not exist!')
if you run this line in interpreter you will face:
>>> raise KeyError('Key error: key does not exist!')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'Key error: key does not exist!'
freesinger commented
Thanks, would you mind making a pull request?
Get Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: Kasra ***@***.***>
Sent: Thursday, July 22, 2021 4:27:11 PM
To: freesinger/density_peak_clustering ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [freesinger/density_peak_clustering] an error in codes (#7)
take a look at this:
https://github.com/freesinger/density_peak_clustering/blob/fe0898ef5b4555cfe37aeccdc0ea0d6d160dadbd/cluster.py#L54
you cannot raise a string in python for example:
>> raise "test"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: exceptions must derive from BaseException
The correct form is:
raise KeyError('Key error: key does not exist!')
if you run this line in interpreter you will face:
>> raise KeyError('Key error: key does not exist!')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'Key error: key does not exist!'
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#7>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AE7NZITUNVARSN2O5KUSLZTTY7I57ANCNFSM5AZQRBGQ>.