Skip to content
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

Merge FreeMagnetismInterface feature enhancement #232

Open
wants to merge 66 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
acc2954
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
92a70ee
FIX: length of vectors not equal when dthetaM is not defined
acaruana2009 Jan 16, 2021
9c88dcb
Merge pull request #101 from acaruana2009/magnetism-interface
bmaranville Mar 11, 2021
a243cf0
FIX: Make thetaM behave the same as rhoM
acaruana2009 Mar 11, 2021
a60f384
Lint
acaruana2009 Mar 16, 2021
0e3c6d5
FIX: nans in mono.py as result of divide by zero
acaruana2009 Mar 24, 2021
ad869e8
FIX: changed FreeMagnetismInterface thetaM above or below default val…
acaruana2009 Mar 24, 2021
be0a13c
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
155b1aa
Merge pull request #147 from reflectometry/magnetism-interface
acaruana2009 Jan 20, 2022
bb5edf9
create self-extracting version of unstable windows .exe.zip
bmaranville Nov 30, 2021
31e462a
numba required for readthedocs build
pkienzle Nov 30, 2021
7258b39
set max initial ylim on spin asymmetry plot
bmaranville Dec 14, 2021
3da1e10
add link to unstable release page
bmaranville Dec 14, 2021
c64268e
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
a9b4c6f
FIX: length of vectors not equal when dthetaM is not defined
acaruana2009 Jan 16, 2021
e060d04
FIX: Make thetaM behave the same as rhoM
acaruana2009 Mar 11, 2021
7441f89
Lint
acaruana2009 Mar 16, 2021
145d624
FIX: nans in mono.py as result of divide by zero
acaruana2009 Mar 24, 2021
3db9b1f
FIX: changed FreeMagnetismInterface thetaM above or below default val…
acaruana2009 Mar 24, 2021
1c041d3
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
22029f8
Merge branch 'magnetism-interface-AJC' of https://github.com/reflecto…
acaruana2009 Jun 9, 2023
b9fd580
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
fc1799f
FIX: length of vectors not equal when dthetaM is not defined
acaruana2009 Jan 16, 2021
67739a2
FIX: Make thetaM behave the same as rhoM
acaruana2009 Mar 11, 2021
20037d7
Lint
acaruana2009 Mar 16, 2021
f962e6f
FIX: nans in mono.py as result of divide by zero
acaruana2009 Mar 24, 2021
9ec9eb9
FIX: changed FreeMagnetismInterface thetaM above or below default val…
acaruana2009 Mar 24, 2021
5449100
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
d61f1e8
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
60fd5e3
FIX: Make thetaM behave the same as rhoM
acaruana2009 Mar 11, 2021
8cb9239
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
717af74
Merge remote-tracking branch 'origin/magnetism-interface-AJC' into ma…
acaruana2009 Sep 10, 2024
73231d4
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
1422661
FIX: length of vectors not equal when dthetaM is not defined
acaruana2009 Jan 16, 2021
87b5f66
FIX: Make thetaM behave the same as rhoM
acaruana2009 Mar 11, 2021
34bec09
Lint
acaruana2009 Mar 16, 2021
39d654d
FIX: nans in mono.py as result of divide by zero
acaruana2009 Mar 24, 2021
b2201e8
FIX: changed FreeMagnetismInterface thetaM above or below default val…
acaruana2009 Mar 24, 2021
12acec5
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
a92bd1b
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
6beb4f4
FIX: Make thetaM behave the same as rhoM
acaruana2009 Mar 11, 2021
40c5b96
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
f0c66be
ENH: add free interface in addition to free layer for magnetism.
Nov 17, 2020
6d0833f
FIX: length of vectors not equal when dthetaM is not defined
acaruana2009 Jan 16, 2021
197cc95
FIX: changed FreeMagnetismInterface thetaM above or below default val…
acaruana2009 Mar 24, 2021
b548ded
Additional Edits for FreeMagnetismInterface
acaruana2009 Mar 26, 2021
231ebb7
Merge remote-tracking branch 'origin/magnetism-interface-AJC' into ma…
acaruana2009 Nov 11, 2024
0d7e3ad
Merge pull request #1 from acaruana2009/magnetism-interface-AJC
acaruana2009 Nov 12, 2024
f7b423c
Linting and bringing in line with master
acaruana2009 Nov 12, 2024
b6d57f7
Maint: Serialize `FreeMagnetismInterface`
acaruana2009 Nov 12, 2024
8158209
Tidying up to minimise changes
acaruana2009 Nov 12, 2024
410a858
Fix: Serializing/De-serializing of FreeInterface
acaruana2009 Nov 21, 2024
84153e3
Tidy up imports
acaruana2009 Nov 21, 2024
f5d41cb
Sorting Merge conflicts
acaruana2009 Nov 21, 2024
62ce7cb
Further import tidy up
acaruana2009 Nov 21, 2024
cf702e8
Merge branch 'master' into magnetism-interface-AJC-webview
acaruana2009 Nov 21, 2024
66e354b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2024
6aa2d2e
Updated dataclass types for `FreeMagnetismInterface`
acaruana2009 Nov 21, 2024
4f50fbc
minor fixup on stored attribute types (they are always stored as Para…
bmaranville Dec 13, 2024
8c1de01
fixes to FreeInterface class, adding magnetism and setting last eleme…
bmaranville Dec 16, 2024
7aa06d0
add FreeMagnetismInterface class
bmaranville Dec 16, 2024
689653a
add FreeMagnetismInterface to names
bmaranville Dec 16, 2024
2a65ec0
Merge remote-tracking branch 'origin/magnetism-interface-AJC-webview'…
acaruana2009 Dec 17, 2024
25a0be0
FIX: Limits of rhoM should be +- inf in `FreeMagnetism`
acaruana2009 Dec 17, 2024
ab5ca3e
ENH: add magnetism attr to `FreeLayer`
acaruana2009 Dec 17, 2024
a5e9d34
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 17, 2024
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
Prev Previous commit
Next Next commit
Additional Edits for FreeMagnetismInterface
Additional edits as suggested by Paul K.
  • Loading branch information
acaruana2009 authored and pkienzle committed Mar 27, 2021
commit be0a13c42f978362ed23250a49a575d3f0a5ccf3
26 changes: 13 additions & 13 deletions refl1d/magnetism.py
Original file line number Diff line number Diff line change
@@ -480,9 +480,9 @@ def parvec(vector, name, limits):
# layer next to a magnetic one
if tabove is None and tbelow is None:
tbelow = tabove = DEFAULT_THETA_M
elif tabove is not None and tbelow is None:
elif tbelow is None:
tbelow = tabove
elif tbelow is not None and tabove is None:
elif tabove is None:
tabove = tbelow

self.tbelow = Parameter.default(
@@ -491,7 +491,7 @@ def parvec(vector, name, limits):
tabove, name=name + " tabove", limits=(0, 360))
if len(self.dz) != len(self.drhoM):
raise ValueError("Need one dz for each drhoM")
if 0 < len(self.dthetaM) != len(self.drhoM):
if len(self.dthetaM) > 0 and len(self.drhoM) != len(self.dthetaM):
raise ValueError("Need one dthetaM for each drhoM")

def parameters(self):
@@ -520,22 +520,22 @@ def profile(self, Pz, thickness):
z[-1] = 1
z *= thickness/z[-1]

rhoM = hstack((0, cumsum(asarray([v.value for v in self.drhoM], 'd'))))
rhoM_fraction = hstack((0, cumsum(asarray([v.value for v in self.drhoM], 'd'))))
# AJC added since without the line below FreeMagnetismInterface
# does not initialise propoerly - fixes strange behaviour at drho=0 on end point
if rhoM[-1] == 0:
rhoM[-1] = 1
if rhoM_fraction[-1] == 0:
rhoM_fraction[-1] = 1

rhoM *= 1/rhoM[-1]
PrhoM = clip(monospline(z, rhoM, Pz), 0, 1)
rhoM_fraction *= 1/rhoM_fraction[-1]
PrhoM = clip(monospline(z, rhoM_fraction, Pz), 0, 1)

if self.dthetaM:
thetaM = hstack((0, cumsum(asarray([v.value for v in self.dthetaM], 'd'))))
if thetaM[-1] == 0:
thetaM[-1] = 1
thetaM_fraction = hstack((0, cumsum(asarray([v.value for v in self.dthetaM], 'd'))))
if thetaM_fraction[-1] == 0:
thetaM_fraction[-1] = 1

thetaM *= 1/thetaM[-1]
PthetaM = clip(monospline(z, thetaM, Pz), 0, 1)
thetaM_fraction *= 1 / thetaM_fraction[-1]
PthetaM = clip(monospline(z, thetaM_fraction, Pz), 0, 1)
else:
# AJC changed from len(z) to PrhoM - since PrhoM is the length of the vector
# we want PthetaM to match - otherwise slabs.add_magnetism throws an error