Skip to content

Commit 4a9b6aa

Browse files
authored
Merge pull request #528 from geoscixyz/ref/intro-apps
Ref/intro apps
2 parents 14aeccb + 181a7f0 commit 4a9b6aa

File tree

16 files changed

+399
-289
lines changed

16 files changed

+399
-289
lines changed

.bumpversion.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[bumpversion]
2+
current_version = 0.0.2
3+
files = conf.py _templates/footer.html
4+

_ext/autodoc.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
CONTRIB_INFO = ['affiliation', 'location', 'email', 'url', 'ORCID']
99
CASEHISTORY_INFO = ['citations', 'contributors', 'tags']
1010

11-
ORCID_URL = 'http://orcid.org/'
11+
ORCID_URL = u'http://orcid.org/'
1212

1313
THIS_IS_AUTOGENERATED = (
14-
".. --------------------------------- ..\n"
14+
u".. --------------------------------- ..\n"
1515
".. ..\n"
1616
".. THIS FILE IS AUTO GENEREATED ..\n"
1717
".. ..\n"
@@ -34,7 +34,7 @@ def make_formula_sheet():
3434
(fName.split(os.path.sep)[:-2] + ['content', 'equation_bank' + '.rst'])
3535
)
3636

37-
out = """.. _equation_bank:
37+
out = u""".. _equation_bank:
3838
3939
{}
4040
@@ -149,12 +149,12 @@ def make_contributorslist(fpath='contributors.json',
149149
html_block = '<br>'.join(html_block)
150150

151151
if 'avatar' in contrib:
152-
avatar = """
152+
avatar = u"""
153153
<a class="reference internal image-reference" href="{avatar}"><img alt="{avatar}" class="align-left" src="{avatar}" style="width: 120px; border-radius: 10px; vertical-align: text-middle padding-left="20px" /></a>
154154
""".format(avatar=contrib['avatar'])
155155

156156
else:
157-
avatar = ""
157+
avatar = u""
158158

159159
out = u"""
160160
@@ -202,7 +202,7 @@ def make_case_histories(fpath='content/case_histories/case_histories.json',
202202
fpath = open(fpath) # file to write to
203203
casehistories = json.load(fpath) # casehistories json
204204

205-
out = """
205+
out = u"""
206206
207207
{}
208208
@@ -213,12 +213,12 @@ def make_case_histories(fpath='content/case_histories/case_histories.json',
213213
f = open(fout, 'w')
214214
f.write(out)
215215

216-
toctree = """
216+
toctree = u"""
217217
""".join(
218218
["{}/index".format(key) for key in casehistories.keys()]
219219
)
220220

221-
toctreeblock = """
221+
toctreeblock = u"""
222222
.. toctree::
223223
:maxdepth: 1
224224
:hidden:
@@ -266,7 +266,7 @@ def make_case_histories(fpath='content/case_histories/case_histories.json',
266266

267267
contributions = '\n'.join(contributions)
268268

269-
contributors_block="""
269+
contributors_block=u"""
270270
- Contributors
271271
{contributions}
272272
""".format(contributions=contributions)
@@ -287,7 +287,7 @@ def make_case_histories(fpath='content/case_histories/case_histories.json',
287287

288288
tags_list = '\n'.join(tags_list)
289289

290-
tags_block="""
290+
tags_block=u"""
291291
- Tags
292292
{tags_list}
293293
""".format(tags_list=tags_list)

_ext/includeMath.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
"""
3+
Adapted from sphinx.ext.purpose
4+
5+
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/purpose.py
6+
7+
Allow purposes to be inserted into your documentation. Inclusion of purposes can
8+
be switched of by a configuration variable. The purposelist directive collects
9+
all purposes of your project and lists them along with a backlink to the
10+
original location.
11+
:copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
12+
:license: BSD, see LICENSE for details.
13+
"""
14+
15+
from docutils import nodes
16+
from docutils.parsers.rst import directives
17+
18+
import sphinx
19+
# from sphinx.locale import _
20+
# from sphinx.environment import NoUri
21+
# from sphinx.util.nodes import set_source_info
22+
# from docutils.parsers.rst import Directive
23+
# from docutils.parsers.rst.directives.admonitions import BaseAdmonition
24+
25+
from docutils.parsers.rst.directives.misc import Include
26+
27+
from sphinx.ext.mathbase import setup_math
28+
29+
class IncludeMath(setup_math):
30+
"""
31+
Includes equations and allows them to be labeled
32+
"""
33+
34+
def run(self):
35+
# type: () -> List[nodes.Node]
36+
print(self.options)
37+
env = self.state.document.settings.env
38+
# if self.arguments[0].startswith('<') and \
39+
# self.arguments[0].endswith('>'):
40+
# # docutils "standard" includes, do not do path processing
41+
# return Include.run(self)
42+
rel_filename, filename = env.relfn2path(self.arguments[0])
43+
self.arguments[0] = filename
44+
print(dir(env))
45+
env.note_included(filename)
46+
nodes = Include.run(self)
47+
print(dir(nodes))
48+
return nodes
49+
50+
51+
def setup(app):
52+
directives.register_directive('includemath', IncludeMath)

_templates/footer.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,16 @@
3939
<a href="http://geosci.xyz/contact">Contact</a>
4040
</div>
4141
<br>
42+
<div class="col-md-8" align="left" font-size="11px">
43+
<a href="https://github.com/geoscixyz/em/releases/tag/0.0.2">Version 0.0.2</a>
44+
</div>
45+
<br>
4246
<div class="col-md-8" align="left" font-size="11px">
4347
<div class="row">
4448
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/" width="60px"; style="float:right;height:3em;line-height:3em;padding:10px 0 0 1em;">
4549
<img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/88x31.png" />
4650
</a>
47-
2015-2017,
51+
2015-2018,
4852
<a href="http://geosci.xyz">GeoSci Developers.</a><br />
4953
Except where noted, this work is licensed under a <br />
5054
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/">

apps.rst

Lines changed: 94 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ There are two categories of notebooks
1313
- :ref:`Simulation Notebooks <simulation_notebooks>`
1414
- **Purpose:** To be a starting point for getting up and running with the EM Module of SimPEG for performing numerical simulations and inversions
1515

16-
.. We have provided instructions on working with the apps in the `Jupyter
17-
.. Notebook<http://jupyter.org>`_ environment.
18-
1916
If you run into any issues, please let us know at: http://github.com/geoscixyz/em_apps.
2017

2118

@@ -24,40 +21,122 @@ If you run into any issues, please let us know at: http://github.com/geoscixyz/e
2421
EM Apps
2522
-------
2623

27-
There are a few ways you can run the notebooks. We recommend:
24+
.. image:: https://mybinder.org/badge.svg
25+
:target: https://mybinder.org/v2/gh/geoscixyz/em-apps/master?filepath=index.ipynb
26+
:alt: Binder
2827

29-
- Microsoft Azure (free, login required): https://notebooks.azure.com/lheagy/libraries/em_apps
30-
- Binders (free, no login required): https://mybinder.org/v2/gh/geoscixyz/em_apps/master
31-
- or can be downloaded from Github (free, installation of python required): http://github.com/geoscixyz/em_apps
28+
.. image:: https://notebooks.azure.com/launch.png
29+
:target: https://notebooks.azure.com/import/gh/geoscixyz/em-apps
30+
:alt: Azure notebooks
3231

3332
.. image:: images/DC_LayeredEarth_notebook.png
33+
:width: 45%
34+
:alt: dc-layered-earth-app
35+
:align: right
36+
37+
There are a few ways you can run the notebooks. We provide instructions using:
38+
39+
- :ref:`Binder <binder>` (free, no login required)
40+
- :ref:`Microsoft Azure <azure>` (free, login required)
41+
42+
Alternatively, they can be downloaded from GitHub and run locally.
43+
Please see instructions at: https://github.com/geoscixyz/em-apps
44+
45+
46+
47+
48+
.. _jupyter_notebooks:
49+
50+
Jupyter Notebooks
51+
^^^^^^^^^^^^^^^^^
3452

3553
Within the Jupyter Notebook environment, you can use :code:`shift + enter` to run
3654
each cell of code, or from the menu, select :code:`cell, run all`
3755

3856
.. image:: images/run_all_cells.png
3957

4058

41-
Notebooks include
42-
^^^^^^^^^^^^^^^^^
59+
.. _binder:
60+
61+
Binder
62+
^^^^^^
63+
64+
.. image:: https://mybinder.org/badge.svg
65+
:target: https://mybinder.org/v2/gh/geoscixyz/em-apps/master?filepath=index.ipynb
66+
:alt: Binder
67+
68+
69+
1. Launch the binder by clicking on the badge above or going to: https://mybinder.org/v2/gh/geoscixyz/em-apps/master?filepath=index.ipynb.
70+
This can sometimes take a couple minutes, so be patient...
71+
72+
2. Select the notebook of interest from the contents
73+
74+
3. :ref:`Run the jupyter notebook <jupyter_notebooks>`
75+
76+
.. image:: images/binder-steps.png
77+
:alt: binder-steps
78+
:width: 100%
79+
:align: center
4380

44-
.. image:: images/notebook_list.png
81+
82+
83+
.. _azure:
84+
85+
Azure Notebooks
86+
^^^^^^^^^^^^^^^
87+
88+
.. image:: https://notebooks.azure.com/launch.png
89+
:target: https://notebooks.azure.com/import/gh/geoscixyz/em-apps
90+
:alt: Azure notebooks
91+
92+
1. Navigate to Azure notebooks by clicking on the badge above or going to: https://notebooks.azure.com/import/gh/geoscixyz/em-apps,
93+
and select :code:`Import` to import the library
94+
95+
2. Sign in to your microsoft account (or `Create One` if you do not already have an account)
96+
97+
3. Create the new library. Select `Clone recursively` in order to import the required packages. Select Import
98+
99+
4. Select :code:`index.ipynb` to view the notebook contents
100+
101+
5. Select the notebook of interest from the contents
102+
103+
6. :ref:`Run the jupyter notebook <jupyter_notebooks>`
104+
105+
.. image:: images/azure-steps.png
106+
:alt: binder-steps
107+
:width: 100%
108+
:align: center
45109

46110

47111
.. _simulation_notebooks:
48112

49113
Simulation Notebooks
50114
--------------------
51115

116+
117+
.. image:: ./images/FDEM_sounding_over_sphere.png
118+
:width: 45%
119+
:alt: dc-layered-earth-app
120+
:align: right
121+
122+
.. image:: https://mybinder.org/badge.svg
123+
:target: https://mybinder.org/v2/gh/simpeg/em-notebooks/master?filepath=index.ipynb
124+
:alt: Binder
125+
126+
.. image:: https://notebooks.azure.com/launch.png
127+
:target: https://notebooks.azure.com/import/gh/simpeg/em-notebooks
128+
:alt: Azure notebooks
129+
52130
These notebooks walk through forward simulations of both frequency domain
53131
electromagnetics and time domain electromagnetics using `SimPEG <http://simpeg.xyz>`_.
54132

55-
These notebooks are available at
133+
See the above instructions to run the notebooks from Binder or Azure. Note that the url's are different.
56134

57-
- Microsoft Azure (free, login required): https://notebooks.azure.com/lheagy/libraries/electromagnetics
58-
- Binders (free, no login required): https://mybinder.org/v2/gh/simpeg/em_notebooks/master
59-
- or can be downloaded from Github (free, installation of python required): http://github.com/simpeg/em_notebooks
135+
- :ref:`Binder <binder>` (free, no login required): https://mybinder.org/v2/gh/simpeg/em-notebooks/master?filepath=index.ipynb
136+
- :ref:`Microsoft Azure <azure>` (free, login required): https://notebooks.azure.com/import/gh/simpeg/em-notebooks
137+
138+
Alternatively, they can be downloaded from GitHub and run locally.
139+
Please see instructions at: https://github.com/simpeg/em-notebooks
60140

61141
Further examples and documentation are available at http://simpeg.xyz.
62142

63-
.. image:: ./images/FDEM_sounding_over_sphere.png

conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@
100100
# built documents.
101101
#
102102
# The short X.Y version.
103-
version = ''
103+
version = '0.0.2'
104104
# The full version, including alpha/beta/rc tags.
105-
release = ''
105+
release = '0.0.2'
106106

107107
# The language for content autogenerated by Sphinx. Refer to documentation
108108
# for a list of supported languages.
@@ -143,9 +143,11 @@
143143
'https://gif.eos.ubc.ca/sites/default/files/McMillan_parametric.pdf',
144144
'http://seg.org',
145145
'http://library.seg.org/doi/',
146-
'https://notebooks.azure.com/lheagy/libraries/electromagnetics',
147-
'https://notebooks.azure.com/lheagy/libraries/em_apps',
148146
'http://www.publish.csiro.au/EX/pdf/ASEG2016ab212',
147+
'https://notebooks.azure.com/import/gh/geoscixyz/em-apps',
148+
'https://notebooks.azure.com/import/gh/simpeg/em-notebooks',
149+
'https://www.onepetro.org/conference-paper/SEG-2012-1478',
150+
'https://doi.org/*',
149151
]
150152
linkcheck_retries = 3
151153
linkcheck_timeout = 900

content/case_histories/bookpurnong/index.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ Bookpurnong
1111
1212
**Special Thanks**
1313

14-
Thanks to the `Society of Exploration Geophysicists <http://seg.org>`__ and SkyTEM for permission to reproduce figures and adapt text from the source material. This case history is based upon two articles: `Spatially constrained inversion for quasi 3D modelling of airborne electromagnetic data – an application for environmental assessment in the Lower Murray Region of South Australia <http://library.seg.org/doi/abs/10.1071/EG08027>`_ by Viezzoli, Auken and Munday :cite:`viezzoli2009` and `Accurate quasi 3D versus practical full 3D inversion of AEM data – the Bookpurnong case study <http://www.hgg.geo.au.dk/Papers_EndNote/0477620876/VIEZZOLI2010C.pdf>`_ by Viezzoli, Munday, Auken and Christiansen :cite:`viezzoli2010`.
14+
Thanks to the `Society of Exploration Geophysicists <http://seg.org>`__ and SkyTEM for permission to reproduce figures and
15+
adapt text from the source material. This case history is based upon two articles:
16+
17+
- `Spatially constrained inversion for quasi 3D modelling of airborne electromagnetic data – an application for environmental assessment in the Lower Murray Region of South Australia <http://library.seg.org/doi/abs/10.1071/EG08027>`_ by Viezzoli, Auken and Munday :cite:`viezzoli2009` and
18+
- `Accurate quasi 3D versus practical full 3D inversion of AEM data – the Bookpurnong case study <http://www.hgg.geo.au.dk/Papers_EndNote/0477620876/VIEZZOLI2010C.pdf>`_ by Viezzoli, Munday, Auken and Christiansen :cite:`viezzoli2010`.
1519

1620
**Abstract**
1721

0 commit comments

Comments
 (0)