choderalab / itctools

Tools for setting up ITC experiments in an automated fashion using the Tecan EVO and Auto-iTC 200.
3 stars 6 forks source link

SimpleMixture calculates mass fractions and volume fractions wrong. #23

Closed bas-rustenburg closed 9 years ago

bas-rustenburg commented 9 years ago

See https://github.com/bas-rustenburg/itctools/blob/tests/itctools/materials.py#L231-L262

And for the test:

https://github.com/bas-rustenburg/itctools/blob/tests/tests/test_materials.py#L192-L251

bas-rustenburg commented 9 years ago

I re-derived the equations while writing the tests and implemented them. I'm confident that the ones in the test are correct. The ones in the SimpleMixture class don't sum to one... I should just be able to take the correct code out of the test.

This bug makes me think. It would be good to put the mass and volume fraction calculations in separate functions. Modular structure makes things easier to test, and easier to read.

jchodera commented 9 years ago

Good idea!

bas-rustenburg commented 9 years ago

This has been fixed in #24.