Skip to content

Commit

Permalink
Merge pull request #44 from mbakker7/formatting
Browse files Browse the repository at this point in the history
Formatting black+isort
  • Loading branch information
dbrakenhoff authored Oct 16, 2023
2 parents 568435c + 85b6d0a commit c2330a2
Show file tree
Hide file tree
Showing 76 changed files with 7,905 additions and 6,045 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Migrate code style to black
a8aa6904034da74b91f8046e2440ebb4359d63e2
2 changes: 1 addition & 1 deletion docs/builddocs/html/_sources/models/modelindex.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The top of the system can be either an aquifer or a leaky layer. The head is com

.. code-block:: python
ml = ModelMaq(kaq=[10, 30, 20], z=[0, -5, -10, -20, -25, -35], \
ml = ttim.ModelMaq(kaq=[10, 30, 20], z=[0, -5, -10, -20, -25, -35], \
c=[2000, 5000], Saq=[0.1, 1e-4, 2e-4], \
Sll=[1e-4, 4e-4], phreatictop=True, \
tmin=0.01, tmax=10))
Expand Down
2 changes: 1 addition & 1 deletion docs/builddocs/html/_sources/models/modelindex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The top of the system can be either an aquifer or a leaky layer. The head is com

.. code-block:: python

ml = ModelMaq(kaq=[10, 30, 20], z=[0, -5, -10, -20, -25, -35], \
ml = ttim.ModelMaq(kaq=[10, 30, 20], z=[0, -5, -10, -20, -25, -35], \
c=[2000, 5000], Saq=[0.1, 1e-4, 2e-4], \
Sll=[1e-4, 4e-4], phreatictop=True, \
tmin=0.01, tmax=10))
Expand Down
118 changes: 61 additions & 57 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,48 +23,48 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath("."))

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

extensions = [
'alabaster',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode'
"alabaster",
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
source_suffix = '.rst'
templates_path = ["_templates"]
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = u'ttim'
copyright = u'2017, Mark Bakker'
author = u'Mark Bakker'
rst_epilog = '.. |project| replace:: %s' % project
project = "ttim"
copyright = "2017, Mark Bakker"
author = "Mark Bakker"
rst_epilog = ".. |project| replace:: %s" % project

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.4'
version = "0.4"
# The full version, including alpha/beta/rc tags.
release = '0.4.a1'
release = "0.4.a1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -81,7 +81,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand All @@ -99,7 +99,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -112,30 +112,30 @@

# -- Options for HTML output ----------------------------------------------

html_theme = 'alabaster'
html_theme = "alabaster"
html_theme_path = [alabaster.get_path()]
html_static_path = ['_static']
html_static_path = ["_static"]

html_theme_options = {
'logo': False,
'travis_button': False,
'logo_name': False,
'github_user': 'mbakker7',
'github_repo': 'ttim',
'github_banner': False,
'github_button': True,
'github_type': 'watch',
'github_count': True,
'description': "TTim is a transient multi-layer analytic element model",
'codecov_button': False,
"logo": False,
"travis_button": False,
"logo_name": False,
"github_user": "mbakker7",
"github_repo": "ttim",
"github_banner": False,
"github_button": True,
"github_type": "watch",
"github_count": True,
"description": "TTim is a transient multi-layer analytic element model",
"codecov_button": False,
}

html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html',
'searchbox.html'
"**": [
"about.html",
"navigation.html",
"relations.html",
"searchbox.html",
]
}

Expand Down Expand Up @@ -173,20 +173,17 @@
html_show_copyright = True

# Output file base name for HTML help builder.
htmlhelp_basename = 'ttimdoc'
htmlhelp_basename = "ttimdoc"

# -- 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',
}
Expand All @@ -195,13 +192,18 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ttimman.tex', u'TTim Documentation',
u'Mark Bakker', 'manual'),
(
master_doc,
"ttimman.tex",
"TTim Documentation",
"Mark Bakker",
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = 'logo.png'
# latex_logo = 'logo.png'

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
Expand All @@ -224,10 +226,7 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'ttim', u'TTim Documentation',
[author], 1)
]
man_pages = [(master_doc, "ttim", "TTim Documentation", [author], 1)]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand All @@ -239,9 +238,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'TTim', u'TTim Documentation',
author, 'TTim', 'TTim is a transient multi-layer analytic element model',
'Miscellaneous'),
(
master_doc,
"TTim",
"TTim Documentation",
author,
"TTim",
"TTim is a transient multi-layer analytic element model",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
Expand All @@ -258,8 +263,7 @@


# Example configuration for intersphinx: refer to the Python standard library.
#intersphinx_mapping = {'https://docs.python.org/3': None,
# intersphinx_mapping = {'https://docs.python.org/3': None,
# 'http://pandas.pydata.org/pandas-docs/stable/': None,
# 'https://docs.scipy.org/doc/scipy/reference/': None,
# 'https://docs.scipy.org/doc/numpy/': None}

2 changes: 1 addition & 1 deletion docs/models/modelindex.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The top of the system can be either an aquifer or a leaky layer. The head is com

.. code-block:: python
ml = ModelMaq(kaq=[10, 30, 20], z=[0, -5, -10, -20, -25, -35], \
ml = ttim.ModelMaq(kaq=[10, 30, 20], z=[0, -5, -10, -20, -25, -35], \
c=[2000, 5000], Saq=[0.1, 1e-4, 2e-4], \
Sll=[1e-4, 4e-4], phreatictop=True, \
tmin=0.01, tmax=10))
Expand Down
98 changes: 71 additions & 27 deletions examples/linesinkex.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,92 @@
import numpy as np
import matplotlib.pyplot as plt
from ttim import *
import numpy as np

import ttim

xls = 100 * np.cos(np.linspace(np.pi, 0, 7))
yls = 50 * np.ones(len(xls))

ml1 = ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
Saq=[0.1, 1e-4, 1e-4], Sll=[0, 0], phreatictop=True,
tmin=0.1, tmax=10, M=20, f2py=False)
ls1 = HeadLineSinkString(ml1, list(zip(xls, yls)), tsandh=[(0, 2)], layers=0, label='river')
ml1 = ttim.ModelMaq(
kaq=[1, 20, 2],
z=[25, 20, 18, 10, 8, 0],
c=[100, 200],
Saq=[0.1, 1e-4, 1e-4],
Sll=[0, 0],
phreatictop=True,
tmin=0.1,
tmax=10,
M=20,
f2py=False,
)
ls1 = ttim.HeadLineSinkString(
ml1, list(zip(xls, yls)), tsandh=[(0, 2)], layers=0, label="river"
)
ml1.solve()

ml2 = ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
Saq=[0.1, 1e-4, 1e-4], Sll=[0, 0], phreatictop=True,
tmin=0.1, tmax=10, M=20, f2py=True)
ls2 = HeadLineSinkString(ml2, list(zip(xls, yls)), tsandh=[(0, 2)], layers=0, label='river')
ml2 = ttim.ModelMaq(
kaq=[1, 20, 2],
z=[25, 20, 18, 10, 8, 0],
c=[100, 200],
Saq=[0.1, 1e-4, 1e-4],
Sll=[0, 0],
phreatictop=True,
tmin=0.1,
tmax=10,
M=20,
f2py=True,
)
ls2 = ttim.HeadLineSinkString(
ml2, list(zip(xls, yls)), tsandh=[(0, 2)], layers=0, label="river"
)
ml2.solve()

print('ml1:', ml1.disvec(40, 20, 10))
print('ml2:', ml2.disvec(40, 20, 10))
print("ml1:", ml1.disvec(40, 20, 10))
print("ml2:", ml2.disvec(40, 20, 10))

ml3 = ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
Saq=[0.1, 1e-4, 1e-4], Sll=[0, 0], phreatictop=True,
tmin=0.1, tmax=10, M=20, f2py=False)
ls3 = HeadLineSinkHo(ml3, -100, 0, 100, 0, tsandh=[(0, 2)], layers=0, order=5, label='river')
ml3 = ttim.ModelMaq(
kaq=[1, 20, 2],
z=[25, 20, 18, 10, 8, 0],
c=[100, 200],
Saq=[0.1, 1e-4, 1e-4],
Sll=[0, 0],
phreatictop=True,
tmin=0.1,
tmax=10,
M=20,
f2py=False,
)
ls3 = ttim.HeadLineSinkHo(
ml3, -100, 0, 100, 0, tsandh=[(0, 2)], layers=0, order=5, label="river"
)
ml3.solve()

ml4 = ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
Saq=[0.1, 1e-4, 1e-4], Sll=[0, 0], phreatictop=True,
tmin=0.1, tmax=10, M=20, f2py=True)
ls4 = HeadLineSinkHo(ml4, -100, 0, 100, 0, tsandh=[(0, 2)], layers=0, order=5, label='river')
ml4 = ttim.ModelMaq(
kaq=[1, 20, 2],
z=[25, 20, 18, 10, 8, 0],
c=[100, 200],
Saq=[0.1, 1e-4, 1e-4],
Sll=[0, 0],
phreatictop=True,
tmin=0.1,
tmax=10,
M=20,
f2py=True,
)
ls4 = ttim.HeadLineSinkHo(
ml4, -100, 0, 100, 0, tsandh=[(0, 2)], layers=0, order=5, label="river"
)
ml4.solve()

print('ml3:', ml3.disvec(40, 20, 10))
print('ml4:', ml4.disvec(40, 20, 10))
print("ml3:", ml3.disvec(40, 20, 10))
print("ml4:", ml4.disvec(40, 20, 10))

#x = np.linspace(-200, 200, 101)
#h1 = ml1.headalongline(x, 50, t=100)
# x = np.linspace(-200, 200, 101)
# h1 = ml1.headalongline(x, 50, t=100)

# ml2 = ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
# ml2 = ttim.ModelMaq(kaq=[1, 20, 2], z=[25, 20, 18, 10, 8, 0], c=[100, 200],
# Saq=[0.1, 1e-4, 1e-4], Sll=[0, 0], phreatictop=True,
# tmin=0.1, tmax=1000, M=20, f2py=False)
# ls2 = HeadLineSinkHo(ml2, x1=-100, y1=50, x2=100, y2=50, tsandh=[(0.0,2.0)],\
# ls2 = ttim.HeadLineSinkHo(ml2, x1=-100, y1=50, x2=100, y2=50, tsandh=[(0.0,2.0)],\
# order=5, layers=0)
# ml2.solve()

Expand All @@ -61,4 +106,3 @@
# # plt.plot(x, h2[i, 0])
# # plt.grid()
# # plt.show()

17 changes: 13 additions & 4 deletions examples/test1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
from ttim import *
ml = ModelMaq(kaq=[1, 5], z=[3, 2, 1, 0], c=[10], Saq=[0.3, 0.01], Sll=[0.001], tmin=10, tmax=1000, M=20)
w1 = DischargeWell(ml, xw = 0, yw = 0, rw = 1e-5, tsandQ = [(0, 1)], layers = 0)
ml.solve()
import ttim

ml = ttim.ModelMaq(
kaq=[1, 5],
z=[3, 2, 1, 0],
c=[10],
Saq=[0.3, 0.01],
Sll=[0.001],
tmin=10,
tmax=1000,
M=20,
)
w1 = ttim.DischargeWell(ml, xw=0, yw=0, rw=1e-5, tsandQ=[(0, 1)], layers=0)
ml.solve()
Loading

0 comments on commit c2330a2

Please sign in to comment.