You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev/sdd.md
+36-7Lines changed: 36 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,27 @@
1
1
# FloPy 4 software design description (SDD)
2
2
3
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5
+
6
+
7
+
-[Conceptual model](#conceptual-model)
8
+
-[Object model](#object-model)
9
+
-[`attrs`](#attrs)
10
+
-[`xarray`](#xarray)
11
+
-[`attrs` + `xarray`](#attrs--xarray)
12
+
-[Data types](#data-types)
13
+
-[Records](#records)
14
+
-[Unions](#unions)
15
+
-[Arrays](#arrays)
16
+
-[Lists](#lists)
17
+
-[Developer workflow](#developer-workflow)
18
+
-[IO](#io)
19
+
-[Reading input files](#reading-input-files)
20
+
-[Writing input files](#writing-input-files)
21
+
-[Reading output files](#reading-output-files)
22
+
23
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
24
+
3
25
This is the Software Design Description (SDD) document for FloPy 4, also called *the product*.
4
26
5
27
This document describes a tentative design, focusing on "core" functional requirements. Some attention may be given to architecture, but non-functional requirements are largely out of scope here.
@@ -8,20 +30,27 @@ This document describes a tentative design, focusing on "core" functional requir
8
30
9
31
This document follows MODFLOW 6 terminology where applicable, with modifications/translations where appropriate.
10
32
11
-
Core concepts include:
33
+
MODFLOW 6 is designed as a hierarchy of modular **components**.
34
+
35
+
Components encapsulate related functionality and data. Components may have user-specified configuration and/or data **variables**.
36
+
37
+
Most components must have one particular parent (e.g., models are children of a simulation), but some relax this requirement.
38
+
39
+
Component types include:
40
+
41
+
-**simulation**: MF6's "unit of work", consisting of 1+ (possibly coupled) hydrologic processes
42
+
-**model**: a simulated hydrological process
43
+
-**package**: a subcomponent of a model or simulation
12
44
13
-
-**definition**: defines input format for a single MF6 component
14
-
-**component**: an element of a simulation, e.g. a model/package
15
-
-**variable**: an input variable, e.g. data or configuration
16
-
-**block**: a named collection of input variables
45
+
Certain subsets of packages have distinguishing characteristics. A **stress package** represents a forcing. A **basic package** contains only input variables applying statically to the entire simulation. An **advanced package** contains time-variable (i.e. transient) input data. In some cases, only a single instance of a package is expected — in other cases, arbitrarily many. Packages for which the latter is true are called **multi-packages**.
17
46
18
-
A set of definition files make a complete MODFLOW 6 specification. A definition file specifies exactly one component. Components may have zero or more variables (some exchanges, for instance, have none).
47
+
Components are specified by **definition files**. A **definition** specifies input variables for a single MF6 component. A **block** is a named collection of input variables. A definition file specifies exactly one component. A component may contain zero or more blocks. Each block must contain at least one variable.
19
48
20
49
## Object model
21
50
22
51
The product's main use cases will include creating, manipulating, running, and inspecting MODFLOW 6 simulations (FUNC-3, FUNC-4). It is natural to provide an object-oriented interface in which every MF6 component module will generally have a corresponding class.
23
52
24
-
Component classes will provide access to both **specification** and **data**. It should be straightforward to read a component's specification off its class definition, or to inspect it programmatically (FUNC-21). Likewise it should be easy to retrieve the value of a variable from an instance of a component (FUNC-4).
53
+
Component classes will provide access to both **specification** and **data**— that is, to **form** and **content**, respectively. It should be straightforward to read a component's specification off its class definition, or to inspect it programmatically (FUNC-21). Likewise it should be easy to retrieve the value of a variable from an instance of a component (FUNC-4).
25
54
26
55
There are many ways to implement an object model in Python: dictionaries, named tuples, plain classes, `dataclasses`, etc. There are fewer options if the object model must be self-describing.
0 commit comments