-
Notifications
You must be signed in to change notification settings - Fork 2
Bilayer support #292
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
base: append_sample
Are you sure you want to change the base?
Bilayer support #292
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pull request does not contain a valid label. Please add one of the following labels: ['chore', 'fix', 'bugfix', 'bug', 'enhancement', 'feature', 'dependencies', 'documentation']
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## append_sample #292 +/- ##
=================================================
+ Coverage 88.10% 88.29% +0.19%
=================================================
Files 45 46 +1
Lines 2471 2597 +126
Branches 288 307 +19
=================================================
+ Hits 2177 2293 +116
+ Misses 233 232 -1
- Partials 61 72 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
jfkcooper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically only one comment on the code parts, and easily rectified. I will run the notebook now and give you feedback on this, but doing it in github is not fun for notebooks, so I submit these comments now
| tail_layer = LayerAreaPerMolecule( | ||
| molecular_formula='C32D64', | ||
| thickness=16.0, | ||
| solvent=air, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a lipid monolayer having the solvent be air I think is correct, but for the bilayer there is no air in the system, so a default of D2O make more sense
| back_tail_layer = LayerAreaPerMolecule( | ||
| molecular_formula=tail_layer.molecular_formula, | ||
| thickness=tail_layer.thickness.value, | ||
| solvent=air_back, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, change the air to D2O as default
| # Create layer collection: front_head, front_tail, back_tail, back_head | ||
| bilayer_layers = LayerCollection( | ||
| front_head_layer, | ||
| tail_layer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like the naming here would be more consistent with 'front_tail_layer' instead of 'tail_layer'
| def test_custom_layers(self): | ||
| """Test creation with custom head/tail layers.""" | ||
| d2o = Material(sld=6.36, isld=0, name='D2O') | ||
| air = Material(sld=0, isld=0, name='Air') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing with air here doesn't make so much sense, since there is no air in the system. I know it is just for testing, and doesn't matter, but you could change the name to 'air_matched_water' and it would be consistent with the setup (changing nothing else)
| """Test serialization/deserialization round trip.""" | ||
| # When | ||
| d2o = Material(sld=6.36, isld=0, name='D2O') | ||
| air = Material(sld=0, isld=0, name='Air') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comment about air to others. change it to air matched water if you want
|
Thinking on it, I would also use this as a way to demonstrate mutliple contrasts for the lipid model, so using H2O as the solvent and subphase as well as D2O, and then showing the SLD curves, and the reflectivity curves (and the ability to set the constraints between the two models (or however you would put the models together). The most common use case of the lipid bilayer would be for fitting mulitple contrast (water) data. |
|
Addressed the code issues and modified the notebook to reflect Jos' comments. |

As requested and described by @jfkcooper this is the library implementation of bilayers in EasyReflectometryLib.
Please scrutinize
docs\tutorials\simulation\bilayer.ipynbfor correctness and API.