Skip to content

Commit

Permalink
Update to tracer tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
keileg committed Feb 25, 2019
1 parent 5d5c0a2 commit 0b6915c
Showing 1 changed file with 3 additions and 74 deletions.
77 changes: 3 additions & 74 deletions tutorials/tracer_transport.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -410,84 +410,13 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 20,
"metadata": {},
"outputs": [
{
"ename": "AssertionError",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-11-3ba3e1de165c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# Check that the behavior of the code does not change\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32massert\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mallclose\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtracer\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m4.72309989e-02\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mAssertionError\u001b[0m: "
]
}
],
"source": [
"# Check that the behavior of the code does not change\n",
"assert np.allclose(tracer[-1], 4.72309989e-02)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([0.9920887 , 0.66028051, 0.99611456, 0.39954397, 0.99779168,\n",
" 0.25662806, 0.98450056, 0.61949762, 0.31465084, 0.99998265,\n",
" 0.37005944, 0.99999709, 0.99203634, 0.51603466, 0.75041586,\n",
" 0.99999977, 0.9999998 , 0.99691046, 0.99998005, 0.9999968 ,\n",
" 0.99898566, 0.1759197 , 0.59813738, 0.99999998, 0.22342543,\n",
" 0.99978664, 0.99999998, 0.99865291, 0.44915933, 0.99999998,\n",
" 0.99972114, 0.99999998, 0.99980214, 0.99431411, 0.99971605,\n",
" 0.87564493, 0.99933634, 0.98695695, 0.9593243 , 0.99898953,\n",
" 0.99781361, 0.60937411, 0.99967434, 0.99699783, 0.99966264,\n",
" 0.7267548 , 0.98679189, 0.7937241 , 0.99925573, 0.50471464,\n",
" 0.99981999, 0.37242219, 0.44289736, 0.99994068, 0.9999221 ,\n",
" 0.77140217, 0.57210863, 0.99998394, 0.99991968, 0.99908386,\n",
" 0.6717912 , 0.99997879, 0.99998242, 0.99992652, 0.99110726,\n",
" 0.34448735, 0.99997576, 0.99976404, 0.21393383, 0.31503377,\n",
" 0.99999908, 0.99999766, 0.9967219 , 0.24277891, 0.99999749,\n",
" 0.99999921, 0.99999805, 0.85376685, 0.99999877, 0.99533408,\n",
" 0.99998915, 0.89870404, 0.99999293, 0.98710208, 0.98670438,\n",
" 0.24842005, 0.97887169, 0.96467755, 0.96435265, 0.86682468,\n",
" 0.99999848, 0.96215569, 0.99999841, 0.98070611, 0.36417052,\n",
" 0.34336967, 0.96811817, 0.94523488, 0.96450865, 0.66061513,\n",
" 0.74440836, 0.39109003, 0.99138035, 0.20026736, 0.21828179,\n",
" 0.16967935, 0.9999986 , 1. , 1. , 0.99999842,\n",
" 0.4348832 , 0.45605744, 0.99999992, 0.89434606, 0.99999984,\n",
" 0.98754328, 0.26197928, 0.3894272 , 0.4285989 , 0.8158189 ,\n",
" 0.87160485, 0.9003715 , 0.9191946 , 0.48835748, 0.99374678,\n",
" 0.97794825, 0.81971577, 0.80600629, 0.94849325, 0.82562576,\n",
" 0.96772451, 0.94750165, 0.99120633, 0.96225686, 0.87199257,\n",
" 0.76100032, 0.76993891, 0.82792644, 0.74220465, 0.75099311,\n",
" 0.30632532, 0.21462942, 0.80046086, 0.54522414, 0.11809074,\n",
" 0.17472462, 0.6476449 , 0.86047812, 0.750882 , 0.8457279 ,\n",
" 0.84737775, 0.74488526, 0.28485974, 0.25814933, 0.7857038 ,\n",
" 0.66154981, 0.72306401, 0.69178821, 0.85190248, 0.60817277,\n",
" 0.52000918, 0.6826708 , 0.11778831, 0.09430135, 0.92233023,\n",
" 0.83271436, 0.83922092, 0.90335928, 0.92506417, 0.85382011,\n",
" 0.50060636, 0.54633575, 0.96614489, 0.84310433, 0.87618209,\n",
" 0.37129501, 0.99903254, 0.99470834, 0.99768449, 0.98829183,\n",
" 0.99835466, 0.861771 , 0.92247742, 0.99710839, 0.98587773,\n",
" 0.92112123, 0.99134966, 0.98360949, 0.85498911, 0.99643385,\n",
" 0.99730186, 0.99089862])"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"g = gb.grids_of_dimension(2)[0]\n",
"data = gb.node_props(g)\n",
"assert data['tracer'][-1]"
"assert np.allclose(data['tracer'][-1], 0.99089862)"
]
}
],
Expand Down

0 comments on commit 0b6915c

Please sign in to comment.