Skip to content

Commit

Permalink
Merge branch 'MuellerSeb-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
LSchueler committed Jul 11, 2018
2 parents daa2a08 + 08a2d90 commit 2d7aafd
Show file tree
Hide file tree
Showing 24 changed files with 868 additions and 561 deletions.
7 changes: 7 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "!layout.html" %}

{% block menu %}
{{ super() }}
<a href="py-modindex.html">Python Module Index</a>
<a href="genindex.html">Index</a>
{% endblock %}
116 changes: 65 additions & 51 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# GeoStatTools documentation build configuration file, created by
# sphinx-quickstart on Fri Jan 5 11:25:33 2018.
# sphinx-quickstart on Fri Jan 5 14:20:43 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
Expand All @@ -19,13 +19,33 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../'))
from gstools import __version__ as ver
if sys.version_info >= (3, 3):
from unittest.mock import MagicMock
else:
from mock import MagicMock
sys.path.insert(0, os.path.abspath('../../'))


def skip(app, what, name, obj, skip, options):
if name in ["__init__", "__call__"]:
return False
return skip


def setup(app):
app.connect("autodoc-skip-member", skip)


class Mock(MagicMock):
@classmethod
def __getattr__(clsm, name):
return MagicMock()


MOCK_MODULES = ['gstools.variogram.estimator']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand All @@ -35,14 +55,23 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.imgmath',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.napoleon']
'sphinx.ext.napoleon',
'sphinx.ext.autosummary',
]

autoclass_content = 'class'
autodoc_member_order = 'groupwise'

numpydoc_show_class_members = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -66,9 +95,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3'
version = ver
# The full version, including alpha/beta/rc tags.
release = '0.3'
release = ver

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -94,14 +123,31 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

#html_theme = "classic"
#html_theme = 'sphinxdoc'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

html_theme_options = {
# 'canonical_url': '',
# 'analytics_id': '',
'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'top',
# 'style_external_links': False,
# 'vcs_pageview_mode': '',
# Toc options
'collapse_navigation': False,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False
}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down Expand Up @@ -129,29 +175,16 @@
# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
'preamble': r'\setcounter{tocdepth}{3}',
'pointsize': '9pt',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'GeoStatTools.tex', 'GeoStatTools Documentation',
'Lennart Schueler', 'manual'),
'Lennart Schueler', 'howto'),
]


Expand All @@ -177,30 +210,11 @@
]


# The __call__ special member should be documented.

def skip(app, what, name, obj, skip, options):
if name == "__call__":
return False
return skip

def setup(app):
app.connect("autodoc-skip-member", skip)


class Mock(MagicMock):
@classmethod
def __getattr__(clsm, name):
return MagicMock()

MOCK_MODULES = ['gstools.variogram.estimator']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)


# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'Python 3.5': ('https://docs.python.org/3.5', None),
# 'Python': ('https://docs.python.org/', None),
# 'NumPy': ('http://docs.scipy.org/doc/numpy/', None),
# 'SciPy': ('http://docs.scipy.org/doc/scipy/reference', None),
# 'matplotlib': ('http://matplotlib.org', None),
# 'Sphinx': ('http://www.sphinx-doc.org/en/stable/', None),}
intersphinx_mapping = {
'Python 3.6': ('https://docs.python.org/3.6', None),
'Python': ('https://docs.python.org/', None),
'NumPy': ('http://docs.scipy.org/doc/numpy/', None),
'SciPy': ('http://docs.scipy.org/doc/scipy/reference', None),
'matplotlib': ('http://matplotlib.org', None),
'Sphinx': ('http://www.sphinx-doc.org/en/stable/', None)}
18 changes: 18 additions & 0 deletions docs/source/field.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
field
-----

.. automodule:: gstools.field
:members:
:undoc-members:
:show-inheritance:

.. only:: html

.. toctree::
:maxdepth: 1

rng.rst
srf.rst

Details
-------
18 changes: 0 additions & 18 deletions docs/source/gstools.field.rst

This file was deleted.

18 changes: 0 additions & 18 deletions docs/source/gstools.rst

This file was deleted.

10 changes: 0 additions & 10 deletions docs/source/gstools.variogram.rst

This file was deleted.

70 changes: 66 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
Table of Content
----------------
=======================
Welcome to GeoStatTools
=======================

.. image:: gstools.png
:width: 200px
:align: center

About
-----
GeoStatTools is a library providing geostatistical tools.

Dependencies
------------
- `Numpy <http://www.numpy.org>`_
- `SciPy <http://www.scipy.org>`_

Installation
------------
``pip install gstools``

Generation example
------------------
This is an example of how to generate a 2 dimensional spatial random field with a Gaussian covariance structure.

.. code-block:: python
import numpy as np
from gstools.field import SRF
x = np.linspace(0, 10, 120)
y = np.linspace(-5, 5, 100)
cov_model = {'dim': 2, 'var': 1.6, 'len_scale': 4.5, 'model': 'gau', 'mode_no': 1000}
srf = SRF(**cov_model)
field = srf(x, y, seed=19970221, mesh_type='structured')
Variogram example
-----------------
The spatial structure of a field can be analyzed with the variogram, which contains the same information as the covariance function.

This is an example of how to estimate the variogram of a 2 dimensional unstructured field.

.. code-block:: python
import numpy as np
from gstools.field import SRF
from gstools import variogram
#random samples between 0 <= x, y < 100
x = np.random.rand(1000) * 100.
y = np.random.rand(1000) * 100.
srf = SRF(dim=2, var=2, len_scale=30)
field = srf(x, y, seed=20011012)
bins = np.arange(0, 50)
gamma = variogram.estimate_unstructured(field, bins, x, y)
Modules
-------
.. toctree::
:maxdepth: 4
:maxdepth: 2

gstools
main
7 changes: 7 additions & 0 deletions docs/source/main.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.. automodule:: gstools

.. toctree::
:maxdepth: 2

field.rst
variogram.rst
7 changes: 7 additions & 0 deletions docs/source/rng.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rng
---

.. automodule:: gstools.field.rng
:members:
:undoc-members:
:show-inheritance:
7 changes: 7 additions & 0 deletions docs/source/srf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
srf
---

.. automodule:: gstools.field.srf
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions docs/source/variogram.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
variogram
---------

.. automodule:: gstools.variogram
:members:
:undoc-members:
:show-inheritance:

Details
-------
Loading

0 comments on commit 2d7aafd

Please sign in to comment.