Skip to content

TDC just exits rather than raising an exception #194

Open
@davidegraff

Description

@davidegraff

Describe the bug
This isn't so much of a bug as it is a suboptimal developer. In certain instances when attempting to load a dataset with an improper task name, TDC causes the whole program to exit

To Reproduce

from tdc.single_pred import ADME
ADME("caco2_wang", label_name="bad task name")
# Found local copy...
# Loading...
# ['Drug_ID' 'Drug' 'Y']
# Please report this error to contact@tdcommons.ai, thanks!

Expected behavior
That TDC would raise a more descriptive Exception rather than just exiting, allowing the end user to (1) except it, if necessary, and (2) diagnose it via a full stack trace.

More Details
the culprit in my instance is specifically here. The blanket except in L334 is likely catching the appropriate exception raised in fuzzy_search() and instead just exiting the program. IMO you should be propagating the error or at least convert it to a different error rather than just exiting

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions