Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gb119 committed Dec 20, 2023
1 parent 7ffbe98 commit 2fb2667
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions Stoner/analysis/fitting/models/e_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# -*- coding: utf-8 -*-
"""Model classes and functions for various models of electron transport (other than tunnelling processes)."""
# pylint: disable=invalid-name
__all__ = ["BlochGrueneisen", "FluchsSondheimer", "WLfit",
"blochGrueneisen", "fluchsSondheimer", "wlfit"]
__all__ = ["BlochGrueneisen", "FluchsSondheimer", "WLfit", "blochGrueneisen", "fluchsSondheimer", "wlfit"]

import numpy as np
from scipy.integrate import quad
Expand All @@ -21,7 +20,7 @@
int64 = _dummy()


@jit(float64(float64, int64), nopython=True, nogil=True)
@jit(float64(float64, int64), nopython=True)
def _bgintegrand(x, n):
"""Calculate the integrand for the Bloch Grueneisen model."""
return x**n / ((np.exp(x) - 1) * (1 - np.exp(-x)))
Expand Down Expand Up @@ -61,10 +60,8 @@ def wlfit(B, s0, DS, B1, B2):
WLpt1 = digamma(0.5 + B2 / np.abs(Bi))
WLpt2 = digamma(0.5 + B1 / np.abs(Bi))
else:
WLpt1 = (digamma(
0.5 + B2 / np.abs(B[tt - 1])) + digamma(0.5 + B2 / np.abs(B[tt + 1]))) / 2
WLpt2 = (digamma(
0.5 + B1 / np.abs(B[tt - 1])) + digamma(0.5 + B1 / np.abs(B[tt + 1]))) / 2
WLpt1 = (digamma(0.5 + B2 / np.abs(B[tt - 1])) + digamma(0.5 + B2 / np.abs(B[tt + 1]))) / 2
WLpt2 = (digamma(0.5 + B1 / np.abs(B[tt - 1])) + digamma(0.5 + B1 / np.abs(B[tt + 1]))) / 2

WLpt3 = np.log(B2 / B1)

Expand Down Expand Up @@ -97,7 +94,8 @@ def fluchsSondheimer(t, l, p, sigma_0):
"""
k = t / l

def kernel(x, k): return (x - x**3) * np.exp(-k * x) / (1 - np.exp(-k * x))
def kernel(x, k):
return (x - x**3) * np.exp(-k * x) / (1 - np.exp(-k * x))

result = np.zeros(k.shape)
for i, v in enumerate(k):
Expand Down
2 changes: 1 addition & 1 deletion Stoner/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def _load(self, filename: Filename, *args: Any, **kargs: Any) -> "metadataObject
raise NotImplementedError("Save is not implemented in the base class.")


if pd is not None and not hasattr(pd.DataFrame,"metadata"): # Don;t double add metadata
if pd is not None and not hasattr(pd.DataFrame, "metadata"): # Don;t double add metadata

@pd.api.extensions.register_dataframe_accessor("metadata")
class PandasMetadata(typeHintedDict):
Expand Down
1 change: 1 addition & 0 deletions doc/samples/colormap_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# pylint: disable=invalid-name
import numpy as np


from Stoner import Data

x, y = np.meshgrid(np.linspace(-2, 2, 100), np.linspace(-2, 2, 100))
Expand Down
1 change: 0 additions & 1 deletion tests/Stoner/test_Util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
pth = path.realpath(path.join(pth, "../../"))
sys.path.insert(0, pth)


def is_2tuple(x):
"""Return tru if x is a length two tuple of floats."""
return isinstance(x, tuple) and len(x) == 2 and isinstance(x[0], float) and isinstance(x[1], float)
Expand Down

0 comments on commit 2fb2667

Please sign in to comment.