Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mbakker7/ttim
Browse files Browse the repository at this point in the history
  • Loading branch information
mbakker7 committed Jan 18, 2022
2 parents 3f05969 + 28dc359 commit 85a7439
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 41 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
omit =
*/ttim/circinhom.py
*/ttim/besselnumba_total.py
*/ttim/aquifernew.py
*/ttim/kuhlman_invlap.py
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ttim

on:
# Trigger the workflow on push or pull request on master
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.ci.txt ]; then pip install -r requirements.ci.txt; fi
pip install flake8 pytest
pip install codecov
pip install pytest-cov
pip install coveralls
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
- name: Run tests
run: |
py.test ./tests
- name: Publish to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Linux+/+macOS](https://travis-ci.org/mbakker7/ttim.svg?branch=master)](https://travis-ci.org/mbakker7/ttim)
[![ttim](https://github.com/mbakker7/ttim/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/mbakker7/ttim/actions/workflows/ci.yml)
[![Coverage Status](https://coveralls.io/repos/github/mbakker7/ttim/badge.svg?branch=master)](https://coveralls.io/github/mbakker7/ttim?branch=master)
![PyPI](https://img.shields.io/pypi/v/ttim?color=green)

# TTim, A Multi-Layer, Transient, Analytic Element Model

Expand All @@ -16,7 +17,7 @@ TTim is coded in Python and uses numba to speed up evaluation of the line elemen

## Latest version
New in version 0.5:
* FORTRAN extension has been ported to Python and numba (many thanks to Davíd Brakenhoff)
* FORTRAN extension has been ported to Python and numba (many thanks to Davíd Brakenhoff)
* Python invlap routine (again with numba) ported from routine by Kris Kuhlman
* New invlap routine requires fewer terms in inverse Laplace transform (M=10 is usually enough)
* Calibrate now works on ranges of parameters.
Expand All @@ -39,7 +40,7 @@ To update TTim type:

pip install ttim --upgrade

To uninstall TTi type:
To uninstall TTim type:

pip uninstall ttim

Expand All @@ -52,6 +53,6 @@ To uninstall TTi type:

Some of the papers that you may want to cite when using TTim are:

* M. Bakker. 2013. Semi-analytic modeling of transient multi-layer flow with TTim. Hydrogeology Journal, 21: 935Ð943.
* M. Bakker. 2013. Semi-analytic modeling of transient multi-layer flow with TTim. Hydrogeology Journal, 21: 935�943.
* M .Bakker. 2013. Analytic modeling of transient multi-layer flow. In: Advances in Hydrogeology, edited by P Mishra and K Kuhlman, Springer, Heidelberg, 95-114.

4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
addopts=--durations=0 -v --cov ttim --cov-config=.coveragerc --ignore=test_bessel.py
markers =
notebooks: run notebooks
7 changes: 7 additions & 0 deletions requirements.ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
numpy>=1.17
scipy>=1.5
numba>=0.5
matplotlib>=3.1,<3.5.0
lmfit>=1.0
pandas>=1.1
jupyter>=1.0.0
6 changes: 0 additions & 6 deletions requirements.travis.txt

This file was deleted.

16 changes: 9 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
from os import path

from setuptools import setup

version = {}
with open("ttim/version.py") as fp:
exec(fp.read(), version)

l_d = ""
try:
import pypandoc

l_d = pypandoc.convert("README.md", "rst")
except:
pass
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
l_d = f.read()


setup(
name="ttim",
version=version["__version__"],
description="Transient multi-layer AEM Model",
long_description=l_d,
long_description_content_type='text/markdown',
author="Mark Bakker",
author_email="markbak@gmail.com",
url="https://github.com/mbakker7/ttim",
license="MIT",
packages=["ttim"],
python_requires='>=3.7',
install_requires=["numpy>=1.17", "scipy>=1.5", "numba>=0.5", "matplotlib>=3.1", "lmfit>=1.0", "pandas>=1.1"],
install_requires=["numpy>=1.17", "scipy>=1.5", "numba>=0.5",
"matplotlib>=3.1", "lmfit>=1.0", "pandas>=1.1"],
classifiers=['Topic :: Scientific/Engineering :: Hydrology'],
)
6 changes: 5 additions & 1 deletion tests/test_notebooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import os
import shutil
import subprocess
import tempfile

import pytest
import shutil, tempfile

nbdir = os.path.join('notebooks')

Expand All @@ -24,6 +27,7 @@ def get_jupyter_kernel():

return kernel

@pytest.mark.notebooks
@pytest.mark.parametrize("fn", get_notebooks())
def test_notebook(fn):

Expand Down
1 change: 1 addition & 0 deletions ttim/aquifernew.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
import numpy as np
import matplotlib.pyplot as plt
import inspect # Used for storing the input
Expand Down
1 change: 1 addition & 0 deletions ttim/circinhom.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# flake8: noqa
import numpy as np
from scipy.special import kv, iv # Needed for K1 in Well class, and in CircInhom
from .aquifer import AquiferData
Expand Down

0 comments on commit 85a7439

Please sign in to comment.