Conversation
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.
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.
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.
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.
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.
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.
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.