Skip to content

Commit a435ad9

Browse files
authored
Update README.md
1 parent 9d1d4c4 commit a435ad9

1 file changed

Lines changed: 17 additions & 13 deletions

File tree

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Converts a zip with MODFLOW input files to a zip containing Flopy script in diff
33

44
<img src="https://raw.githubusercontent.com/bdestombe/flopymetascript/master/assets/figures/workflow.png" alt="workflow" style="width:50;height:20">
55

6-
It should work for all packages of MODFLOW, MT3D, and SEAWAT. For a complete list, see the load supported packages in https://github.com/modflowpy/flopy/blob/develop/docs/supported_packages.md .
6+
It should work for all packages of MODFLOW, MT3D, and SEAWAT. For a complete list, see the
7+
[Packages with default values](./wiki_default_parameters.md) and the load supported packages [on the Flopy website](https://github.com/modflowpy/flopy/blob/develop/docs/supported_packages.md).
78

89
No money is to be made by the author with this package. The author has absolutely no convidense in that this script is correct and is not responsible for the content and consequences of malicious scripts. I you find it useful, please consider donating to charity (be creative in choosing which one) and send me a note (or create and close an issue). Thanks! The author is not affiliated with the modflow family nor with Flopy. This converter/generator uses the Flopy load function. Any errors/mistakes in the Flopy load functions propagate to the
910
generated script.
@@ -14,6 +15,7 @@ generated script.
1415
- Add a description (and default value) to your parameters
1516
- Check someone else's MODFLOW input files / Flopy script
1617
- Check homework assignments
18+
- Start from scratch by adding your own packages
1719

1820

1921
# Advantages
@@ -27,7 +29,7 @@ generated script.
2729
# Install
2830
Enter in the terminal,
2931
```bash
30-
$ pip install https://github.com/bdestombe/flopymetascript/zipball/master
32+
$ pip install flopymetascript
3133
```
3234
The `$`-sign should be omitted, and only refers to that the command is to be entered in the bash-commandline. The flopymetascript package added to system's `$PATH` and is reachable from any directory. Check if everything works by typing in any directory,
3335
```bash
@@ -37,13 +39,6 @@ Uninstall with,
3739
```bash
3840
$ pip uninstall flopymetascript
3941
```
40-
Please see https://gehrcke.de/2014/02/distributing-a-python-command-line-application/ for more information on the package structure.
41-
42-
# Supported
43-
Currently only tested with several MODFLOW and SEAWAT models, on a Mac-platform.
44-
45-
# Known issues
46-
-
4742

4843
# Example usage from the commandline:
4944
## With zipfiles
@@ -55,6 +50,7 @@ input.zip is a zip-file that contains MODFLOW input files and a single .nam file
5550
written to output.zip. Some logging is written to log.txt.
5651

5752
## Using pipes
53+
Might be of interest when using flopymetascript as webservice of in docker containers.
5854
```bash
5955
$ openssl base64 -in input.zip -out input.zip.b64
6056
$ flopymetascript --outbytesfile output.zip --inbase64file input.zip.b64
@@ -80,8 +76,6 @@ The log file is printed to stdout.
8076
You cannot send both outbase64file and logfile to stdout. They will be mixed and the resulting output file is not readable.
8177

8278
# Example usage in python
83-
This might need somework and is subject to change in the future.
84-
8579
```python
8680
from flopymetascript.flopymetascript import process
8781

@@ -92,7 +86,7 @@ from flopymetascript.flopymetascript import process
9286
fn = 'input.zip'
9387
inbytesfile = open(fn, 'rb') # Dont forget the b
9488
fn = 'output.zip'
95-
outbytesfile = open(fn, 'rb') # Dont forget the b
89+
outbytesfile = open(fn, 'wb') # Dont forget the b
9690
fn = 'log.txt'
9791
logfile = open(fn, 'w')
9892

@@ -102,9 +96,19 @@ inbytesfile.close()
10296
outbytesfile.close()
10397
logfile.close()
10498
```
99+
or as a module,
100+
```python
101+
from flopymetascript.model import Model
102+
import nbformat
103+
104+
mp = Model(load_nam='path_to_namfile.nam', add_pack=['dis', 'bas6'])
105+
nb = mp.script_model2nb(use_yapf=False, print_descr=True)
106+
fn = 'jupyter_notebook.ipynb'
105107

108+
with open(fn, 'w') as f:
109+
f.write(nbformat.writes(nb))
110+
```
106111

107112
# Todo:
108-
- Add additional packages with default values
109113
- Add a toggle to turn of the parameter description
110114
- Add line width as parameter

0 commit comments

Comments
 (0)