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

Fix #32: repairing minor breakage so the notebooks run again #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
131 changes: 68 additions & 63 deletions examples/notebooks/Testing_rsbeams_decoherence.ipynb

Large diffs are not rendered by default.

90 changes: 44 additions & 46 deletions examples/notebooks/example-NLI-construction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/vagrant/.pyenv/versions/py2/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.\n",
" from ._conv import register_converters as _register_converters\n"
]
}
],
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down Expand Up @@ -65,16 +56,16 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Focal length is 0.68753882025m\n",
"Beta values at entrance are 1.89263200363m\n",
"Beta value at center is 0.653888275205m\n"
"Focal length is 0.6875388202501894 [m]\n",
"Beta values at entrance are 1.8926320036288808 [m]\n",
"Beta value at center is 0.653888275204825 [m]\n"
]
}
],
Expand All @@ -85,11 +76,11 @@
"cval = 0.03\n",
"tval = 0.4\n",
"f0=l0/4.0*(1.0+1.0/np.tan(np.pi*mu0)**2)\n",
"print \"Focal length is {}m\".format(f0)\n",
"print(\"Focal length is {} [m]\".format(f0))\n",
"betae=l0/np.sqrt(1.0-(1.0-l0/2.0/f0)**2)\n",
"print \"Beta values at entrance are {}m\".format(betae)\n",
"print(\"Beta values at entrance are {} [m]\".format(betae))\n",
"betas=l0*(1-l0/4.0/f0)/np.sqrt(1.0-(1.0-l0/2.0/f0)**2);\n",
"print \"Beta value at center is {}m\".format(betas)"
"print(\"Beta value at center is {} [m]\".format(betas))"
]
},
{
Expand All @@ -101,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -235,35 +226,35 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['nllens, knll = 2.03176954998e-06, cnll = 0.0133111024716;',\n",
" 'nllens, knll = 2.32425918167e-06, cnll = 0.0124454032437;',\n",
" 'nllens, knll = 2.66532093143e-06, cnll = 0.0116218829044;',\n",
" 'nllens, knll = 3.0579546094e-06, cnll = 0.0108501497707;',\n",
" 'nllens, knll = 3.49987469896e-06, cnll = 0.0101420326023;',\n",
" 'nllens, knll = 3.97907061816e-06, cnll = 0.00951174999782;',\n",
" 'nllens, knll = 4.46852825639e-06, cnll = 0.00897571379856;',\n",
" 'nllens, knll = 4.92267463887e-06, cnll = 0.00855166509068;',\n",
" 'nllens, knll = 5.28045052801e-06, cnll = 0.0082568759776;',\n",
" 'nllens, knll = 5.47957603728e-06, cnll = 0.00810546195183;',\n",
" 'nllens, knll = 5.47957603728e-06, cnll = 0.00810546195183;',\n",
" 'nllens, knll = 5.28045052801e-06, cnll = 0.0082568759776;',\n",
" 'nllens, knll = 4.92267463887e-06, cnll = 0.00855166509068;',\n",
" 'nllens, knll = 4.46852825639e-06, cnll = 0.00897571379856;',\n",
" 'nllens, knll = 3.97907061816e-06, cnll = 0.00951174999782;',\n",
" 'nllens, knll = 3.49987469896e-06, cnll = 0.0101420326023;',\n",
" 'nllens, knll = 3.0579546094e-06, cnll = 0.0108501497707;',\n",
" 'nllens, knll = 2.66532093143e-06, cnll = 0.0116218829044;',\n",
" 'nllens, knll = 2.32425918167e-06, cnll = 0.0124454032437;',\n",
" 'nllens, knll = 2.03176954998e-06, cnll = 0.0133111024716;']"
"['nllens, knll = 2.0317695499823542e-06, cnll = 0.013311102471649506;',\n",
" 'nllens, knll = 2.324259181669341e-06, cnll = 0.012445403243733028;',\n",
" 'nllens, knll = 2.6653209314328795e-06, cnll = 0.011621882904432295;',\n",
" 'nllens, knll = 3.057954609404607e-06, cnll = 0.010850149770689752;',\n",
" 'nllens, knll = 3.499874698958059e-06, cnll = 0.010142032602260266;',\n",
" 'nllens, knll = 3.979070618159703e-06, cnll = 0.009511749997822148;',\n",
" 'nllens, knll = 4.468528256385335e-06, cnll = 0.008975713798560936;',\n",
" 'nllens, knll = 4.922674638865199e-06, cnll = 0.008551665090678706;',\n",
" 'nllens, knll = 5.2804505280122775e-06, cnll = 0.008256875977598102;',\n",
" 'nllens, knll = 5.479576037284235e-06, cnll = 0.008105461951831525;',\n",
" 'nllens, knll = 5.479576037284235e-06, cnll = 0.008105461951831525;',\n",
" 'nllens, knll = 5.280450528012277e-06, cnll = 0.008256875977598103;',\n",
" 'nllens, knll = 4.922674638865198e-06, cnll = 0.008551665090678708;',\n",
" 'nllens, knll = 4.468528256385335e-06, cnll = 0.008975713798560936;',\n",
" 'nllens, knll = 3.979070618159701e-06, cnll = 0.00951174999782215;',\n",
" 'nllens, knll = 3.499874698958059e-06, cnll = 0.010142032602260266;',\n",
" 'nllens, knll = 3.057954609404607e-06, cnll = 0.010850149770689752;',\n",
" 'nllens, knll = 2.6653209314328787e-06, cnll = 0.011621882904432296;',\n",
" 'nllens, knll = 2.324259181669341e-06, cnll = 0.012445403243733028;',\n",
" 'nllens, knll = 2.031769549982354e-06, cnll = 0.013311102471649506;']"
]
},
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -279,27 +270,34 @@
"testNLI.generate_sequence()\n",
"testNLI.create_madx()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "py2"
"name": "py3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.14"
"pygments_lexer": "ipython3",
"version": "3.7.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}