-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
introducing class Quantity #290
Conversation
Ray, This is a great addition! The only comment I have is that it runs a bit counter to my intuition to allow the user to do something like this: q1 = ct.Quantity(gas, mass=5) q1.constant = ‘HP’ q1.equilibrate(‘UV’) alternatively, the user might expect to be able to call: q1 = ct.Quantity(gas, mass=5) q1.constant = ‘HP’ q1.equilibrate() #this runs HP I’m not sure what the proper solution for this is… From: Ray Speth [mailto:notifications@github.com] This is a class that I've wanted to exist for awhile, which makes it easy to compute the state when two solutions are combined, instead of repeating the tedious calculation of the weighted average properties in order to set the new state. I'm pretty happy with this implementation, which generates wrappers for all the properties of class Solution automatically, but I wanted to see if there were any suggestions for improving the interface before I merge this into master. You can view, comment on, or merge this pull request online at: Commit Summary
File Changes
Patch Links: — |
Nick, Thanks for the feedback. I like the idea in your second example of using the constant property pair as the default for equilibrate, and have implemented it. I don't think the first example is a problem -- if the user explicitly says they want to equilibrate using a different property pair, that's fine. I guess the question in this case is whether the value of |
Ray, I agree that the value of constant shouldn’t be changed in the first case. Nick From: Ray Speth [mailto:notifications@github.com] Nick, Thanks for the feedback. I like the idea in your second example of using the constant property pair as the default for equilibrate, and have implemented it. I don't think the first example is a problem -- if the user explicitly says they want to equilibrate using a different property pair, that's fine. I guess the question in this case is whether the value of constant should be updated automatically. I'm leaning toward no. — |
This is a class that I've wanted to exist for awhile, which makes it easy to compute the state when two solutions are combined, instead of repeating the tedious calculation of the weighted average properties in order to set the new state.
I'm pretty happy with this implementation, which generates wrappers for all the properties of class
Solution
automatically, but I wanted to see if there were any suggestions for improving the interface before I merge this into master.