Skip to content

Commit

Permalink
- added rgeomod to the gempy pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Leguark committed May 24, 2018
1 parent 8f2f4e7 commit cf77f72
Show file tree
Hide file tree
Showing 41 changed files with 18,936 additions and 1 deletion.
276 changes: 276 additions & 0 deletions notebooks/addons/rgeomod_google_earth/01_test_installation.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 1 - Installation test\n",
"\n",
"This notebook is for testing the dependencies for rgeomod. Just run the following code cell.\n",
"\n",
"<div class=\"alert alert-info\">\n",
"**Your task**: Run the code in the following cells (either using the \"Run\"-button above, or by usign the corresponding shortcut (typically <code>\"Shift\"+\"Enter\"</code>, see Help function above): \n",
"</div>\n",
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Fundamental libraries"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Fundamental Python libraries imported correctly.\n"
]
}
],
"source": [
"import numpy, sys, os, tqdm\n",
"print(\"Fundamental Python libraries imported correctly.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Plotting libraries"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Plotting libraries imported correctly.\n"
]
}
],
"source": [
"import matplotlib.pyplot, mplstereonet\n",
"from mpl_toolkits.mplot3d import Axes3D\n",
"print(\"Plotting libraries imported correctly.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 3D-Visualization library"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-danger\">\n",
"**Important note**: 3D-Visualization using VTK is not available if you use Docker to run this exercise. This module is **optional**.\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"3D-Visualization library VTK imported correctly.\n"
]
}
],
"source": [
"try:\n",
" import vtk\n",
" print(\"3D-Visualization library VTK imported correctly.\")\n",
"except: \n",
" print(\"3D-Visualization library VTK not found.\")\n",
" print(\"This module is optional for the 3D visualization of data and geological models.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### remote-geomod"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'rgeomod'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-4-3de1b9db30ef>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0msys\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mr\"..\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# append local path to access rgeomod module\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mrgeomod\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Python package remote-geomod imported correctly.\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'rgeomod'"
]
}
],
"source": [
"sys.path.append(r\"..\") # append local path to access rgeomod module\n",
"import rgeomod\n",
"print(\"Python package remote-geomod imported correctly.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-danger\">\n",
"**Important note**: If importing `rgeomod` fails, then make sure that you pulled it correctly from github (especially when using the rgeomod-dependencies docker image).\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### GemPy\n",
"\n",
"<div class=\"alert alert-danger\">\n",
"**Important note**: Any warnings that occur when loading the library can safely be ignored for the context of the exercise. If you want to get rid of the warning notes, simply execute the cell twice.\n",
"</div>\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"3D-Modeling library GemPy imported correctly.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/anaconda3/envs/remote-geomod/lib/python3.6/site-packages/gempy/UncertaintyAnalysisPYMC2.py:8: UserWarning: pymc (v2) package is not installed. No support for stochastic simulation posterior analysis.\n",
" warnings.warn(\"pymc (v2) package is not installed. No support for stochastic simulation posterior analysis.\")\n"
]
}
],
"source": [
"sys.path.append(\"../../gempy/\")\n",
"sys.path.append(\"../gempy/\")\n",
"import gempy\n",
"print(\"3D-Modeling library GemPy imported correctly.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-danger\">\n",
"If importing `gempy` fails, then check that the relative path is set correctly in `sys.path.append()` above.\n",
"</div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-success\">\n",
"If all packages were imported correctly, then you should see `... imported correctly` after executing each cell - and you are good to go with the following exercises! If you get a warning message from gempy, then it can be ignored (you can execute the cell again, then this warning should disappear).\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
"autocomplete": true,
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 1,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
},
"labels_anchors": false,
"latex_user_defs": false,
"report_style_numbering": false,
"user_envs_cfg": false
},
"toc": {
"colors": {
"hover_highlight": "#DAA520",
"running_highlight": "#FF0000",
"selected_highlight": "#FFD700"
},
"moveMenuLeft": true,
"nav_menu": {
"height": "123px",
"width": "251px"
},
"navigate_menu": true,
"number_sections": true,
"sideBar": true,
"threshold": 4,
"toc_cell": false,
"toc_section_display": "block",
"toc_window_display": false,
"widenNotebook": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit cf77f72

Please sign in to comment.