Skip to content
Merged
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
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This action releases refnx on PyPI for every version tagged commit (e.g. v0.0.1)
name: PyPI/Github Release

on:
push:
tags:
- "v*"

jobs:
make_sdist:
name: Make sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: wheels-sdist
path: dist/*.tar.gz


pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: [ make_sdist ]
environment:
name: pypi
url: https://pypi.org/p/refellips
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
pattern: wheels-*
merge-multiple: true
path: dist

- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
# repository-url: https://test.pypi.org/legacy/
skip_existing: true


release-github:
runs-on: ubuntu-latest
needs: [ pypi-publish ]

steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
pattern: wheels-*
merge-multiple: true
path: dist

- uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
with:
artifacts: "dist/refellips*.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
generateReleaseNotes: true
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
python-version: ["3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -66,7 +66,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
python-version: ["3.10"]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
strategy:
max-parallel: 1
matrix:
python-version: ["3.11"]
python-version: ["3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ First release on PyPI

0.0.6
-----
- added circular_difference to calculate shortest difference between two angles.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[project]
requires-python = ">=3.9"
name = "refellips"
dynamic=["version", "description", "readme", "license", "classifiers", "urls", "authors"]
dynamic=["version", "description", "readme", "license", "classifiers", "urls", "authors"]

[tool.black]
line-length = 79
extend-exclude="refnx/_lib/emcee/|refnx/_lib/ptemcee/|benchmarks"
32 changes: 21 additions & 11 deletions refellips/reflect_modelSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,26 @@ def Delta_Psi_TMM(AOI, layers, wavelength, delta_offset, reflect_delta=False):
Wavelength of light. Units = nm
layers: np.ndarray
coefficients required for the calculation, has shape (2 + N, 4),
where N is the number of layers
layers[0, 1] - refractive index of fronting
layers[0, 2] - extinction coefficent of fronting
layers[N, 0] - thickness of layer N
layers[N, 1] - refractive index of layer N
layers[N, 2] - extinction coefficent of layer N
layers[N, 3] - roughness between layer N-1/N (IGNORED!)
layers[-1, 1] - refractive index of backing
layers[-1, 2] - extinction coefficent of backing
layers[-1, 3] - roughness between backing and last layer (IGNORED!)
where N is the number of layers.

- layers[0, 1]
refractive index of fronting
- layers[0, 2]
extinction coefficent of fronting
- layers[N, 0]
thickness of layer N
- layers[N, 1]
refractive index of layer N
- layers[N, 2]
extinction coefficent of layer N
- layers[N, 3]
roughness between layer N-1/N (IGNORED!)
- layers[-1, 1]
refractive index of backing
- layers[-1, 2]
extinction coefficent of backing
- layers[-1, 3]
roughness between backing and last layer (IGNORED!)

Returns
-------
Expand Down Expand Up @@ -288,7 +298,7 @@ class ReflectModelSE:
r"""
Parameters
----------
structure : refnx.reflect.Structure
structure : refellips.StructureSE
The interfacial structure.
name : str, optional
Name of the Model
Expand Down
2 changes: 1 addition & 1 deletion refellips/structureSE.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def parameters(self):

def slabs(self, structure=None):
"""
Slab representation of this component. See :class:`Component.slabs`
Slab representation of this component. See :class:`ComponentSE.slabs`
"""
# speculative shortcut to prevent a number of attribute retrievals
if self.ri.dispersive:
Expand Down