Skip to content

Commit b5ed7be

Browse files
authored
docs(sdd): update conceptual model (#80)
close #79, also add a TOC
1 parent 442c02e commit b5ed7be

File tree

1 file changed

+36
-7
lines changed

1 file changed

+36
-7
lines changed

docs/dev/sdd.md

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# FloPy 4 software design description (SDD)
22

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+
325
This is the Software Design Description (SDD) document for FloPy 4, also called *the product*.
426

527
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
830

931
This document follows MODFLOW 6 terminology where applicable, with modifications/translations where appropriate.
1032

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
1244

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 &mdash; in other cases, arbitrarily many. Packages for which the latter is true are called **multi-packages**.
1746

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.
1948

2049
## Object model
2150

2251
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.
2352

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** &mdash; 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).
2554

2655
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.
2756

0 commit comments

Comments
 (0)