From 0e51a40fd0536eeb48a16a16ab3b2b99cd4f8ff3 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Mon, 18 Nov 2019 16:08:04 +0100 Subject: [PATCH 01/30] 1.0.6.dev0 version bump; update travis --- .travis.yml | 1 + ogs5py/_version.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f4389d1..a6ce2da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ matrix: language: python python: 3.6 services: docker + env: CIBW_BUILD="cp36-*64" env: global: diff --git a/ogs5py/_version.py b/ogs5py/_version.py index ebbb171..40c1af8 100644 --- a/ogs5py/_version.py +++ b/ogs5py/_version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- """Provide a central version.""" -__version__ = "1.0.5" +__version__ = "1.0.6.dev0" From bf69b8cabf011e2eb402e11c6bf74acec431d179 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Wed, 20 Nov 2019 20:26:53 +0100 Subject: [PATCH 02/30] add tests to source distribution --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 86730bc..c16750c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ include MANIFEST.in include setup.py recursive-include ogs5py *.py +recursive-include tests *.py recursive-include docs/source * include docs/Makefile docs/requirements.txt include LICENSE From 35fc79eb7830aaf10d06da5853139715c24b51fc Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Wed, 20 Nov 2019 20:27:31 +0100 Subject: [PATCH 03/30] add zenodo config --- .zenodo.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .zenodo.json diff --git a/.zenodo.json b/.zenodo.json new file mode 100755 index 0000000..1d89e25 --- /dev/null +++ b/.zenodo.json @@ -0,0 +1,18 @@ +{ + "contributors": [ + { + "orcid": "0000-0002-2547-8102", + "affiliation": "Helmholtz Centre for Environmental Research - UFZ", + "type": "Supervisor", + "name": "Falk He\u00dfe" + } + ], + "license": "MIT", + "creators": [ + { + "orcid": "0000-0001-9060-4008", + "affiliation": "Helmholtz Centre for Environmental Research - UFZ", + "name": "Sebastian M\u00fcller" + } + ], +} \ No newline at end of file From 667b01406b9210aa476ff97a86e72c422ff60886 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 13:10:55 +0100 Subject: [PATCH 04/30] Remove future imports (py2 drop) --- ogs5py/__init__.py | 2 -- ogs5py/fileclasses/__init__.py | 2 -- ogs5py/fileclasses/asc/__init__.py | 2 -- ogs5py/fileclasses/asc/core.py | 2 -- ogs5py/fileclasses/base.py | 1 - ogs5py/fileclasses/bc/__init__.py | 2 -- ogs5py/fileclasses/bc/core.py | 2 -- ogs5py/fileclasses/cct/__init__.py | 2 -- ogs5py/fileclasses/cct/core.py | 2 -- ogs5py/fileclasses/ddc/__init__.py | 2 -- ogs5py/fileclasses/ddc/core.py | 2 -- ogs5py/fileclasses/fct/__init__.py | 2 -- ogs5py/fileclasses/fct/core.py | 2 -- ogs5py/fileclasses/gem/__init__.py | 2 -- ogs5py/fileclasses/gem/core.py | 2 -- ogs5py/fileclasses/gli/__init__.py | 2 -- ogs5py/fileclasses/gli/checker.py | 1 - ogs5py/fileclasses/gli/core.py | 2 -- ogs5py/fileclasses/gli/generator.py | 2 -- ogs5py/fileclasses/gli/tools.py | 1 - ogs5py/fileclasses/ic/__init__.py | 2 -- ogs5py/fileclasses/ic/core.py | 2 -- ogs5py/fileclasses/krc/__init__.py | 2 -- ogs5py/fileclasses/krc/core.py | 2 -- ogs5py/fileclasses/mcp/__init__.py | 2 -- ogs5py/fileclasses/mcp/core.py | 2 -- ogs5py/fileclasses/mfp/__init__.py | 2 -- ogs5py/fileclasses/mfp/core.py | 2 -- ogs5py/fileclasses/mmp/__init__.py | 2 -- ogs5py/fileclasses/mmp/core.py | 2 -- ogs5py/fileclasses/mpd/__init__.py | 2 -- ogs5py/fileclasses/mpd/core.py | 2 -- ogs5py/fileclasses/msh/__init__.py | 2 -- ogs5py/fileclasses/msh/checker.py | 1 - ogs5py/fileclasses/msh/core.py | 2 -- ogs5py/fileclasses/msh/generator.py | 2 -- ogs5py/fileclasses/msh/gmsh.py | 1 - ogs5py/fileclasses/msh/msh_io.py | 1 - ogs5py/fileclasses/msh/tools.py | 1 - ogs5py/fileclasses/msh/viewer.py | 2 -- ogs5py/fileclasses/msp/__init__.py | 2 -- ogs5py/fileclasses/msp/core.py | 2 -- ogs5py/fileclasses/num/__init__.py | 2 -- ogs5py/fileclasses/num/core.py | 2 -- ogs5py/fileclasses/out/__init__.py | 2 -- ogs5py/fileclasses/out/core.py | 2 -- ogs5py/fileclasses/pcs/__init__.py | 2 -- ogs5py/fileclasses/pcs/core.py | 2 -- ogs5py/fileclasses/pct/__init__.py | 2 -- ogs5py/fileclasses/pct/core.py | 2 -- ogs5py/fileclasses/pqc/__init__.py | 2 -- ogs5py/fileclasses/pqc/core.py | 2 -- ogs5py/fileclasses/rei/__init__.py | 2 -- ogs5py/fileclasses/rei/core.py | 2 -- ogs5py/fileclasses/rfd/__init__.py | 2 -- ogs5py/fileclasses/rfd/core.py | 2 -- ogs5py/fileclasses/st/__init__.py | 2 -- ogs5py/fileclasses/st/core.py | 2 -- ogs5py/fileclasses/tim/__init__.py | 2 -- ogs5py/fileclasses/tim/core.py | 2 -- ogs5py/ogs.py | 1 - ogs5py/reader/__init__.py | 2 -- ogs5py/reader/reader.py | 1 - ogs5py/reader/techelper.py | 1 - ogs5py/reader/tools.py | 1 - ogs5py/reader/vtkhelper.py | 3 --- ogs5py/tools/download.py | 2 -- ogs5py/tools/output.py | 1 - ogs5py/tools/script.py | 2 -- ogs5py/tools/tools.py | 1 - ogs5py/tools/types.py | 1 - ogs5py/tools/vtk_viewer.py | 2 -- tests/test_ogs5py.py | 2 -- 73 files changed, 133 deletions(-) diff --git a/ogs5py/__init__.py b/ogs5py/__init__.py index 75fbbf9..7c0d597 100644 --- a/ogs5py/__init__.py +++ b/ogs5py/__init__.py @@ -125,8 +125,6 @@ PCS_TYP PRIM_VAR_BY_PCS """ -from __future__ import absolute_import - from ogs5py._version import __version__ from ogs5py.ogs import OGS from ogs5py.fileclasses import ( diff --git a/ogs5py/fileclasses/__init__.py b/ogs5py/fileclasses/__init__.py index fe78cc6..5adb991 100644 --- a/ogs5py/fileclasses/__init__.py +++ b/ogs5py/fileclasses/__init__.py @@ -48,8 +48,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.asc import ASC from ogs5py.fileclasses.bc import BC from ogs5py.fileclasses.cct import CCT diff --git a/ogs5py/fileclasses/asc/__init__.py b/ogs5py/fileclasses/asc/__init__.py index de13f04..882416b 100644 --- a/ogs5py/fileclasses/asc/__init__.py +++ b/ogs5py/fileclasses/asc/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.asc.core import ASC __all__ = ["ASC"] diff --git a/ogs5py/fileclasses/asc/core.py b/ogs5py/fileclasses/asc/core.py index 409be9a..c0ca301 100644 --- a/ogs5py/fileclasses/asc/core.py +++ b/ogs5py/fileclasses/asc/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs ASC file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import LineFile diff --git a/ogs5py/fileclasses/base.py b/ogs5py/fileclasses/base.py index 00f9326..fdb700f 100644 --- a/ogs5py/fileclasses/base.py +++ b/ogs5py/fileclasses/base.py @@ -15,7 +15,6 @@ ---- """ -from __future__ import print_function, division, absolute_import import os import shutil import time diff --git a/ogs5py/fileclasses/bc/__init__.py b/ogs5py/fileclasses/bc/__init__.py index 8ac148f..98123a7 100644 --- a/ogs5py/fileclasses/bc/__init__.py +++ b/ogs5py/fileclasses/bc/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.bc.core import BC __all__ = ["BC"] diff --git a/ogs5py/fileclasses/bc/core.py b/ogs5py/fileclasses/bc/core.py index a8ab7c4..fde7837 100644 --- a/ogs5py/fileclasses/bc/core.py +++ b/ogs5py/fileclasses/bc/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs BOUNDARY CONDITION file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/cct/__init__.py b/ogs5py/fileclasses/cct/__init__.py index 3dc2580..91d4af4 100644 --- a/ogs5py/fileclasses/cct/__init__.py +++ b/ogs5py/fileclasses/cct/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.cct.core import CCT __all__ = ["CCT"] diff --git a/ogs5py/fileclasses/cct/core.py b/ogs5py/fileclasses/cct/core.py index 6f4056e..4d0a8ec 100644 --- a/ogs5py/fileclasses/cct/core.py +++ b/ogs5py/fileclasses/cct/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs COMMUNICATION TABLE file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/ddc/__init__.py b/ogs5py/fileclasses/ddc/__init__.py index 2f78395..e047307 100644 --- a/ogs5py/fileclasses/ddc/__init__.py +++ b/ogs5py/fileclasses/ddc/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.ddc.core import DDC __all__ = ["DDC"] diff --git a/ogs5py/fileclasses/ddc/core.py b/ogs5py/fileclasses/ddc/core.py index d3e8a15..9447fc6 100644 --- a/ogs5py/fileclasses/ddc/core.py +++ b/ogs5py/fileclasses/ddc/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs DOMAIN DECOMPOSITION file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/fct/__init__.py b/ogs5py/fileclasses/fct/__init__.py index 095c6b1..27e8a9a 100644 --- a/ogs5py/fileclasses/fct/__init__.py +++ b/ogs5py/fileclasses/fct/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.fct.core import FCT __all__ = ["FCT"] diff --git a/ogs5py/fileclasses/fct/core.py b/ogs5py/fileclasses/fct/core.py index 3a0ae3d..22a58fd 100644 --- a/ogs5py/fileclasses/fct/core.py +++ b/ogs5py/fileclasses/fct/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs FUNCTION file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/gem/__init__.py b/ogs5py/fileclasses/gem/__init__.py index 5673fd2..7ae85f3 100644 --- a/ogs5py/fileclasses/gem/__init__.py +++ b/ogs5py/fileclasses/gem/__init__.py @@ -13,8 +13,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.gem.core import GEM, GEMinit __all__ = ["GEM", "GEMinit"] diff --git a/ogs5py/fileclasses/gem/core.py b/ogs5py/fileclasses/gem/core.py index 8a78832..b7ac2a5 100644 --- a/ogs5py/fileclasses/gem/core.py +++ b/ogs5py/fileclasses/gem/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs GEOCHEMICAL THERMODYNAMIC MODELING COUPLING file.""" - -from __future__ import absolute_import, division, print_function import os from ogs5py.fileclasses.base import BlockFile, LineFile diff --git a/ogs5py/fileclasses/gli/__init__.py b/ogs5py/fileclasses/gli/__init__.py index ffabe47..6540a1a 100644 --- a/ogs5py/fileclasses/gli/__init__.py +++ b/ogs5py/fileclasses/gli/__init__.py @@ -20,8 +20,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.gli.core import GLI, GLIext __all__ = ["GLI", "GLIext"] diff --git a/ogs5py/fileclasses/gli/checker.py b/ogs5py/fileclasses/gli/checker.py index 3740373..4e20762 100644 --- a/ogs5py/fileclasses/gli/checker.py +++ b/ogs5py/fileclasses/gli/checker.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Checking routines for the ogs5py-GLI package.""" -from __future__ import division, print_function, absolute_import import numpy as np from ogs5py.tools.types import STRTYPE, GLI_KEYS, PLY_KEYS, SRF_KEYS, VOL_KEYS diff --git a/ogs5py/fileclasses/gli/core.py b/ogs5py/fileclasses/gli/core.py index 5409ab5..d3ac45a 100644 --- a/ogs5py/fileclasses/gli/core.py +++ b/ogs5py/fileclasses/gli/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Core module for the ogs5py GLI file.""" - -from __future__ import division, print_function, absolute_import from copy import deepcopy as dcp import os import numpy as np diff --git a/ogs5py/fileclasses/gli/generator.py b/ogs5py/fileclasses/gli/generator.py index 8ba6118..24ccde0 100644 --- a/ogs5py/fileclasses/gli/generator.py +++ b/ogs5py/fileclasses/gli/generator.py @@ -14,8 +14,6 @@ ---- """ -from __future__ import division, print_function, absolute_import - import numpy as np from ogs5py.fileclasses.gli.core import GLI as gli diff --git a/ogs5py/fileclasses/gli/tools.py b/ogs5py/fileclasses/gli/tools.py index ee994ed..84472d8 100644 --- a/ogs5py/fileclasses/gli/tools.py +++ b/ogs5py/fileclasses/gli/tools.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Tools for the ogs5py gli file.""" -from __future__ import division, print_function, absolute_import from copy import deepcopy as dcp import numpy as np from ogs5py.tools.types import ( diff --git a/ogs5py/fileclasses/ic/__init__.py b/ogs5py/fileclasses/ic/__init__.py index c139d7f..72947b3 100644 --- a/ogs5py/fileclasses/ic/__init__.py +++ b/ogs5py/fileclasses/ic/__init__.py @@ -13,8 +13,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.ic.core import IC, RFR __all__ = ["IC", "RFR"] diff --git a/ogs5py/fileclasses/ic/core.py b/ogs5py/fileclasses/ic/core.py index 69326e5..14b9e5f 100644 --- a/ogs5py/fileclasses/ic/core.py +++ b/ogs5py/fileclasses/ic/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs INITIAL_CONDITION file.""" - -from __future__ import absolute_import, division, print_function import os import numpy as np import pandas as pd diff --git a/ogs5py/fileclasses/krc/__init__.py b/ogs5py/fileclasses/krc/__init__.py index e509dd1..61664cd 100644 --- a/ogs5py/fileclasses/krc/__init__.py +++ b/ogs5py/fileclasses/krc/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.krc.core import KRC __all__ = ["KRC"] diff --git a/ogs5py/fileclasses/krc/core.py b/ogs5py/fileclasses/krc/core.py index 99517a5..e08cfe4 100644 --- a/ogs5py/fileclasses/krc/core.py +++ b/ogs5py/fileclasses/krc/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs KINETRIC REACTION file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/mcp/__init__.py b/ogs5py/fileclasses/mcp/__init__.py index 426154e..2bb0a83 100644 --- a/ogs5py/fileclasses/mcp/__init__.py +++ b/ogs5py/fileclasses/mcp/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.mcp.core import MCP __all__ = ["MCP"] diff --git a/ogs5py/fileclasses/mcp/core.py b/ogs5py/fileclasses/mcp/core.py index 5443a92..eced719 100644 --- a/ogs5py/fileclasses/mcp/core.py +++ b/ogs5py/fileclasses/mcp/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs COMPONENT_PROPERTIES file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/mfp/__init__.py b/ogs5py/fileclasses/mfp/__init__.py index 821f3be..e00261e 100644 --- a/ogs5py/fileclasses/mfp/__init__.py +++ b/ogs5py/fileclasses/mfp/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.mfp.core import MFP __all__ = ["MFP"] diff --git a/ogs5py/fileclasses/mfp/core.py b/ogs5py/fileclasses/mfp/core.py index bcce156..a696b87 100644 --- a/ogs5py/fileclasses/mfp/core.py +++ b/ogs5py/fileclasses/mfp/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs FLUID PROPERTY file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/mmp/__init__.py b/ogs5py/fileclasses/mmp/__init__.py index a238ce3..fa51811 100644 --- a/ogs5py/fileclasses/mmp/__init__.py +++ b/ogs5py/fileclasses/mmp/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.mmp.core import MMP __all__ = ["MMP"] diff --git a/ogs5py/fileclasses/mmp/core.py b/ogs5py/fileclasses/mmp/core.py index 881460c..cfcff08 100644 --- a/ogs5py/fileclasses/mmp/core.py +++ b/ogs5py/fileclasses/mmp/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs MEDIUM_PROPERTIES file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/mpd/__init__.py b/ogs5py/fileclasses/mpd/__init__.py index 5f5ae06..335c19b 100644 --- a/ogs5py/fileclasses/mpd/__init__.py +++ b/ogs5py/fileclasses/mpd/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.mpd.core import MPD __all__ = ["MPD"] diff --git a/ogs5py/fileclasses/mpd/core.py b/ogs5py/fileclasses/mpd/core.py index ab59bb2..16fc131 100644 --- a/ogs5py/fileclasses/mpd/core.py +++ b/ogs5py/fileclasses/mpd/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs MEDIUM_PROPERTIES_DISTRIBUTED file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/msh/__init__.py b/ogs5py/fileclasses/msh/__init__.py index 7994d54..c74dc7a 100644 --- a/ogs5py/fileclasses/msh/__init__.py +++ b/ogs5py/fileclasses/msh/__init__.py @@ -19,8 +19,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.msh.core import MSH __all__ = ["MSH"] diff --git a/ogs5py/fileclasses/msh/checker.py b/ogs5py/fileclasses/msh/checker.py index d34d831..4ba35ed 100644 --- a/ogs5py/fileclasses/msh/checker.py +++ b/ogs5py/fileclasses/msh/checker.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Checker for the ogs5py mesh file.""" -from __future__ import division, print_function, absolute_import import numpy as np from ogs5py.fileclasses.msh.tools import no_of_elements from ogs5py.tools.types import ( diff --git a/ogs5py/fileclasses/msh/core.py b/ogs5py/fileclasses/msh/core.py index 557e44e..98e787f 100644 --- a/ogs5py/fileclasses/msh/core.py +++ b/ogs5py/fileclasses/msh/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Core module for the ogs5py mesh file.""" - -from __future__ import division, print_function, absolute_import from copy import deepcopy as dcp import numpy as np from ogs5py.fileclasses.msh import generator as gen diff --git a/ogs5py/fileclasses/msh/generator.py b/ogs5py/fileclasses/msh/generator.py index cd641a6..531cf23 100644 --- a/ogs5py/fileclasses/msh/generator.py +++ b/ogs5py/fileclasses/msh/generator.py @@ -19,8 +19,6 @@ ---- """ -from __future__ import division, print_function, absolute_import - import numpy as np from ogs5py.fileclasses.msh.tools import ( diff --git a/ogs5py/fileclasses/msh/gmsh.py b/ogs5py/fileclasses/msh/gmsh.py index 4aeb895..2ffd0fb 100644 --- a/ogs5py/fileclasses/msh/gmsh.py +++ b/ogs5py/fileclasses/msh/gmsh.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Simple interface to pygmsh.""" -from __future__ import division, print_function, absolute_import def gmsh_code(path_or_code): diff --git a/ogs5py/fileclasses/msh/msh_io.py b/ogs5py/fileclasses/msh/msh_io.py index 6847695..2c28e3f 100755 --- a/ogs5py/fileclasses/msh/msh_io.py +++ b/ogs5py/fileclasses/msh/msh_io.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """IO routines for the ogs5py mesh package.""" -from __future__ import division, print_function, absolute_import from copy import deepcopy as dcp import numpy as np import meshio as mio diff --git a/ogs5py/fileclasses/msh/tools.py b/ogs5py/fileclasses/msh/tools.py index dcf3c54..b3d4517 100755 --- a/ogs5py/fileclasses/msh/tools.py +++ b/ogs5py/fileclasses/msh/tools.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Tools for the ogs5py mesh package.""" -from __future__ import division, print_function, absolute_import from copy import deepcopy as dcp import numpy as np from ogs5py.tools.types import ELEM_NAMES, EMPTY_MSH diff --git a/ogs5py/fileclasses/msh/viewer.py b/ogs5py/fileclasses/msh/viewer.py index 4a7fe83..8e2c609 100644 --- a/ogs5py/fileclasses/msh/viewer.py +++ b/ogs5py/fileclasses/msh/viewer.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Viewer for an ogs5py mesh.""" -from __future__ import division, print_function, absolute_import - import os import numpy as np from ogs5py.fileclasses.msh.msh_io import export_mesh diff --git a/ogs5py/fileclasses/msp/__init__.py b/ogs5py/fileclasses/msp/__init__.py index 2d7a015..ea0b8f8 100644 --- a/ogs5py/fileclasses/msp/__init__.py +++ b/ogs5py/fileclasses/msp/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.msp.core import MSP __all__ = ["MSP"] diff --git a/ogs5py/fileclasses/msp/core.py b/ogs5py/fileclasses/msp/core.py index 6b71d11..76d322b 100644 --- a/ogs5py/fileclasses/msp/core.py +++ b/ogs5py/fileclasses/msp/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs SOLID_PROPERTIES file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/num/__init__.py b/ogs5py/fileclasses/num/__init__.py index f72f1c4..59fe4f6 100644 --- a/ogs5py/fileclasses/num/__init__.py +++ b/ogs5py/fileclasses/num/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.num.core import NUM __all__ = ["NUM"] diff --git a/ogs5py/fileclasses/num/core.py b/ogs5py/fileclasses/num/core.py index a0dc21f..da67812 100644 --- a/ogs5py/fileclasses/num/core.py +++ b/ogs5py/fileclasses/num/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs NUMERICS file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/out/__init__.py b/ogs5py/fileclasses/out/__init__.py index d818681..adc9765 100644 --- a/ogs5py/fileclasses/out/__init__.py +++ b/ogs5py/fileclasses/out/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.out.core import OUT __all__ = ["OUT"] diff --git a/ogs5py/fileclasses/out/core.py b/ogs5py/fileclasses/out/core.py index a35f97d..f7ef214 100644 --- a/ogs5py/fileclasses/out/core.py +++ b/ogs5py/fileclasses/out/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs OUTPUT file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/pcs/__init__.py b/ogs5py/fileclasses/pcs/__init__.py index ab34fd3..1a88d74 100644 --- a/ogs5py/fileclasses/pcs/__init__.py +++ b/ogs5py/fileclasses/pcs/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.pcs.core import PCS __all__ = ["PCS"] diff --git a/ogs5py/fileclasses/pcs/core.py b/ogs5py/fileclasses/pcs/core.py index fc52933..a683f30 100644 --- a/ogs5py/fileclasses/pcs/core.py +++ b/ogs5py/fileclasses/pcs/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs PROCESS file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/pct/__init__.py b/ogs5py/fileclasses/pct/__init__.py index 5904acb..e9d08b7 100644 --- a/ogs5py/fileclasses/pct/__init__.py +++ b/ogs5py/fileclasses/pct/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.pct.core import PCT __all__ = ["PCT"] diff --git a/ogs5py/fileclasses/pct/core.py b/ogs5py/fileclasses/pct/core.py index e597b3b..79d3c61 100644 --- a/ogs5py/fileclasses/pct/core.py +++ b/ogs5py/fileclasses/pct/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs PARTICLE DEFINITION file for RANDOM_WALK.""" - -from __future__ import absolute_import, division, print_function import numpy as np from ogs5py.fileclasses.base import File diff --git a/ogs5py/fileclasses/pqc/__init__.py b/ogs5py/fileclasses/pqc/__init__.py index a238002..15ff690 100644 --- a/ogs5py/fileclasses/pqc/__init__.py +++ b/ogs5py/fileclasses/pqc/__init__.py @@ -13,8 +13,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.pqc.core import PQC, PQCdat __all__ = ["PQC", "PQCdat"] diff --git a/ogs5py/fileclasses/pqc/core.py b/ogs5py/fileclasses/pqc/core.py index e767d1f..e182196 100644 --- a/ogs5py/fileclasses/pqc/core.py +++ b/ogs5py/fileclasses/pqc/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs PHREEQC interface file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import LineFile diff --git a/ogs5py/fileclasses/rei/__init__.py b/ogs5py/fileclasses/rei/__init__.py index 7edbc81..ffabc70 100644 --- a/ogs5py/fileclasses/rei/__init__.py +++ b/ogs5py/fileclasses/rei/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.rei.core import REI __all__ = ["REI"] diff --git a/ogs5py/fileclasses/rei/core.py b/ogs5py/fileclasses/rei/core.py index f5c82b0..fbfdc2d 100644 --- a/ogs5py/fileclasses/rei/core.py +++ b/ogs5py/fileclasses/rei/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs REACTION_INTERFACE file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/rfd/__init__.py b/ogs5py/fileclasses/rfd/__init__.py index a926980..48d08ec 100644 --- a/ogs5py/fileclasses/rfd/__init__.py +++ b/ogs5py/fileclasses/rfd/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.rfd.core import RFD __all__ = ["RFD"] diff --git a/ogs5py/fileclasses/rfd/core.py b/ogs5py/fileclasses/rfd/core.py index ff8c451..2cad399 100644 --- a/ogs5py/fileclasses/rfd/core.py +++ b/ogs5py/fileclasses/rfd/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs USER DEFINED TIME CURVES file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/st/__init__.py b/ogs5py/fileclasses/st/__init__.py index c738782..e67d06d 100644 --- a/ogs5py/fileclasses/st/__init__.py +++ b/ogs5py/fileclasses/st/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.st.core import ST __all__ = ["ST"] diff --git a/ogs5py/fileclasses/st/core.py b/ogs5py/fileclasses/st/core.py index 2cd27ac..7f0069b 100644 --- a/ogs5py/fileclasses/st/core.py +++ b/ogs5py/fileclasses/st/core.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Class for the ogs SOURCE_TERM file.""" - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/fileclasses/tim/__init__.py b/ogs5py/fileclasses/tim/__init__.py index afae0f0..b51c234 100644 --- a/ogs5py/fileclasses/tim/__init__.py +++ b/ogs5py/fileclasses/tim/__init__.py @@ -12,8 +12,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.fileclasses.tim.core import TIM __all__ = ["TIM"] diff --git a/ogs5py/fileclasses/tim/core.py b/ogs5py/fileclasses/tim/core.py index a62db08..cbe4205 100644 --- a/ogs5py/fileclasses/tim/core.py +++ b/ogs5py/fileclasses/tim/core.py @@ -2,8 +2,6 @@ """ Class for the ogs TIME_STEPPING file. """ - -from __future__ import absolute_import, division, print_function from ogs5py.fileclasses.base import BlockFile diff --git a/ogs5py/ogs.py b/ogs5py/ogs.py index 55783d7..e8e254f 100644 --- a/ogs5py/ogs.py +++ b/ogs5py/ogs.py @@ -12,7 +12,6 @@ ---- """ -from __future__ import absolute_import, division, print_function import os import shutil import glob diff --git a/ogs5py/reader/__init__.py b/ogs5py/reader/__init__.py index 7ec141b..3d551c5 100644 --- a/ogs5py/reader/__init__.py +++ b/ogs5py/reader/__init__.py @@ -16,8 +16,6 @@ ---- """ -from __future__ import absolute_import - from ogs5py.reader.reader import ( readvtk, readpvd, diff --git a/ogs5py/reader/reader.py b/ogs5py/reader/reader.py index 76ad5a7..66df4d6 100644 --- a/ogs5py/reader/reader.py +++ b/ogs5py/reader/reader.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- """Reader for the OGS5 Output.""" -from __future__ import absolute_import, division, print_function import os import glob diff --git a/ogs5py/reader/techelper.py b/ogs5py/reader/techelper.py index ca16cba..f38c217 100644 --- a/ogs5py/reader/techelper.py +++ b/ogs5py/reader/techelper.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Helper functions for the tecplot readers in ogs5py.""" -from __future__ import division, print_function, absolute_import import numpy as np from vtk import ( vtkTecplotReader, diff --git a/ogs5py/reader/tools.py b/ogs5py/reader/tools.py index 41e2301..256b9b7 100644 --- a/ogs5py/reader/tools.py +++ b/ogs5py/reader/tools.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Tools for the ogs5py.reader package.""" -from __future__ import division, print_function, absolute_import def save_vtk_stru_point(path, vtk_dict, verbose=True): diff --git a/ogs5py/reader/vtkhelper.py b/ogs5py/reader/vtkhelper.py index 3284114..013869e 100644 --- a/ogs5py/reader/vtkhelper.py +++ b/ogs5py/reader/vtkhelper.py @@ -1,8 +1,5 @@ # -*- coding: utf-8 -*- """Helper functions for the vtk readers in ogs5py.""" - -from __future__ import absolute_import, division, print_function - from vtk import ( vtkUnstructuredGridReader, vtkStructuredGridReader, diff --git a/ogs5py/tools/download.py b/ogs5py/tools/download.py index b8b4fdc..04028fe 100755 --- a/ogs5py/tools/download.py +++ b/ogs5py/tools/download.py @@ -17,8 +17,6 @@ ---- """ -from __future__ import division, print_function, absolute_import - import os import shutil import tarfile diff --git a/ogs5py/tools/output.py b/ogs5py/tools/output.py index e5caded..cb96a3d 100755 --- a/ogs5py/tools/output.py +++ b/ogs5py/tools/output.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """Tools for ogs5py output files (independent from VTK package).""" -from __future__ import division, print_function, absolute_import import os import glob import re diff --git a/ogs5py/tools/script.py b/ogs5py/tools/script.py index c957dbd..5c102a1 100644 --- a/ogs5py/tools/script.py +++ b/ogs5py/tools/script.py @@ -23,7 +23,6 @@ ---- """ -from __future__ import division, print_function, absolute_import import os import shutil @@ -309,7 +308,6 @@ def gen_script( # open the script file with open(path, "w") as script: print("# -*- coding: utf-8 -*-", file=script) - # print("from __future__ import division, print_function", file=script) print("from ogs5py import " + load, file=script) print("", file=script) print(ogs_cls_name + " = OGS(", file=script) diff --git a/ogs5py/tools/tools.py b/ogs5py/tools/tools.py index 7b52951..7a4e972 100644 --- a/ogs5py/tools/tools.py +++ b/ogs5py/tools/tools.py @@ -53,7 +53,6 @@ ---- """ -from __future__ import division, print_function, absolute_import import os import sys import glob diff --git a/ogs5py/tools/types.py b/ogs5py/tools/types.py index 32c8573..0ef942f 100644 --- a/ogs5py/tools/types.py +++ b/ogs5py/tools/types.py @@ -55,7 +55,6 @@ MULTI_FILES """ -from __future__ import division, print_function, absolute_import import sys import numpy as np diff --git a/ogs5py/tools/vtk_viewer.py b/ogs5py/tools/vtk_viewer.py index 879595a..64937ac 100755 --- a/ogs5py/tools/vtk_viewer.py +++ b/ogs5py/tools/vtk_viewer.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- """Viewer for a vtk file.""" -from __future__ import division, print_function, absolute_import - # import os # os.environ["QT_API"] = "pyqt" # os.environ["ETS_TOOLKIT"] = "qt4" diff --git a/tests/test_ogs5py.py b/tests/test_ogs5py.py index 026ad87..78f3864 100644 --- a/tests/test_ogs5py.py +++ b/tests/test_ogs5py.py @@ -2,8 +2,6 @@ """ This is the unittest for ogs5py. """ -from __future__ import division, absolute_import, print_function - import os import unittest import numpy as np From 1813758c57d374bbcbda47aac3dba62d5b1ce3bc Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 13:46:20 +0100 Subject: [PATCH 05/30] Zenodo: typo --- .zenodo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.zenodo.json b/.zenodo.json index 1d89e25..c7cce3b 100755 --- a/.zenodo.json +++ b/.zenodo.json @@ -14,5 +14,5 @@ "affiliation": "Helmholtz Centre for Environmental Research - UFZ", "name": "Sebastian M\u00fcller" } - ], + ] } \ No newline at end of file From b701d252af7884010237a00e4da443bd73649976 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 15:11:25 +0100 Subject: [PATCH 06/30] meshio 4 compatible --- ogs5py/fileclasses/msh/msh_io.py | 65 ++++++++++++++++++-------------- ogs5py/fileclasses/msh/viewer.py | 2 +- 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/ogs5py/fileclasses/msh/msh_io.py b/ogs5py/fileclasses/msh/msh_io.py index 2c28e3f..3988f65 100755 --- a/ogs5py/fileclasses/msh/msh_io.py +++ b/ogs5py/fileclasses/msh/msh_io.py @@ -643,6 +643,15 @@ def export_mesh( if cell_data_by_id is not None and not isinstance(cell_data_by_id, dict): cell_data_by_id = {"add_data": cell_data_by_id} + # prepare dict + if export_material_id: + cell_data["material_id"] = [] + if export_element_id: + cell_data["element_id"] = [] + if cell_data_by_id is not None: + for data in cell_data_by_id: + cell_data[data] = [] + for elemi, eleme in enumerate(ELEM_NAMES): # skip elements not present in the mesh if eleme not in mesh["elements"]: @@ -651,36 +660,32 @@ def export_mesh( cells[MESHIO_NAMES[elemi]] = dcp(mesh["elements"][eleme]) # export material ID if stated if export_material_id: - cell_data[MESHIO_NAMES[elemi]] = { - "material_id": dcp(mesh["material_id"][eleme]) - } + cell_data["material_id"].append( + np.array(mesh["material_id"][eleme], dtype=np.int32) + ) # export element ID if stated if export_element_id: - if MESHIO_NAMES[elemi] in cell_data: - cell_data[MESHIO_NAMES[elemi]]["element_id"] = dcp( - mesh["element_id"][eleme] - ) - else: - cell_data[MESHIO_NAMES[elemi]] = { - "element_id": dcp(mesh["element_id"][eleme]) - } + cell_data["element_id"].append( + np.array(mesh["element_id"][eleme], dtype=np.int32) + ) # write additional data if cell_data_by_id is not None: - # if material ID was written, the dictionary already exists - if MESHIO_NAMES[elemi] in cell_data: - for data in cell_data_by_id: - cell_data[MESHIO_NAMES[elemi]][data] = cell_data_by_id[ - data - ][mesh["element_id"][eleme]] - # if material ID was not written, create a dictionary - else: - for data in cell_data_by_id: - cell_data[MESHIO_NAMES[elemi]] = { - data: cell_data_by_id[data][mesh["element_id"][eleme]] - } + for data in cell_data_by_id: + cell_data["element_id"].append( + cell_data_by_id[data][mesh["element_id"][eleme]], + ) if not cell_data: cell_data = None + # else: + # # convert cell_data to new meshio standard + # for item in cell_data: + # cell_data[item] = [val for val in cell_data[item].items()] + # print(cell_data) + # for name, data in cell_data.items(): + # print(data) + # for k, values in enumerate(data): + # print(k, values) mesh_out = mio.Mesh( points=points, @@ -741,8 +746,10 @@ def convert_meshio( If there is any "vertex" in the element data, it will be removed. """ nodes = mesh.points - cells = mesh.cells - cell_data = mesh.cell_data + cells = mesh.cells_dict + cell_data = mesh.cell_data_dict + print(cells) + print(cell_data) if not isinstance(import_dim, (set, list, tuple)): import_dim = [import_dim] @@ -770,10 +777,10 @@ def convert_meshio( if elm_e not in cells: continue elements[ELEM_NAMES[elm_i]] = cells[elm_e] - if material_id_name in cell_data[elm_e]: - material_id[ELEM_NAMES[elm_i]] = cell_data[elm_e][material_id_name] - if element_id_name in cell_data[elm_e]: - element_id[ELEM_NAMES[elm_i]] = cell_data[elm_e][element_id_name] + if material_id_name in cell_data: + material_id[ELEM_NAMES[elm_i]] = cell_data[material_id_name][elm_e] + if element_id_name in cell_data: + element_id[ELEM_NAMES[elm_i]] = cell_data[element_id_name][elm_e] if not material_id: material_id = gen_std_mat_id(elements) diff --git a/ogs5py/fileclasses/msh/viewer.py b/ogs5py/fileclasses/msh/viewer.py index 8e2c609..37c783c 100644 --- a/ogs5py/fileclasses/msh/viewer.py +++ b/ogs5py/fileclasses/msh/viewer.py @@ -78,7 +78,7 @@ def show_mesh( # new mayavi scenes mlab.figure() with TemporaryDirectory() as tmpdirname: - vtkfile = os.path.join(tmpdirname, "data.vtu") + vtkfile = os.path.join(tmpdirname, "data.vtk") # export the mesh to the temp vtk file export_mesh( vtkfile, From 19425e3b6cbdeeeb8e50e2053a75434517191dc8 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 15:11:50 +0100 Subject: [PATCH 07/30] use which from shutil --- ogs5py/ogs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ogs5py/ogs.py b/ogs5py/ogs.py index e8e254f..bc64094 100644 --- a/ogs5py/ogs.py +++ b/ogs5py/ogs.py @@ -19,7 +19,6 @@ import time import warnings from copy import deepcopy as dcp -from whichcraft import which import pexpect from pexpect.popen_spawn import PopenSpawn from ogs5py.fileclasses import ( @@ -1100,7 +1099,9 @@ def run_model( """ # look for the standard ogs executable in the standard-path if ogs_exe is None: - check_ogs = which(ogs_name, path=OGS5PY_CONFIG) or which(ogs_name) + check_ogs = shutil.which( + ogs_name, path=OGS5PY_CONFIG + ) or shutil.which(ogs_name) if check_ogs is None: print( "Please put the ogs executable in the default sys path: " From d3a2c7fdc03911c7d813d8528ba1d3cb5f1b35a3 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 15:13:11 +0100 Subject: [PATCH 08/30] setuptools_scm automated versioning --- .travis.yml | 105 ++++++++++++++++++++++++++------------ README.md | 7 ++- docs/requirements.txt | 7 ++- docs/requirements_doc.txt | 1 + docs/source/index.rst | 3 +- requirements.txt | 13 +++-- requirements_setup.txt | 2 + requirements_test.txt | 2 + setup.py | 70 +++++++++++-------------- 9 files changed, 120 insertions(+), 90 deletions(-) create mode 100755 docs/requirements_doc.txt create mode 100755 requirements_setup.txt create mode 100755 requirements_test.txt diff --git a/.travis.yml b/.travis.yml index a6ce2da..77d5c44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,43 +1,82 @@ language: python +python: 3.8 -matrix: - include: - # separate sdist and coverage with py36 on linux - - name: "sdist and coverage" - sudo: required - language: python - python: 3.6 - services: docker - script: - - python -m pip install -U setuptools pytest-cov coveralls - - python setup.py sdist -d dist - - python -m pip install -r requirements.txt - - python -m pytest --cov ogs5py --cov-report term-missing -v tests/ - - python -m coveralls - # universal wheel on 64bit Linux with py36 - - name: "py2.py3 wheel" - sudo: required - language: python - python: 3.6 - services: docker - env: CIBW_BUILD="cp36-*64" +# setuptools-scm needs all tags in order to obtain a proper version +git: + depth: false env: global: + # Note: TWINE_PASSWORD is set in Travis settings - TWINE_USERNAME=geostatframework - - CIBW_BEFORE_BUILD="pip install setuptools" - -script: - # create wheels - - python -m pip install cibuildwheel==1.0.0 - - python -m cibuildwheel --output-dir dist - -after_success: - - python -m pip install twine - - python -m twine upload --verbose --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* - - if [[ $TRAVIS_TAG ]]; then python -m twine upload --verbose --skip-existing dist/*; fi + # skip py27 (EOL) + - CIBW_SKIP="cp27-*" + # update setuptools to latest version + - CIBW_BEFORE_BUILD="pip install -U setuptools" + # testing with cibuildwheel + - CIBW_TEST_REQUIRES=pytest + - CIBW_TEST_COMMAND="pytest -v {project}/tests" notifications: email: recipients: - - info@geostat-framework.org + - info@geostat-framework.org + +before_install: + - | + if [[ "$TRAVIS_OS_NAME" = windows ]]; then + choco install python --version 3.8.0 + export PATH="/c/Python38:/c/Python38/Scripts:$PATH" + # make sure it's on PATH as 'python3' + ln -s /c/Python38/python.exe /c/Python38/python3.exe + fi + +install: + - python3 -m pip install cibuildwheel==1.1.0 + +script: + - python3 -m cibuildwheel --output-dir tmp_dist + +stages: + - test + - coverage + - name: deploy + if: (NOT type IN (pull_request)) AND (repo = GeoStat-Framework/ogs5py) + +jobs: + include: + - stage: test + name: Test on Linux + services: docker + - stage: test + name: Test on MacOS + os: osx + language: generic + - stage: test + name: Test on Windows + os: windows + language: shell + + - stage: coverage + name: Coverage on Linux + services: docker + install: python3 -m pip install .[test] coveralls + script: + - python3 -m pytest --cov ogs5py --cov-report term-missing -v tests/ + - python3 -m coveralls + + # Test Deploy source distribution + - stage: deploy + name: Test Deploy + install: python3 -m pip install -U setuptools wheel twine + script: python3 setup.py sdist --formats=gztar bdist_wheel + after_success: + - python3 -m twine upload --verbose --skip-existing --repository-url https://test.pypi.org/legacy/ dist/* + + # Deploy source distribution + - stage: deploy + name: Deploy to PyPI + if: tag IS present + install: python3 -m pip install -U setuptools wheel twine + script: python3 setup.py sdist --formats=gztar bdist_wheel + after_success: python3 -m twine upload --verbose --skip-existing dist/* diff --git a/README.md b/README.md index cc9953e..5b54afd 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2546767.svg)](https://doi.org/10.5281/zenodo.2546767) [![PyPI version](https://badge.fury.io/py/ogs5py.svg)](https://badge.fury.io/py/ogs5py) -[![Build Status](https://travis-ci.org/GeoStat-Framework/ogs5py.svg?branch=master)](https://travis-ci.org/GeoStat-Framework/ogs5py) +[![Build Status](https://travis-ci.com/GeoStat-Framework/ogs5py.svg?branch=master)](https://travis-ci.org/GeoStat-Framework/ogs5py) [![Coverage Status](https://coveralls.io/repos/github/GeoStat-Framework/ogs5py/badge.svg?branch=master)](https://coveralls.io/github/GeoStat-Framework/ogs5py?branch=master) -[![Documentation Status](https://readthedocs.org/projects/ogs5py/badge/?version=latest)](https://geostat-framework.readthedocs.io/projects/ogs5py/en/latest/?badge=latest) +[![Documentation Status](https://readthedocs.org/projects/ogs5py/badge/?version=stable)](https://geostat-framework.readthedocs.io/projects/ogs5py/en/stable/?badge=stable) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

@@ -149,7 +149,6 @@ model.run_model(ogs_exe="path/to/ogs") - [NumPy >= 1.13.0](https://www.numpy.org) - [Pandas >= 0.23.0](https://pandas.pydata.org/) -- [whichcraft](https://github.com/pydanny/whichcraft) - [meshio](https://github.com/nschloe/meshio) - [lxml](https://github.com/lxml/lxml) - [vtk](https://vtk.org/) @@ -162,7 +161,7 @@ You can contact us via . ## License -[MIT][gpl_link] © 2018-2019 (inspired by Falk Hesse and Miao Jing) +[MIT][gpl_link] © 2018-2020 (inspired by Falk Hesse and Miao Jing) This project is based on [OGSPY][ogspy_link]. diff --git a/docs/requirements.txt b/docs/requirements.txt index 26c63f0..c5a6a23 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,3 @@ -# required for readthedocs.org -numpydoc -# https://stackoverflow.com/a/11704396/6696397 --r ../requirements.txt \ No newline at end of file +-r requirements_doc.txt +-r ../requirements_setup.txt +-r ../requirements.txt diff --git a/docs/requirements_doc.txt b/docs/requirements_doc.txt new file mode 100755 index 0000000..a2954e3 --- /dev/null +++ b/docs/requirements_doc.txt @@ -0,0 +1 @@ +numpydoc diff --git a/docs/source/index.rst b/docs/source/index.rst index 104028a..6c2c20e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -145,7 +145,6 @@ Requirements - `NumPy >= 1.13.0 `_ - `Pandas >= 0.23.0 `_ -- `whichcraft `_ - `meshio `_ - `lxml `_ - `vtk `_ @@ -155,4 +154,4 @@ Requirements License ======= -`MIT `_ © 2019 +`MIT `_ diff --git a/requirements.txt b/requirements.txt index e40b79d..a313df1 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ -numpy>=1.13 -pandas>=0.23.0 -whichcraft -meshio -lxml -vtk -pexpect \ No newline at end of file +numpy>=1.14.5 +pandas>=0.23.2 +meshio>=4.0.3, <5.0 +lxml~=4.0 +pexpect~=4.0 +vtk>=8.1 diff --git a/requirements_setup.txt b/requirements_setup.txt new file mode 100755 index 0000000..80e9200 --- /dev/null +++ b/requirements_setup.txt @@ -0,0 +1,2 @@ +setuptools>=41.0.1 +setuptools_scm>=3.5.0 diff --git a/requirements_test.txt b/requirements_test.txt new file mode 100755 index 0000000..be10813 --- /dev/null +++ b/requirements_test.txt @@ -0,0 +1,2 @@ +pytest-cov>=2.8.0 +pytest>=5.3.0 diff --git a/setup.py b/setup.py index 3fc725f..1d34eaa 100644 --- a/setup.py +++ b/setup.py @@ -2,39 +2,27 @@ """ogs5py: a python API for OpenGeoSys5""" import os -import codecs -import re - from setuptools import setup, find_packages -# find __version__ ############################################################ - - -def read(*parts): - """Read file data.""" - here = os.path.abspath(os.path.dirname(__file__)) - with codecs.open(os.path.join(here, *parts), "r") as fp: - return fp.read() - - -def find_version(*file_paths): - """Find version without importing module.""" - version_file = read(*file_paths) - version_match = re.search( - r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M - ) - if version_match: - return version_match.group(1) - raise RuntimeError("Unable to find version string.") - +HERE = os.path.abspath(os.path.dirname(__file__)) -############################################################################### +with open(os.path.join(HERE, "README.md"), encoding="utf-8") as f: + README = f.read() +with open(os.path.join(HERE, "requirements.txt"), encoding="utf-8") as f: + REQ = f.read().splitlines() +with open(os.path.join(HERE, "requirements_setup.txt"), encoding="utf-8") as f: + REQ_SETUP = f.read().splitlines() +with open(os.path.join(HERE, "requirements_test.txt"), encoding="utf-8") as f: + REQ_TEST = f.read().splitlines() +with open( + os.path.join(HERE, "docs", "requirements_doc.txt"), encoding="utf-8" +) as f: + REQ_DOC = f.read().splitlines() +REQ_DEV = REQ_SETUP + REQ_TEST + REQ_DOC -VERSION = find_version("ogs5py", "_version.py") DOCLINE = __doc__.split("\n")[0] -README = open("README.md").read() CLASSIFIERS = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -49,8 +37,8 @@ def find_version(*file_paths): "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python", - "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering", "Topic :: Software Development", "Topic :: Utilities", @@ -58,12 +46,11 @@ def find_version(*file_paths): setup( name="ogs5py", - version=VERSION, - maintainer="Sebastian Mueller", - maintainer_email="sebastian.mueller@ufz.de", description=DOCLINE, long_description=README, long_description_content_type="text/markdown", + maintainer="Sebastian Mueller", + maintainer_email="sebastian.mueller@ufz.de", author="Sebastian Mueller, Falk Hesse", author_email="info@geostat-framework.org", url="https://github.com/GeoStat-Framework/ogs5py", @@ -71,20 +58,23 @@ def find_version(*file_paths): classifiers=CLASSIFIERS, platforms=["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], include_package_data=True, - install_requires=[ - "numpy>=1.13.0", - "pandas>=0.23.0", # read-routines and formatting - "whichcraft", # search for ogs - "meshio", # import/export external meshes - "lxml", # meshio vtu support - "vtk", # for the readers - "pexpect", # handle command calls - ], + python_requires=">=3.5", + use_scm_version={ + "relative_to": __file__, + "write_to": "ogs5py/_version.py", + "write_to_template": "__version__ = '{version}'", + "local_scheme": "no-local-version", + "fallback_version": "0.0.0.dev0", + }, + install_requires=REQ, + setup_requires=REQ_SETUP, extras_require={ - # "reader": ["vtk"], # optional for reading output "gmsh": ["pygmsh"], # optional for creating gmesh based meshes "show": ["mayavi"], # optional to view a mesh "all": ["pygmsh", "mayavi"], # everything + "doc": REQ_DOC, + "test": REQ_TEST, + "dev": REQ_DEV, }, packages=find_packages(exclude=["tests*", "docs*"]), ) From d135ff8dcc24eeac9af699be61a6ab416e976e7e Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 15:25:37 +0100 Subject: [PATCH 09/30] Travis: only 64bit py35-py37; ref update --- .travis.yml | 5 +++-- CHANGELOG.md | 10 ++++++++++ README.md | 6 +++--- docs/source/index.rst | 2 +- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 77d5c44..4dcea87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,8 @@ env: # Note: TWINE_PASSWORD is set in Travis settings - TWINE_USERNAME=geostatframework # skip py27 (EOL) - - CIBW_SKIP="cp27-*" + - CIBW_BUILD="cp35-* cp36-* cp37-*" + - CIBW_SKIP="*-win32 *-manylinux_i686" # update setuptools to latest version - CIBW_BEFORE_BUILD="pip install -U setuptools" # testing with cibuildwheel @@ -32,7 +33,7 @@ before_install: fi install: - - python3 -m pip install cibuildwheel==1.1.0 + - python3 -m pip install cibuildwheel==1.3.0 script: - python3 -m cibuildwheel --output-dir tmp_dist diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b9ca7b..2a80d8e 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to **ogs5py** will be documented in this file. +## [1.1.0] - 2020-03-22 + +### Bugfixes +* meshio 4 was not compatible +* fixed integer type in exporting meshes with element/material IDs + +### Changes +* drop of py2.7 support + + ## [1.0.5] - 2019-11-18 ### Bugfixes diff --git a/README.md b/README.md index 5b54afd..0981656 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ model.run_model(ogs_exe="path/to/ogs") - [NumPy >= 1.13.0](https://www.numpy.org) - [Pandas >= 0.23.0](https://pandas.pydata.org/) -- [meshio](https://github.com/nschloe/meshio) +- [meshio >= 4.0; <5.0](https://github.com/nschloe/meshio) - [lxml](https://github.com/lxml/lxml) - [vtk](https://vtk.org/) - [pexpect](https://github.com/pexpect/pexpect) @@ -168,5 +168,5 @@ This project is based on [OGSPY][ogspy_link]. [ogspy_link]: https://github.com/fhesze/OGSPY [gpl_link]: https://github.com/GeoStat-Framework/ogs5py/blob/master/LICENSE [ogs5_link]: https://www.opengeosys.org/ogs-5/ -[doc_link]: https://geostat-framework.readthedocs.io/projects/ogs5py/en/latest/ -[tut1_link]: https://geostat-framework.readthedocs.io/projects/ogs5py/en/latest/tutorial_01_pump.html +[doc_link]: https://ogs5py.readthedocs.io/ +[tut1_link]: https://geostat-framework.readthedocs.io/projects/ogs5py/en/stable/tutorial_01_pump.html diff --git a/docs/source/index.rst b/docs/source/index.rst index 6c2c20e..a0b696e 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -145,7 +145,7 @@ Requirements - `NumPy >= 1.13.0 `_ - `Pandas >= 0.23.0 `_ -- `meshio `_ +- `meshio >= 4.0; <5.0 `_ - `lxml `_ - `vtk `_ - `pexpect `_ From 4434a577ecbb3072d1c04ef03a9823385b85c6ea Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 15:40:48 +0100 Subject: [PATCH 10/30] Test skip success checking for the moment --- .travis.yml | 2 +- tests/test_ogs5py.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4dcea87..db1113d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ before_install: fi install: - - python3 -m pip install cibuildwheel==1.3.0 + - python3 -m pip install cibuildwheel==1.0.0 script: - python3 -m cibuildwheel --output-dir tmp_dist diff --git a/tests/test_ogs5py.py b/tests/test_ogs5py.py index 78f3864..cbbd569 100644 --- a/tests/test_ogs5py.py +++ b/tests/test_ogs5py.py @@ -69,7 +69,7 @@ def test_pump(self): ) self.model.write_input() self.success = self.model.run_model(ogs_exe=self.ogs_exe) - self.assertTrue(self.success) + # self.assertTrue(self.success) self.point = self.model.readtec_point(pcs="GROUNDWATER_FLOW") self.time = self.point["owell"]["TIME"] self.head = self.point["owell"]["HEAD"] From 4f6ef58d57bda193ec9a8c3db9c8c26ce0a77329 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 16:35:22 +0100 Subject: [PATCH 11/30] Travis: skip sys-dependent builds --- .travis.yml | 4 ++-- tests/test_ogs5py.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index db1113d..f5adb2d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ env: global: # Note: TWINE_PASSWORD is set in Travis settings - TWINE_USERNAME=geostatframework - # skip py27 (EOL) - - CIBW_BUILD="cp35-* cp36-* cp37-*" + # on py36 tests + - CIBW_BUILD="cp36-*" - CIBW_SKIP="*-win32 *-manylinux_i686" # update setuptools to latest version - CIBW_BEFORE_BUILD="pip install -U setuptools" diff --git a/tests/test_ogs5py.py b/tests/test_ogs5py.py index cbbd569..78f3864 100644 --- a/tests/test_ogs5py.py +++ b/tests/test_ogs5py.py @@ -69,7 +69,7 @@ def test_pump(self): ) self.model.write_input() self.success = self.model.run_model(ogs_exe=self.ogs_exe) - # self.assertTrue(self.success) + self.assertTrue(self.success) self.point = self.model.readtec_point(pcs="GROUNDWATER_FLOW") self.time = self.point["owell"]["TIME"] self.head = self.point["owell"]["HEAD"] From 9d5b9ac02628321f4f5dbf863a2221da1c645eca Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 16:45:21 +0100 Subject: [PATCH 12/30] msh: export bugfix --- ogs5py/fileclasses/msh/msh_io.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/ogs5py/fileclasses/msh/msh_io.py b/ogs5py/fileclasses/msh/msh_io.py index 3988f65..ef3b91b 100755 --- a/ogs5py/fileclasses/msh/msh_io.py +++ b/ogs5py/fileclasses/msh/msh_io.py @@ -671,21 +671,12 @@ def export_mesh( # write additional data if cell_data_by_id is not None: for data in cell_data_by_id: - cell_data["element_id"].append( + cell_data[data].append( cell_data_by_id[data][mesh["element_id"][eleme]], ) if not cell_data: cell_data = None - # else: - # # convert cell_data to new meshio standard - # for item in cell_data: - # cell_data[item] = [val for val in cell_data[item].items()] - # print(cell_data) - # for name, data in cell_data.items(): - # print(data) - # for k, values in enumerate(data): - # print(k, values) mesh_out = mio.Mesh( points=points, From 51e832acf6ac9945a1f08484878f505a5cd5a413 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 16:45:35 +0100 Subject: [PATCH 13/30] travis: skip sys-dep builds pt2 --- .travis.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5adb2d..bdd8375 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,17 +46,17 @@ stages: jobs: include: - - stage: test - name: Test on Linux - services: docker - - stage: test - name: Test on MacOS - os: osx - language: generic - - stage: test - name: Test on Windows - os: windows - language: shell + # - stage: test + # name: Test on Linux + # services: docker + # - stage: test + # name: Test on MacOS + # os: osx + # language: generic + # - stage: test + # name: Test on Windows + # os: windows + # language: shell - stage: coverage name: Coverage on Linux From aa54505b3edfcda74287b14d72a5b4e5a25d0bb8 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 16:48:01 +0100 Subject: [PATCH 14/30] travis: skip sys-dep builds pt3 --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index bdd8375..a1b8c03 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: python -python: 3.8 +python: 3.7 # setuptools-scm needs all tags in order to obtain a proper version git: @@ -39,7 +39,7 @@ script: - python3 -m cibuildwheel --output-dir tmp_dist stages: - - test + # - test - coverage - name: deploy if: (NOT type IN (pull_request)) AND (repo = GeoStat-Framework/ogs5py) From 03a3c0e4ae049b98e128515b89d8a34a34ba72b6 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 16:51:13 +0100 Subject: [PATCH 15/30] no universal wheels --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index c62da7f..f48fdad 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,3 @@ [metadata] description-file = README.md license_file = LICENSE - -[bdist_wheel] -universal = 1 From c1b94a6506c00274620057554c809690d30bc19b Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 17:14:49 +0100 Subject: [PATCH 16/30] remove py2 compatibility --- ogs5py/tools/download.py | 8 +------- ogs5py/tools/types.py | 10 ++-------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/ogs5py/tools/download.py b/ogs5py/tools/download.py index 04028fe..a606e61 100755 --- a/ogs5py/tools/download.py +++ b/ogs5py/tools/download.py @@ -21,13 +21,7 @@ import shutil import tarfile import zipfile - -try: # PY3 - from urllib.request import urlretrieve, urlopen -except ImportError: # PY2 - from urllib import urlretrieve - from urllib2 import urlopen - +from urllib.request import urlretrieve, urlopen import tempfile import platform import lxml.html diff --git a/ogs5py/tools/types.py b/ogs5py/tools/types.py index 0ef942f..263c4d2 100644 --- a/ogs5py/tools/types.py +++ b/ogs5py/tools/types.py @@ -55,16 +55,10 @@ MULTI_FILES """ -import sys import numpy as np -# stringtype for python 2 and 3 -if sys.version_info[0] == 2: - STRTYPE = basestring - """type: base string type""" -else: - STRTYPE = str - """type: base string type""" +STRTYPE = str +"""type: base string type""" # keylists for the gli entries and templates for entries EMPTY_GLI = { From b93716507b53150bfcf07abe7d0bac00f2083d93 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 17:41:26 +0100 Subject: [PATCH 17/30] Travis: check only py37 directly --- .travis.yml | 61 ++++++++++++++++++++++++++-------------------------- CHANGELOG.md | 2 +- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1b8c03..3f0fed2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,14 @@ env: global: # Note: TWINE_PASSWORD is set in Travis settings - TWINE_USERNAME=geostatframework - # on py36 tests - - CIBW_BUILD="cp36-*" - - CIBW_SKIP="*-win32 *-manylinux_i686" - # update setuptools to latest version - - CIBW_BEFORE_BUILD="pip install -U setuptools" - # testing with cibuildwheel - - CIBW_TEST_REQUIRES=pytest - - CIBW_TEST_COMMAND="pytest -v {project}/tests" + # # on py36 tests + # - CIBW_BUILD="cp36-*" + # - CIBW_SKIP="*-win32 *-manylinux_i686" + # # update setuptools to latest version + # - CIBW_BEFORE_BUILD="pip install -U setuptools" + # # testing with cibuildwheel + # - CIBW_TEST_REQUIRES=pytest + # - CIBW_TEST_COMMAND="pytest -v {project}/tests" notifications: email: @@ -33,38 +33,39 @@ before_install: fi install: - - python3 -m pip install cibuildwheel==1.0.0 + - python3 -m pip install .[test] coveralls script: - - python3 -m cibuildwheel --output-dir tmp_dist + - python3 -m pytest --cov ogs5py --cov-report term-missing -v tests/ stages: - # - test - - coverage + - test + # - coverage - name: deploy if: (NOT type IN (pull_request)) AND (repo = GeoStat-Framework/ogs5py) jobs: include: - # - stage: test - # name: Test on Linux - # services: docker - # - stage: test - # name: Test on MacOS - # os: osx - # language: generic - # - stage: test - # name: Test on Windows - # os: windows - # language: shell - - - stage: coverage - name: Coverage on Linux + - stage: test + name: Test on Linux services: docker - install: python3 -m pip install .[test] coveralls - script: - - python3 -m pytest --cov ogs5py --cov-report term-missing -v tests/ - - python3 -m coveralls + after_success: python3 -m coveralls + - stage: test + name: Test on MacOS + os: osx + language: generic + - stage: test + name: Test on Windows + os: windows + language: shell + + # - stage: coverage + # name: Coverage on Linux + # services: docker + # install: python3 -m pip install .[test] coveralls + # script: + # - python3 -m pytest --cov ogs5py --cov-report term-missing -v tests/ + # - python3 -m coveralls # Test Deploy source distribution - stage: deploy diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a80d8e..049f057 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ All notable changes to **ogs5py** will be documented in this file. * fixed integer type in exporting meshes with element/material IDs ### Changes -* drop of py2.7 support +* drop py2.7 support ## [1.0.5] - 2019-11-18 From 7d218dec402fa5c6ae34d3df16f9859f852f5ba4 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 17:45:49 +0100 Subject: [PATCH 18/30] travis: typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3f0fed2..727146b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ script: - python3 -m pytest --cov ogs5py --cov-report term-missing -v tests/ stages: - - test + - test # - coverage - name: deploy if: (NOT type IN (pull_request)) AND (repo = GeoStat-Framework/ogs5py) From f04d0e4ccfad217a51a0ad6082d729748c38a488 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 17:49:25 +0100 Subject: [PATCH 19/30] travis: use py371 on win --- .travis.yml | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 727146b..ee2b6f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,6 @@ env: global: # Note: TWINE_PASSWORD is set in Travis settings - TWINE_USERNAME=geostatframework - # # on py36 tests - # - CIBW_BUILD="cp36-*" - # - CIBW_SKIP="*-win32 *-manylinux_i686" - # # update setuptools to latest version - # - CIBW_BEFORE_BUILD="pip install -U setuptools" - # # testing with cibuildwheel - # - CIBW_TEST_REQUIRES=pytest - # - CIBW_TEST_COMMAND="pytest -v {project}/tests" notifications: email: @@ -26,7 +18,7 @@ notifications: before_install: - | if [[ "$TRAVIS_OS_NAME" = windows ]]; then - choco install python --version 3.8.0 + choco install python --version 3.7.1 export PATH="/c/Python38:/c/Python38/Scripts:$PATH" # make sure it's on PATH as 'python3' ln -s /c/Python38/python.exe /c/Python38/python3.exe @@ -40,7 +32,6 @@ script: stages: - test - # - coverage - name: deploy if: (NOT type IN (pull_request)) AND (repo = GeoStat-Framework/ogs5py) @@ -59,14 +50,6 @@ jobs: os: windows language: shell - # - stage: coverage - # name: Coverage on Linux - # services: docker - # install: python3 -m pip install .[test] coveralls - # script: - # - python3 -m pytest --cov ogs5py --cov-report term-missing -v tests/ - # - python3 -m coveralls - # Test Deploy source distribution - stage: deploy name: Test Deploy From 28a0777501c70f33fbeebf9f993528fb88c415eb Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 17:51:32 +0100 Subject: [PATCH 20/30] travis: typo --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ee2b6f0..c895e87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ before_install: choco install python --version 3.7.1 export PATH="/c/Python38:/c/Python38/Scripts:$PATH" # make sure it's on PATH as 'python3' - ln -s /c/Python38/python.exe /c/Python38/python3.exe + ln -s /c/Python37/python.exe /c/Python37/python3.exe fi install: From 807b09c29be092bac5e89925029c8b4197b87913 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 17:56:32 +0100 Subject: [PATCH 21/30] travis: typo --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c895e87..831a5a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,8 +18,8 @@ notifications: before_install: - | if [[ "$TRAVIS_OS_NAME" = windows ]]; then - choco install python --version 3.7.1 - export PATH="/c/Python38:/c/Python38/Scripts:$PATH" + choco install python --version 3.7.4 + export PATH="/c/Python37:/c/Python37/Scripts:$PATH" # make sure it's on PATH as 'python3' ln -s /c/Python37/python.exe /c/Python37/python3.exe fi From daa4c5b2c88a4dfd43265aabf093e2a2d75984ba Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 18:01:59 +0100 Subject: [PATCH 22/30] Windows: success return of model run always true; BUG --- ogs5py/ogs.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ogs5py/ogs.py b/ogs5py/ogs.py index bc64094..3d9594c 100644 --- a/ogs5py/ogs.py +++ b/ogs5py/ogs.py @@ -1095,7 +1095,7 @@ def run_model( Returns ------- success : bool - State if OGS5 terminated 'normally'. + State if OGS5 terminated 'normally'. (Allways true on Windows.) """ # look for the standard ogs executable in the standard-path if ogs_exe is None: @@ -1179,8 +1179,11 @@ def run_model( child.expect(pexpect.EOF) if sys.platform != "win32": child.close() - self.exitstatus = child.exitstatus - success = self.exitstatus == 0 + self.exitstatus = child.exitstatus + success = self.exitstatus == 0 + else: + # on windows, this exitstatus is wrongly false + success = True # close the output stream out.close() From 2c8cdec12b4eb954970e59e9b7d0ed74caafb726 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 18:08:37 +0100 Subject: [PATCH 23/30] Travis: try py36 on win --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 831a5a4..795aad3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,10 @@ notifications: before_install: - | if [[ "$TRAVIS_OS_NAME" = windows ]]; then - choco install python --version 3.7.4 - export PATH="/c/Python37:/c/Python37/Scripts:$PATH" + choco install python --version 3.6.10 + export PATH="/c/Python36:/c/Python36/Scripts:$PATH" # make sure it's on PATH as 'python3' - ln -s /c/Python37/python.exe /c/Python37/python3.exe + ln -s /c/Python36/python.exe /c/Python36/python3.exe fi install: From 0c7d66bf2033793023a8dbf2b3542788c60f0120 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 18:13:58 +0100 Subject: [PATCH 24/30] travis: py368 is latest py36 version on choco --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 795aad3..4349651 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ notifications: before_install: - | if [[ "$TRAVIS_OS_NAME" = windows ]]; then - choco install python --version 3.6.10 + choco install python --version 3.6.8 export PATH="/c/Python36:/c/Python36/Scripts:$PATH" # make sure it's on PATH as 'python3' ln -s /c/Python36/python.exe /c/Python36/python3.exe From 54189bb31f0857884a57f4ec14ef8a355f406d66 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 18:19:19 +0100 Subject: [PATCH 25/30] Travis: Skip windows due to a VTK BUG --- .travis.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4349651..abb8d17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,14 @@ notifications: recipients: - info@geostat-framework.org -before_install: - - | - if [[ "$TRAVIS_OS_NAME" = windows ]]; then - choco install python --version 3.6.8 - export PATH="/c/Python36:/c/Python36/Scripts:$PATH" - # make sure it's on PATH as 'python3' - ln -s /c/Python36/python.exe /c/Python36/python3.exe - fi +# before_install: +# - | +# if [[ "$TRAVIS_OS_NAME" = windows ]]; then +# choco install python --version 3.7.7 +# export PATH="/c/Python37:/c/Python37/Scripts:$PATH" +# # make sure it's on PATH as 'python3' +# ln -s /c/Python37/python.exe /c/Python37/python3.exe +# fi install: - python3 -m pip install .[test] coveralls @@ -45,10 +45,11 @@ jobs: name: Test on MacOS os: osx language: generic - - stage: test - name: Test on Windows - os: windows - language: shell + # skip windows due to a VTK BUG + # - stage: test + # name: Test on Windows + # os: windows + # language: shell # Test Deploy source distribution - stage: deploy From d2288b1cdc2271ef3acd7b28c81ee68e95873fc1 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 19:14:35 +0100 Subject: [PATCH 26/30] Win: better check for exitstatus --- ogs5py/ogs.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ogs5py/ogs.py b/ogs5py/ogs.py index 3d9594c..f6b505a 100644 --- a/ogs5py/ogs.py +++ b/ogs5py/ogs.py @@ -1180,10 +1180,9 @@ def run_model( if sys.platform != "win32": child.close() self.exitstatus = child.exitstatus - success = self.exitstatus == 0 else: - # on windows, this exitstatus is wrongly false - success = True + self.exitstatus = child.wait() + success = self.exitstatus == 0 # close the output stream out.close() From 9b35c95b2186e7cbf0e5ee1bda772361fc57f8b0 Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 19:20:39 +0100 Subject: [PATCH 27/30] changelog update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 049f057..d88a8b9 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to **ogs5py** will be documented in this file. ### Bugfixes * meshio 4 was not compatible * fixed integer type in exporting meshes with element/material IDs +* better check for OGS5 success on Windows ### Changes * drop py2.7 support From 1e3fdad9c9c270aaf2cb2cfd656b111e46cfa67e Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 19:27:55 +0100 Subject: [PATCH 28/30] update deps --- README.md | 12 ++++++------ docs/source/index.rst | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0981656..220963a 100644 --- a/README.md +++ b/README.md @@ -147,12 +147,12 @@ model.run_model(ogs_exe="path/to/ogs") ## Requirements: -- [NumPy >= 1.13.0](https://www.numpy.org) -- [Pandas >= 0.23.0](https://pandas.pydata.org/) -- [meshio >= 4.0; <5.0](https://github.com/nschloe/meshio) -- [lxml](https://github.com/lxml/lxml) -- [vtk](https://vtk.org/) -- [pexpect](https://github.com/pexpect/pexpect) +- [NumPy >= 1.14.5](https://www.numpy.org) +- [Pandas >= 0.23.2](https://pandas.pydata.org/) +- [meshio >= 4.0.3; <5.0](https://github.com/nschloe/meshio) +- [lxml >= 4.0; <5.0](https://github.com/lxml/lxml) +- [pexpect >= 4.0; <5.0](https://github.com/pexpect/pexpect) +- [vtk >= 8.1](https://vtk.org/) ## Contact diff --git a/docs/source/index.rst b/docs/source/index.rst index a0b696e..9df35e7 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -143,12 +143,12 @@ Otherwise you need to specify the path to the executable within the run command: Requirements ============ -- `NumPy >= 1.13.0 `_ -- `Pandas >= 0.23.0 `_ -- `meshio >= 4.0; <5.0 `_ -- `lxml `_ -- `vtk `_ -- `pexpect `_ +- `NumPy >= 1.14.5 `_ +- `Pandas >= 0.23.2 `_ +- `meshio >= 4.0.3; <5.0 `_ +- `lxml >= 4.0; <5.0 `_ +- `vtk >= 4.0; <5.0 `_ +- `pexpect >= 8.1 `_ License From b240052c3896179122997ff634e5074b0b24d99d Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 19:46:41 +0100 Subject: [PATCH 29/30] Doc: add current year --- docs/source/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 4d69a15..6b97371 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -20,6 +20,7 @@ # NOTE: # pip install sphinx_rtd_theme # is needed in order to build the documentation +import datetime import os import sys @@ -95,8 +96,9 @@ def setup(app): master_doc = "contents" # General information about the project. +curr_year = datetime.datetime.now().year project = "ogs5py" -copyright = "2019, Sebastian Mueller" +copyright = "2019 - {}, Sebastian Mueller".format(curr_year) author = "Sebastian Mueller" # The version info for the project you're documenting, acts as replacement for From c29244ac6b1bb00665eb794ef25eebb797acd6fd Mon Sep 17 00:00:00 2001 From: MuellerSeb Date: Sun, 22 Mar 2020 19:47:59 +0100 Subject: [PATCH 30/30] Doc: typo --- docs/source/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 9df35e7..ecdf5f8 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -147,8 +147,8 @@ Requirements - `Pandas >= 0.23.2 `_ - `meshio >= 4.0.3; <5.0 `_ - `lxml >= 4.0; <5.0 `_ -- `vtk >= 4.0; <5.0 `_ -- `pexpect >= 8.1 `_ +- `pexpect >= 4.0; <5.0 `_ +- `vtk >= 8.1 `_ License