Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
_commit: 8bdcedc
_src_path: gh:/EasyScience/EasyProjectTemplate
description: A reflectometry python package built on the EasyScience framework.
max_python: '3.12'
max_python: '3.13'
min_python: '3.9'
orgname: EasyScience
packagename: easyreflectometry
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: ['3.11', '3.12']
python-version: ['3.11', '3.12', '3.13']
os: [ubuntu-latest, macos-latest, windows-2022]

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11','3.12']
python-version: ['3.11','3.12','3.13']
if: "!contains(github.event.head_commit.message, '[ci skip]')"

steps:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.md.
3. The pull request should work for Python, 3.11 and 3.12, and for PyPy. Check
3. The pull request should work for Python, 3.11, 3.12, and 3.13, and for PyPy. Check
https://travis-ci.com/easyScience/EasyReflectometryLib/pull_requests
and make sure that the tests pass for all supported Python versions.

Expand Down
91 changes: 90 additions & 1 deletion docs/src/tutorials/basic/assemblies_library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,97 @@ Furthermore, as shown in the `surfactant monolayer tutorial`_ the conformal roug

The use of the :py:class:`SurfactantLayer` in multiple contrast data analysis is shown in a `multiple contrast tutorial`_.

:py:class:`Bilayer`
-------------------

The :py:class:`Bilayer` assembly type represents a phospholipid bilayer at an interface.
It consists of two surfactant layers where one is inverted, creating the structure:

.. code-block:: text

Head₁ - Tail₁ - Tail₂ - Head₂

This assembly is particularly useful for studying supported lipid bilayers and membrane systems.
The bilayer comes pre-populated with physically meaningful constraints:

- Both tail layers share the same structural parameters (thickness, area per molecule)
- Head layers share thickness and area per molecule (different hydration/solvent fraction allowed)
- A single roughness parameter applies to all interfaces (conformal roughness)

These default constraints can be enabled or disabled as needed for specific analyses.

The creation of a :py:class:`Bilayer` object is shown below.

.. code-block:: python

from easyreflectometry.sample import Bilayer
from easyreflectometry.sample import LayerAreaPerMolecule
from easyreflectometry.sample import Material

# Create materials for solvents
d2o = Material(sld=6.36, isld=0.0, name='D2O')
air = Material(sld=0.0, isld=0.0, name='Air')

# Create head layer (used for front, back head will be auto-created with constraints)
head = LayerAreaPerMolecule(
molecular_formula='C10H18NO8P',
thickness=10.0,
solvent=d2o,
solvent_fraction=0.3,
area_per_molecule=48.2,
roughness=3.0,
name='DPPC Head'
)

# Create tail layer (both tail positions will share these parameters)
tail = LayerAreaPerMolecule(
molecular_formula='C32D64',
thickness=16.0,
solvent=air,
solvent_fraction=0.0,
area_per_molecule=48.2,
roughness=3.0,
name='DPPC Tail'
)

# Create bilayer with default constraints
bilayer = Bilayer(
front_head_layer=head,
tail_layer=tail,
constrain_heads=True,
conformal_roughness=True,
name='DPPC Bilayer'
)

The head layers can have different solvent fractions (hydration) even when constrained,
enabling the modeling of asymmetric bilayers at interfaces where the two sides of the
bilayer may have different solvent exposure.

The constraints can be controlled at runtime:

.. code-block:: python

# Disable head constraints to allow different head layer structures
bilayer.constrain_heads = False

# Disable conformal roughness to allow different roughness values
bilayer.conformal_roughness = False

Individual layers can be accessed via properties:

.. code-block:: python

# Access the four layers
bilayer.front_head_layer # First head layer
bilayer.front_tail_layer # First tail layer
bilayer.back_tail_layer # Second tail layer (constrained to front tail)
bilayer.back_head_layer # Second head layer

For more detailed examples including simulation and parameter access, see the `bilayer tutorial`_.


.. _`simple fitting tutorial`: ../tutorials/simple_fitting.html
.. _`tutorial`: ../tutorials/repeating.html
.. _`surfactant monolayer tutorial`: ../tutorials/monolayer.html
.. _`multiple contrast tutorial`: ../tutorials/multi_contrast.html
.. _`multiple contrast tutorial`: ../tutorials/multi_contrast.html
.. _`bilayer tutorial`: ../tutorials/simulation/bilayer.html
Loading
Loading