-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for wolframalpha 3.0 #11
Conversation
Allow pip to satisfy the requirement with any version between 2.0 (inclusive) and 4.0 (exclusive). Some queries have different output when using 3.0 (vs. when using 2.x), but in most cases it appears that the change is from returning "No text-representable result" to returning some form of usable text, so I won't spend a ton of time trying to figure out why. It's an improvement.
667a573
to
6164cf7
Compare
As of 57d088b, this is working with This should not be merged without first finding and fixing the source of these regressions. |
Under wolframalpha 3.0, some queries would show "No text-representable result found" even though under wolframalpha 2.4 (or lower) they worked fine. Preliminary tests show that this code change puts this module's output in line with Rizon's Internets bot again (though the set of test queries was admittedly quite small). Further testing in production of this code will continue, with further optimizations to follow if all goes well. The new structure can probably handle both library versions, so the nasty nested try...except blocks can likely be refactored out. (I see now why the example usage in wolframalpha 3.0's README shows for-loops being used to process pods...)
Removing do not merge label, as the regression appears to be fixed by a5c63aa. Still not truly ready to merge because of pending refactoring/cleanup, but nothing should break now. |
Other than checking how many pods there are, the same code works for fetching text from results generated by wolframalpha library both pre-3.0 and 3.0. That means that the ugly nested try...except blocks and multi-level raises can go. The new structure is a lot easier to follow, and mostly uses exception-catching to handle edge cases or tell the user there is a bug that needs reporting.
Allow pip to satisfy the requirement with any version between 2.0 (inclusive) and 4.0 (exclusive).
Some queries have different output when using 3.0 (vs. when using 2.x), but in most cases it appears that the change is from returning "No text-representable result" to returning some form of usable text, so I won't spend a ton of time trying to figure out why. It's an improvement.
Completes
partall (revised May 10, 2017) of #5 (supporting both 2.x and 3.x).