Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: version 1.2.4 #110

Merged
merged 9 commits into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

Python package for compiling MODFLOW-based programs.

### Version 1.2.2
### Version 1.2.4

![pymake continuous integration](https://github.com/modflowpy/pymake/workflows/pymake%20continuous%20integration/badge.svg)
[![codecov](https://codecov.io/gh/modflowpy/pymake/branch/master/graph/badge.svg)](https://codecov.io/gh/modflowpy/pymake)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/fe4275a3cfb84acf9c84aba7b4ae2086)](https://www.codacy.com/gh/modflowpy/pymake/dashboard?utm_source=github.com&utm_medium=referral&utm_content=modflowpy/pymake&utm_campaign=Badge_Grade)
[![Documentation Status](https://readthedocs.org/projects/mfpymake/badge/?version=latest)](https://mfpymake.readthedocs.io/en/latest/?badge=latest)
[![PyPI Version](https://img.shields.io/pypi/v/mfpymake.png)](https://pypi.python.org/pypi/mfpymake)

This is a python package for compiling MODFLOW-based and other Fortran, C, and
C++ programs. The package determines the build order using a directed acyclic
graph and then compiles the source files using GNU compilers (`gcc`, `g++`,
`gfortran`) or Intel compilers (`ifort`, `icc`).
`gfortran`), Clang compilers (`clang`, `clang++`), Intel compilers (`ifort`,
`icl`, `icc`, `mpiifort`), or the CRAY Fortran compiler (`ftn`).

pymake can be run from the command line or it can be called from within python.
By default, pymake sets the optimization level, Fortran flags, C/C++ flags, and
Expand Down Expand Up @@ -59,20 +61,19 @@ The help message identifies required positional arguments and optional
arguments that can be provided to overide default values.

```
usage: __main__.py [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] [-dr] [-sd] [-ff FFLAGS]
[-cf CFLAGS] [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] [--networkx] [--mb]
usage: __main__.py [-h] [-fc {ifort,mpiifort,gfortran,ftn,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] [-dr] [-sd] [-ff FFLAGS] [-cf CFLAGS] [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so]
[-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] [--networkx] [--mb] [-mbd]
srcdir target

This is the pymake program for compiling fortran, c, and c++ source files, such as the source files that come with MODFLOW. The program works by building a directed acyclic graph of the module
dependencies and then compiling the source files in the proper order.
This is the pymake program for compiling fortran, c, and c++ source files, such as the source files that come with MODFLOW. The program works by building a directed acyclic graph of the module dependencies and then compiling the source files in the proper order.

positional arguments:
srcdir Path source directory.
target Name of target to create. (can include path)

optional arguments:
-h, --help show this help message and exit
-fc {ifort,mpiifort,gfortran,none}
-fc {ifort,mpiifort,gfortran,ftn,none}
Fortran compiler to use. (default is gfortran)
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}
C/C++ compiler to use. (default is gcc)
Expand All @@ -85,23 +86,19 @@ optional arguments:
-dr, --dryrun Do not actually compile. Files will be deleted, if --makeclean is used. Does not work yet for ifort. (default is False)
-sd, --subdirs Include source files in srcdir subdirectories. (default is None)
-ff FFLAGS, --fflags FFLAGS
Additional Fortran compiler flags. Fortran compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-ff or --fflags) with a equal
sign (-ff='-O3'). (default is None)
Additional Fortran compiler flags. Fortran compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-ff or --fflags) with a equal sign (-ff='-O3'). (default is None)
-cf CFLAGS, --cflags CFLAGS
Additional C/C++ compiler flags. C/C++ compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-cf or --cflags) with a equal sign
(-cf='-O3'). (default is None)
Additional C/C++ compiler flags. C/C++ compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-cf or --cflags) with a equal sign (-cf='-O3'). (default is None)
-sl {-lc,-lm}, --syslibs {-lc,-lm}
Linker system libraries. Linker libraries should be enclosed in quotes and start with a blank space or separated from the name (-sl or --syslibs) with a equal sign
(-sl='-libgcc'). (default is None)
Linker system libraries. Linker libraries should be enclosed in quotes and start with a blank space or separated from the name (-sl or --syslibs) with a equal sign (-sl='-libgcc'). (default is None)
-mf, --makefile Create a GNU make makefile. (default is False)
-md, --makefile-dir GNU make makefile directory. (default is '.')
-cs COMMONSRC, --commonsrc COMMONSRC
Additional directory with common source files. (default is None)
-ef EXTRAFILES, --extrafiles EXTRAFILES
List of extra source files to include in the compilation. extrafiles can be either a list of files or the name of a text file that contains a list of files. (default is None)
-exf EXCLUDEFILES, --excludefiles EXCLUDEFILES
List of extra source files to exclude from the compilation. excludefiles can be either a list of files or the name of a text file that contains a list of files. (default is
None)
List of extra source files to exclude from the compilation. excludefiles can be either a list of files or the name of a text file that contains a list of files. (default is None)
-so, --sharedobject Create shared object or dll on Windows. (default is False)
-ad APPDIR, --appdir APPDIR
Target path that overides path defined target path (default is None)
Expand All @@ -111,9 +108,10 @@ optional arguments:
--inplace Source files in srcdir are used directly. (default is False)
--networkx Use networkx package to build Directed Acyclic Graph use to determine the order source files are compiled in. (default is False)
--mb, --meson-build Use meson to build executable. (default is False)
-mbd, --mesonbuild-dir
meson directory. (default is '.')

Note that the source directory should not contain any bad or duplicate source files as all source files in the source directory, the common source file directory (srcdir2), and the extra files
(extrafiles) will be built and linked. Files can be excluded by using the excludefiles command line switch.
Note that the source directory should not contain any bad or duplicate source files as all source files in the source directory, the common source file directory (srcdir2), and the extra files (extrafiles) will be built and linked. Files can be excluded by using the excludefiles command line switch.
```

Note that command line arguments for Fortran flags, C/C++ flags, and syslib
Expand Down Expand Up @@ -182,6 +180,7 @@ example scripts include:
* `make_mf2000.py`
* `make_modpath6.py`
* `make_modpath7.py`
* `make_prms.py`
* `make_gsflow.py`
* `make_vs2dt.py`
* `make_mt3d.py`
Expand Down
26 changes: 11 additions & 15 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ The help message identifies required positional arguments and optional
arguments that can be provided to overide default values.

```
usage: __main__.py [-h] [-fc {ifort,mpiifort,gfortran,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] [-dr] [-sd] [-ff FFLAGS]
[-cf CFLAGS] [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so] [-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] [--networkx] [--mb]
usage: __main__.py [-h] [-fc {ifort,mpiifort,gfortran,ftn,none}] [-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}] [-ar {ia32,ia32_intel64,intel64}] [-mc] [-dbl] [-dbg] [-e] [-dr] [-sd] [-ff FFLAGS] [-cf CFLAGS] [-sl {-lc,-lm}] [-mf] [-md] [-cs COMMONSRC] [-ef EXTRAFILES] [-exf EXCLUDEFILES] [-so]
[-ad APPDIR] [-v] [--keep] [--zip ZIP] [--inplace] [--networkx] [--mb] [-mbd]
srcdir target

This is the pymake program for compiling fortran, c, and c++ source files, such as the source files that come with MODFLOW. The program works by building a directed acyclic graph of the module
dependencies and then compiling the source files in the proper order.
This is the pymake program for compiling fortran, c, and c++ source files, such as the source files that come with MODFLOW. The program works by building a directed acyclic graph of the module dependencies and then compiling the source files in the proper order.

positional arguments:
srcdir Path source directory.
target Name of target to create. (can include path)

optional arguments:
-h, --help show this help message and exit
-fc {ifort,mpiifort,gfortran,none}
-fc {ifort,mpiifort,gfortran,ftn,none}
Fortran compiler to use. (default is gfortran)
-cc {gcc,clang,clang++,icc,icl,mpiicc,g++,cl,none}
C/C++ compiler to use. (default is gcc)
Expand All @@ -48,23 +47,19 @@ optional arguments:
-dr, --dryrun Do not actually compile. Files will be deleted, if --makeclean is used. Does not work yet for ifort. (default is False)
-sd, --subdirs Include source files in srcdir subdirectories. (default is None)
-ff FFLAGS, --fflags FFLAGS
Additional Fortran compiler flags. Fortran compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-ff or --fflags) with a equal
sign (-ff='-O3'). (default is None)
Additional Fortran compiler flags. Fortran compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-ff or --fflags) with a equal sign (-ff='-O3'). (default is None)
-cf CFLAGS, --cflags CFLAGS
Additional C/C++ compiler flags. C/C++ compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-cf or --cflags) with a equal sign
(-cf='-O3'). (default is None)
Additional C/C++ compiler flags. C/C++ compiler flags should be enclosed in quotes and start with a blank space or separated from the name (-cf or --cflags) with a equal sign (-cf='-O3'). (default is None)
-sl {-lc,-lm}, --syslibs {-lc,-lm}
Linker system libraries. Linker libraries should be enclosed in quotes and start with a blank space or separated from the name (-sl or --syslibs) with a equal sign
(-sl='-libgcc'). (default is None)
Linker system libraries. Linker libraries should be enclosed in quotes and start with a blank space or separated from the name (-sl or --syslibs) with a equal sign (-sl='-libgcc'). (default is None)
-mf, --makefile Create a GNU make makefile. (default is False)
-md, --makefile-dir GNU make makefile directory. (default is '.')
-cs COMMONSRC, --commonsrc COMMONSRC
Additional directory with common source files. (default is None)
-ef EXTRAFILES, --extrafiles EXTRAFILES
List of extra source files to include in the compilation. extrafiles can be either a list of files or the name of a text file that contains a list of files. (default is None)
-exf EXCLUDEFILES, --excludefiles EXCLUDEFILES
List of extra source files to exclude from the compilation. excludefiles can be either a list of files or the name of a text file that contains a list of files. (default is
None)
List of extra source files to exclude from the compilation. excludefiles can be either a list of files or the name of a text file that contains a list of files. (default is None)
-so, --sharedobject Create shared object or dll on Windows. (default is False)
-ad APPDIR, --appdir APPDIR
Target path that overides path defined target path (default is None)
Expand All @@ -74,9 +69,10 @@ optional arguments:
--inplace Source files in srcdir are used directly. (default is False)
--networkx Use networkx package to build Directed Acyclic Graph use to determine the order source files are compiled in. (default is False)
--mb, --meson-build Use meson to build executable. (default is False)
-mbd, --mesonbuild-dir
meson directory. (default is '.')

Note that the source directory should not contain any bad or duplicate source files as all source files in the source directory, the common source file directory (srcdir2), and the extra files
(extrafiles) will be built and linked. Files can be excluded by using the excludefiles command line switch.
Note that the source directory should not contain any bad or duplicate source files as all source files in the source directory, the common source file directory (srcdir2), and the extra files (extrafiles) will be built and linked. Files can be excluded by using the excludefiles command line switch.
```

Note that command line arguments for Fortran flags, C/C++ flags, and syslib
Expand Down
13 changes: 1 addition & 12 deletions pymake/autotest/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,7 @@
import shutil
import textwrap

try:
import numpy as np
except ModuleNotFoundError:
np = None
import numpy as np

ignore_ext = (
".hds",
Expand Down Expand Up @@ -1057,8 +1054,6 @@ def compare_budget(
except:
msg = "flopy not available - cannot use compare_budget"
raise ValueError(msg)
if np is None:
raise ModuleNotFoundError("install numpy using\n pip install numpy")

# headers
headers = ("INCREMENTAL", "CUMULATIVE")
Expand Down Expand Up @@ -1265,8 +1260,6 @@ def compare_swrbudget(
except:
msg = "flopy not available - cannot use compare_swrbudget"
raise ValueError(msg)
if np is None:
raise ModuleNotFoundError("install numpy using\n pip install numpy")

# headers
headers = ("INCREMENTAL", "CUMULATIVE")
Expand Down Expand Up @@ -1487,8 +1480,6 @@ def compare_heads(
except:
msg = "flopy not available - cannot use compare_heads"
raise ValueError(msg)
if np is None:
raise ModuleNotFoundError("install numpy using\n pip install numpy")

if text2 is None:
text2 = text
Expand Down Expand Up @@ -1885,8 +1876,6 @@ def compare_concs(
except:
msg = "flopy not available - cannot use compare_concs"
raise ValueError(msg)
if np is None:
raise ModuleNotFoundError("install numpy using\n pip install numpy")

# list of valid extensions
valid_ext = ["ucn"]
Expand Down
4 changes: 2 additions & 2 deletions pymake/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__author__ = "Joseph D. Hughes"
__date__ = "December 3, 2022"
__version__ = "1.2.3"
__date__ = "March 2, 2022"
__version__ = "1.2.4"
__maintainer__ = "Joseph D. Hughes"
__email__ = "[email protected]"
__status__ = "Production"
Expand Down
13 changes: 6 additions & 7 deletions pymake/plot/dependency_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@
)
from ..utils._dag import _get_f_nodelist

try:
import pydotplus.graphviz as pydot
except:
pydot = None


def to_pydot(dag, filename="mygraph.png"):
"""Create a png file of a Directed Acyclic Graph
Expand All @@ -44,7 +39,9 @@ def to_pydot(dag, filename="mygraph.png"):

"""
# evaluate if pydot plus is installed
if pydot is None:
try:
import pydotplus.graphviz as pydot
except:
msg_str = make_plots.__module__ + "." + make_plots.__name__
msg = f"pydotplus must be installed to use {msg_str}"
raise ModuleNotFoundError(msg)
Expand Down Expand Up @@ -171,7 +168,9 @@ def make_plots(

"""
# evaluate if pydot plus is installed
if pydot is None:
try:
import pydotplus.graphviz as pydot
except:
msg_str = make_plots.__module__ + "." + make_plots.__name__
msg = f"pydotplus must be installed to use {msg_str}"
raise ModuleNotFoundError(msg)
Expand Down
8 changes: 7 additions & 1 deletion pymake/pymake_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ def _get_arg_dict():
"tag": ("-fc",),
"help": "Fortran compiler to use. (default is gfortran)",
"default": "gfortran",
"choices": ["ifort", "mpiifort", "gfortran", "none"],
"choices": [
"ifort",
"mpiifort",
"gfortran",
"ftn",
"none",
],
"action": None,
},
"cc": {
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[build-system]
# Minimum requirements for the build system to execute
requires = ["setuptools", "wheel"]
requires = [
"setuptools",
"wheel",
"setuptools_scm[toml]>=3.4",
"setuptools_scm_git_archive",
]
build-backend = "setuptools.build_meta"

[tool.black]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from setuptools import setup

setup()
setup(use_scm_version={"fallback_version": "999"})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be moved to pyproject.toml in a new section:

[tool.setuptools_scm]
fallback_version = "999"