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
temperature.val does not return temperature but only its unit #50
Comments
Sounds like a bug with the string representation of SireUnits::Celsius. temperature = Parameter("temperature", 25 * celsius, """Simulation by temperature = Parameter("temperature", 298 * kelvin, """Simulation Dr. Julien Michel, Edinburgh EH9 3FJ http://www.julienmichel.net/On Wed, Aug 12, 2015 at 3:05 PM, ppxasjsm notifications@github.com wrote:
The University of Edinburgh is a charitable body, registered in |
Now I get this:
|
will flag this to Chris as this definitely looks like a problem in SireUnits that ought to be fixed for 15.1 |
Yes, this is a bug. Temperature is the most painful unit to implement as it does not behave in the same way as other physical units. I have now downloaded Sire from github (devel branch) and will try to fix this problem over the coming week. It will be a test of whether or not I can successfully develop against the github repository (tear in my eye as I say goodbye to google code...) p.s. The github repository looks great - you've done a brilliant job copying everything over. |
Watch out for trailing white spaces ! Sure way to annoy Antonia ! Dr. Julien Michel, Edinburgh EH9 3FJ http://www.julienmichel.net/On Wed, Sep 2, 2015 at 10:35 AM, Christopher Woods <notifications@github.com
The University of Edinburgh is a charitable body, registered in |
Annoys me too ;-) My pet peeve though is "incorrect" indenting, e.g. not using 4 spaces to indent, and not putting the braces in the right place. I am too picky. I've now compiled corelib on my mac. I've had to fix a small compile bug that I will commit back to the repository. I will then work on compiling the wrappers, which I know will be more painful as I am using Yosemite. I have time this month to really look at Sire, so will put everything in place so that we can look to release either at the end of this month or after the workshop in Juelich. |
White spaces are mainly annoying when you want to track the changes someone made to a file and you don't want to see all the 100 lines where white spaces were added. Indenting is also annoying....also, it would be great if we can have a bit more detailed chat about Sire in Jülich. |
Closed as fixed in the latest push to merge_2014_4 |
I just noticed that in the devel branch, the Kelvin temperature unit, does not seem work:
Also:
|
The fix matched the API for temperature to that for GeneralUnit. This means that there is no .val member variable. Instead you have to call .value() to get the value in internal units, or call .to() to convert the value to the desired units, e.g.
The GeneralUnit class will try to write out the unit string with the value (e.g. C for Celsius, A for angstrom etc.). However, I have not added in all of the unit strings for all of the units, e.g. base temperature (kelvin) is written using 't' for temperature, while base mass (units of atomic mass constant) is written using 'm' for mass. If you want to add unit strings, then edit getUnitString in corelib/src/libs/SireUnits/convert.cpp. This initialises a dictionary that maps all of the 'common' units used in Sire to unit strings. |
Closing as no progress |
I seem to notice something strange the way the temperature parameter is passed to python.
I use the default temperature value and don't overwrite with anything in my config file, i.e. this should be read:
The output I get for the two variables is:
Which is quite useless information for the temperature. Not sure where the problem might be.
The temperature does get correctly passed to c++ code though.
The text was updated successfully, but these errors were encountered: