-
Notifications
You must be signed in to change notification settings - Fork 21
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
calculate should suggest variables it is missing when it can't calculate a quantity #1
Comments
First of all, this is indeed a great piece of code and I use it in my daily work for various conversions. This feature would be a nice addition if could be implemented. |
Thanks @sunt05 ! When I made it, the package never seemed to get much of a user base, so I eventually stopped working on it. I remember there was some kind of issue (maybe with setuptools?) causing CI to fail. That would need to be fixed also in order to test any changes. If you're interested in implementing this I'd be happy to give some pointers! |
That would be great if some hints are provided! |
In terms of fixing the CI, I can't even remember what the issue was, but if you find out what that was feel free to ask me for help if you need it. My email right now is [email protected]. In terms of writing this feature, there are two useful existing functions/features:
Basically, you could write a function (probably as a method on BaseSolver) which looks at the functions which can compute the output you want, and figures out which one has the fewest inputs you don't already have in the result from The place where you will need to raise this exception is at line 543 of solve.py. I'd suggest adding something like ", could be calculated with e.g. in addition to inputs" to the error message. |
Ah additionally, you can get the list of inputs to a function using |
Sometimes a user might forget that a certain quantity is needed to calculate the output they want. In these cases, an exception with the message "can't calculate quantity from inputs" is raised. It would be useful if this message indicated the smallest set of quantities that need to be additionally supplied in order to calculate the desired output quantity.
This enhancement involves tinkering with the fairly complicated equation system solver code, or making code that has some of its qualities, so if you're interested in taking this on please talk to me.
The text was updated successfully, but these errors were encountered: