Skip to content

Model language protein/RNA/DNA#153

Open
aglavic wants to merge 8 commits intoreflectivity:mainfrom
aglavic:model_language_blender
Open

Model language protein/RNA/DNA#153
aglavic wants to merge 8 commits intoreflectivity:mainfrom
aglavic:model_language_blender

Conversation

@aglavic
Copy link
Collaborator

@aglavic aglavic commented Mar 16, 2026

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.

Copy link
Contributor

@jfkcooper jfkcooper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor

@bmaranville bmaranville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good - I had one question about the test keyword in models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants