Skip to content

Commit 314299f

Browse files
authored
Merge pull request #100 from andyfaff/various
MAINT: various
2 parents bdaa4e3 + 85c220f commit 314299f

6 files changed

Lines changed: 99 additions & 17 deletions

File tree

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This action releases refnx on PyPI for every version tagged commit (e.g. v0.0.1)
2+
name: PyPI/Github Release
3+
4+
on:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
make_sdist:
11+
name: Make sdist
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
15+
16+
- name: Build sdist
17+
run: pipx run build --sdist
18+
19+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
20+
with:
21+
name: wheels-sdist
22+
path: dist/*.tar.gz
23+
24+
25+
pypi-publish:
26+
name: Upload release to PyPI
27+
runs-on: ubuntu-latest
28+
needs: [ make_sdist ]
29+
environment:
30+
name: pypi
31+
url: https://pypi.org/p/refellips
32+
permissions:
33+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
34+
35+
steps:
36+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
37+
with:
38+
pattern: wheels-*
39+
merge-multiple: true
40+
path: dist
41+
42+
- name: Upload to PyPI
43+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
44+
with:
45+
# repository-url: https://test.pypi.org/legacy/
46+
skip_existing: true
47+
48+
49+
release-github:
50+
runs-on: ubuntu-latest
51+
needs: [ pypi-publish ]
52+
53+
steps:
54+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
55+
56+
- uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
57+
with:
58+
pattern: wheels-*
59+
merge-multiple: true
60+
path: dist
61+
62+
- uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0
63+
with:
64+
artifacts: "dist/refellips*.tar.gz"
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
allowUpdates: true
67+
generateReleaseNotes: true

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
max-parallel: 3
1313
matrix:
14-
python-version: ["3.10", "3.11", "3.12"]
14+
python-version: ["3.11", "3.12", "3.13"]
1515

1616
steps:
1717
- uses: actions/checkout@v4
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
strategy:
4444
matrix:
45-
python-version: ["3.11"]
45+
python-version: ["3.12"]
4646

4747
steps:
4848
- uses: actions/checkout@v4
@@ -66,7 +66,7 @@ jobs:
6666
strategy:
6767
max-parallel: 1
6868
matrix:
69-
python-version: ["3.10"]
69+
python-version: ["3.13"]
7070

7171
steps:
7272
- uses: actions/checkout@v4
@@ -95,7 +95,7 @@ jobs:
9595
strategy:
9696
max-parallel: 1
9797
matrix:
98-
python-version: ["3.11"]
98+
python-version: ["3.13"]
9999

100100
steps:
101101
- uses: actions/checkout@v4

CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ First release on PyPI
1616

1717
0.0.6
1818
-----
19+
- added circular_difference to calculate shortest difference between two angles.

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
[project]
22
requires-python = ">=3.9"
33
name = "refellips"
4-
dynamic=["version", "description", "readme", "license", "classifiers", "urls", "authors"]
4+
dynamic=["version", "description", "readme", "license", "classifiers", "urls", "authors"]
5+
6+
[tool.black]
7+
line-length = 79
8+
extend-exclude="refnx/_lib/emcee/|refnx/_lib/ptemcee/|benchmarks"

refellips/reflect_modelSE.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,16 +238,26 @@ def Delta_Psi_TMM(AOI, layers, wavelength, delta_offset, reflect_delta=False):
238238
Wavelength of light. Units = nm
239239
layers: np.ndarray
240240
coefficients required for the calculation, has shape (2 + N, 4),
241-
where N is the number of layers
242-
layers[0, 1] - refractive index of fronting
243-
layers[0, 2] - extinction coefficent of fronting
244-
layers[N, 0] - thickness of layer N
245-
layers[N, 1] - refractive index of layer N
246-
layers[N, 2] - extinction coefficent of layer N
247-
layers[N, 3] - roughness between layer N-1/N (IGNORED!)
248-
layers[-1, 1] - refractive index of backing
249-
layers[-1, 2] - extinction coefficent of backing
250-
layers[-1, 3] - roughness between backing and last layer (IGNORED!)
241+
where N is the number of layers.
242+
243+
- layers[0, 1]
244+
refractive index of fronting
245+
- layers[0, 2]
246+
extinction coefficent of fronting
247+
- layers[N, 0]
248+
thickness of layer N
249+
- layers[N, 1]
250+
refractive index of layer N
251+
- layers[N, 2]
252+
extinction coefficent of layer N
253+
- layers[N, 3]
254+
roughness between layer N-1/N (IGNORED!)
255+
- layers[-1, 1]
256+
refractive index of backing
257+
- layers[-1, 2]
258+
extinction coefficent of backing
259+
- layers[-1, 3]
260+
roughness between backing and last layer (IGNORED!)
251261
252262
Returns
253263
-------
@@ -288,7 +298,7 @@ class ReflectModelSE:
288298
r"""
289299
Parameters
290300
----------
291-
structure : refnx.reflect.Structure
301+
structure : refellips.StructureSE
292302
The interfacial structure.
293303
name : str, optional
294304
Name of the Model

refellips/structureSE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ def parameters(self):
268268

269269
def slabs(self, structure=None):
270270
"""
271-
Slab representation of this component. See :class:`Component.slabs`
271+
Slab representation of this component. See :class:`ComponentSE.slabs`
272272
"""
273273
# speculative shortcut to prevent a number of attribute retrievals
274274
if self.ri.dispersive:

0 commit comments

Comments
 (0)