Compare commits
9 Commits
346caf3ea0
...
renovate/c
| Author | SHA1 | Date | |
|---|---|---|---|
| 8aa7e52f66 | |||
|
0715e1858a
|
|||
|
0ff6118211
|
|||
| 7a5658c8ea | |||
| 33b58a2afb | |||
| 458eff1905 | |||
| bba1643c76 | |||
| 54917655cd | |||
|
3cda66441e
|
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@@ -15,7 +15,7 @@ pipeline {
|
||||
environment {
|
||||
POETRY_HOME="/opt/poetry"
|
||||
POETRY_VERSION="1.1.4"
|
||||
//PYPI=credentials("DOES_NOT_EXIST")
|
||||
PYPI=credentials("pypi-pysuperconductor")
|
||||
}
|
||||
|
||||
stages {
|
||||
@@ -53,7 +53,7 @@ pipeline {
|
||||
}
|
||||
steps {
|
||||
echo 'Deploying...'
|
||||
// sh '${POETRY_HOME}/bin/poetry publish -u ${PYPI_USR} -p ${PYPI_PSW} --build'
|
||||
sh '${POETRY_HOME}/bin/poetry publish -u ${PYPI_USR} -p ${PYPI_PSW} --build'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ pipeline {
|
||||
junit 'pytest.xml'
|
||||
cobertura coberturaReportFile: 'coverage.xml'
|
||||
mail (bcc: '',
|
||||
body: "Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> Build URL: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: 'jenkins@jenkins.deepak.science', mimeType: 'text/html', replyTo: 'dmallubhotla+jenkins@gmail.com', subject: "CI ${currentBuild.currentResult}: Project name -> ${env.JOB_NAME}", to: "dmallubhotla+ci@gmail.com")
|
||||
body: "Project: ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br> Build URL: ${env.BUILD_URL}", cc: '', charset: 'UTF-8', from: 'jenkins@jenkins.deepak.science', mimeType: 'text/html', replyTo: 'dmallubhotla+jenkins@gmail.com', subject: "${env.JOB_NAME} #${env.BUILD_NUMBER}: Build ${currentBuild.currentResult}", to: "dmallubhotla+ci@gmail.com")
|
||||
}
|
||||
success {
|
||||
echo 'This will run only if successful'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "pysuperconductor"
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
description = ""
|
||||
authors = ["Deepak <dmallubhotla+github@gmail.com>"]
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import numpy # type: ignore
|
||||
import scipy.integrate as integrate # type: ignore
|
||||
import scipy.optimize # type: ignore
|
||||
import scipy.special # type: ignore
|
||||
import logging
|
||||
import warnings
|
||||
|
||||
from typing import Tuple
|
||||
|
||||
|
||||
def energy(freq: float, delta: float) -> float:
|
||||
@@ -55,8 +60,8 @@ def n_integrand_function(
|
||||
xi: float, temp: float, delta: float, mu_star: float
|
||||
) -> float:
|
||||
big_e = energy(xi, delta)
|
||||
left = 1 / (1 + numpy.exp((big_e - mu_star) / temp))
|
||||
right = 1 / (1 + numpy.exp(big_e / temp))
|
||||
left = scipy.special.expit((mu_star - big_e) / temp)
|
||||
right = scipy.special.expit(- big_e / temp)
|
||||
return left - right
|
||||
|
||||
|
||||
@@ -68,3 +73,27 @@ def n_integral(temp: float, delta: float, mu_star: float) -> float:
|
||||
lower = integrate.quad(integrand, 0, intermediate)[0]
|
||||
upper = integrate.quad(integrand, intermediate, numpy.inf)[0]
|
||||
return lower + upper
|
||||
|
||||
|
||||
def find_gap_for_n(
|
||||
temp: float,
|
||||
n_bare: float,
|
||||
debye_frequency: float,
|
||||
nv: float
|
||||
) -> Tuple[float, float]:
|
||||
n = n_bare * find_gap(0, 0, debye_frequency, nv)
|
||||
nv_inv = 1 / nv
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings(
|
||||
"ignore",
|
||||
message="Creating an ndarray from ragged nested"
|
||||
)
|
||||
sol = scipy.optimize.root(
|
||||
lambda x: [
|
||||
gap_integral(temp, x[0], x[1], debye_frequency) - nv_inv,
|
||||
n_integral(temp, x[0], x[1]) - n
|
||||
],
|
||||
x0=[debye_frequency / (numpy.sinh(nv_inv)), 0]
|
||||
)
|
||||
logging.debug(sol)
|
||||
return sol.x
|
||||
|
||||
3
renovate.json
Normal file
3
renovate.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||
}
|
||||
@@ -67,3 +67,15 @@ def test_n_integral():
|
||||
verbose=True
|
||||
)
|
||||
assert not record
|
||||
|
||||
|
||||
def test_find_n_gap():
|
||||
actual = None
|
||||
with pytest.warns(None) as record:
|
||||
actual = pysuperconductor.os_gap_calc.find_gap_for_n(.3, .1, 100, .2)
|
||||
numpy.testing.assert_almost_equal(
|
||||
actual[0], 1.0296692197710933,
|
||||
decimal=7, err_msg="did not find correct delta",
|
||||
verbose=True
|
||||
)
|
||||
assert not record
|
||||
|
||||
Reference in New Issue
Block a user