Conversation
jfkcooper
left a comment
There was a problem hiding this comment.
Hi Artur, only one comment from me, and it may be that the way it is being run it would never be a problem
| stack = sm.resolve_stack() | ||
| self.assertEqual(len(stack), 4) | ||
| self.assertEqual(stack[1].material.formula, "C50H48Hx11N19O31P5") | ||
| self.assertEqual(stack[1].thickness.magnitude, 50.0) |
There was a problem hiding this comment.
For the comparison here, I think the fact that you are using 50.0 means that the comparison would be done as floating point values. I would therefore use assertAlmostEqual() instead of assertEqual() for the comparisons, or change the values to int, though the former is safer for a test
There was a problem hiding this comment.
The thickness should definately be a float. Would one not only use almost equal for values after some calculations or when changing between float precisions? Here the value should be an interpreted literal number "float('50')", shouldn't this be exactly equal in the same float precision representation?
bmaranville
left a comment
There was a problem hiding this comment.
This all looks good - I had one question about the test keyword in models.
In addition to testing all example files of the model language this PR adds the capability to resolve protein/RNA/DNA molecules directly using the SLDdb "Bio Blender" functionality. The syntax is like for ORSO database IDs.
See sample_model_example_9.yml for an example.
Will also add a local database version to perform all test locally without API calls.