From 17ab765e93a2ba184766ad1842ad938ad7de0abf Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 11 Sep 2024 13:03:21 -0400 Subject: [PATCH 1/6] c4 wip --- docs/dev/c4/containers.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/dev/c4/containers.md diff --git a/docs/dev/c4/containers.md b/docs/dev/c4/containers.md new file mode 100644 index 0000000..65d6253 --- /dev/null +++ b/docs/dev/c4/containers.md @@ -0,0 +1,37 @@ +```mermaid +C4Context + title [Container] FloPy + + Boundary(mf6, "MODFLOW 6"){ + System(src, "Source code",) + System(dfn, "Definition files",) + } + + Boundary(flopy, "FloPy") { + + Boundary(devs, "Developer APIs") { + Person(dev, "Developer", "") + System(fpycodegen, "Code generation") + + Boundary(users, "User APIs") { + Person(user, "User", "") + + System(fpymf6, "MODFLOW 6 module") + System(prepost, "Pre-/post-processing") + System(core, "Core framework") + + Rel(user, fpymf6, "uses") + Rel(user, prepost, "uses") + Rel(fpymf6, core, "imports") + Rel(prepost, core, "imports") + } + } + + Rel(dev, fpycodegen, "invokes") + Rel(dev, src, "develops") + Rel(fpycodegen, dfn, "inspects") + Rel(fpycodegen, fpymf6, "generates") + } + + UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1") +``` \ No newline at end of file From e4bc34d283c67d9a6dce11a7391ce8efc9be385c Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Thu, 12 Sep 2024 16:41:13 -0400 Subject: [PATCH 2/6] suggestions/revisions after review, move to md file --- docs/dev/c4.md | 59 +++++++++++++++++++++++++++++++++++++++ docs/dev/c4/containers.md | 37 ------------------------ 2 files changed, 59 insertions(+), 37 deletions(-) create mode 100644 docs/dev/c4.md delete mode 100644 docs/dev/c4/containers.md diff --git a/docs/dev/c4.md b/docs/dev/c4.md new file mode 100644 index 0000000..8d84e83 --- /dev/null +++ b/docs/dev/c4.md @@ -0,0 +1,59 @@ +# FloPy C4 diagrams + +Documenting a prospective FloPy architecture. + +## Context + +TODO + +## Containers + +```mermaid +C4Context + title [Containers] FloPy + + Enterprise_Boundary(ec, "EC Framework") { + + Boundary(mf6, "MODFLOW 6"){ + SystemDb(dfn, "Definition files") + } + + Boundary(flopy, "FloPy") { + Boundary(devs, "Developer APIs") { + System(fpycodegen, "Code generation") + System(fpycore, "Core framework") + } + Boundary(users, "User APIs") { + System(fpymf6, "MODFLOW 6 module") + System(fpyprepost, "Pre-/post-processing") + } + Rel(fpymf6, fpycore, "imports") + Rel(fpyprepost, fpycore, "imports") + + Rel(fpycodegen, dfn, "inspects") + Rel(fpycodegen, fpymf6, "generates") + } + + Person(dev, "Developer", "") + Person(user, "User", "") + + Rel(dev, dfn, "develops") + Rel(dev, fpycodegen, "uses") + Rel(user, fpymf6, "uses") + Rel(user, fpyprepost, "uses") + UpdateRelStyle(dev, dfn, $lineColor="blue", $offsetY="-30") + UpdateRelStyle(dev, fpycodegen, $lineColor="blue", $offsetY="50") + UpdateRelStyle(user, fpymf6, $lineColor="blue", $offsetY="50") + UpdateRelStyle(user, fpyprepost, $lineColor="blue", $offsetY="50") + } + + UpdateLayoutConfig($c4ShapeInRow="5", $c4BoundaryInRow="5") +``` + +## Components + +TODO + +## Code + +TODO \ No newline at end of file diff --git a/docs/dev/c4/containers.md b/docs/dev/c4/containers.md deleted file mode 100644 index 65d6253..0000000 --- a/docs/dev/c4/containers.md +++ /dev/null @@ -1,37 +0,0 @@ -```mermaid -C4Context - title [Container] FloPy - - Boundary(mf6, "MODFLOW 6"){ - System(src, "Source code",) - System(dfn, "Definition files",) - } - - Boundary(flopy, "FloPy") { - - Boundary(devs, "Developer APIs") { - Person(dev, "Developer", "") - System(fpycodegen, "Code generation") - - Boundary(users, "User APIs") { - Person(user, "User", "") - - System(fpymf6, "MODFLOW 6 module") - System(prepost, "Pre-/post-processing") - System(core, "Core framework") - - Rel(user, fpymf6, "uses") - Rel(user, prepost, "uses") - Rel(fpymf6, core, "imports") - Rel(prepost, core, "imports") - } - } - - Rel(dev, fpycodegen, "invokes") - Rel(dev, src, "develops") - Rel(fpycodegen, dfn, "inspects") - Rel(fpycodegen, fpymf6, "generates") - } - - UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1") -``` \ No newline at end of file From d9773211296ab6dfbf644af03d9fa57050bda8f5 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Thu, 12 Sep 2024 21:29:13 -0400 Subject: [PATCH 3/6] draft context diagram, misc updates --- docs/dev/c4.md | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/docs/dev/c4.md b/docs/dev/c4.md index 8d84e83..57212e7 100644 --- a/docs/dev/c4.md +++ b/docs/dev/c4.md @@ -1,16 +1,44 @@ # FloPy C4 diagrams -Documenting a prospective FloPy architecture. +Documenting prospective FloPy architecture. ## Context -TODO +```mermaid +C4Context + title [Context] FloPy / MF6 + + Enterprise_Boundary(ec, "EC Framework") { + Person(hydrologist, "Hydrologist", "determines optimal pumping rate for well field") + Person(student, "Student", "simulates salt water intrusion in coastal aquifer") + Person(professor, "Professor", "teaches groundwater modeling course") + Person(institution, "Lab/Institution", "maintains pre-/post-processing extensions") + Person(developer, "Developer", "debugs issues, develops features/models") + + System(flopy, "FloPy") + System(mf6, "MODFLOW 6") + + Rel(flopy, mf6, "wraps") + Rel(hydrologist, flopy, "uses") + Rel(student, flopy, "uses") + Rel(professor, flopy, "uses") + Rel(institution, flopy, "extends") + Rel(developer, flopy, "develops") + UpdateRelStyle(hydrologist, flopy, $lineColor="blue") + UpdateRelStyle(student, flopy, $lineColor="blue") + UpdateRelStyle(professor, flopy, $lineColor="blue") + UpdateRelStyle(institution, flopy, $lineColor="blue", $offsetX="-190", $offsetY="10") + UpdateRelStyle(developer, flopy, $lineColor="blue") + + } + +``` ## Containers ```mermaid -C4Context - title [Containers] FloPy +C4Container + title [Containers] FloPy / MF6 Enterprise_Boundary(ec, "EC Framework") { @@ -21,7 +49,7 @@ C4Context Boundary(flopy, "FloPy") { Boundary(devs, "Developer APIs") { System(fpycodegen, "Code generation") - System(fpycore, "Core framework") + System(fpycore, "Object/data model") } Boundary(users, "User APIs") { System(fpymf6, "MODFLOW 6 module") @@ -38,13 +66,16 @@ C4Context Person(user, "User", "") Rel(dev, dfn, "develops") + Rel(dev, fpycore, "develops") Rel(dev, fpycodegen, "uses") Rel(user, fpymf6, "uses") Rel(user, fpyprepost, "uses") - UpdateRelStyle(dev, dfn, $lineColor="blue", $offsetY="-30") + UpdateRelStyle(dev, dfn, $lineColor="blue", $offsetX="-20" $offsetY="-30") + UpdateRelStyle(dev, fpycore, $lineColor="blue", $offsetY="90") UpdateRelStyle(dev, fpycodegen, $lineColor="blue", $offsetY="50") UpdateRelStyle(user, fpymf6, $lineColor="blue", $offsetY="50") UpdateRelStyle(user, fpyprepost, $lineColor="blue", $offsetY="50") + UpdateRelStyle(user, fpycore, $lineColor="blue", $offsetX="-20" $offsetY="-10") } UpdateLayoutConfig($c4ShapeInRow="5", $c4BoundaryInRow="5") From 3be44bc73969e5a88cdcd95be0ad1bb163478371 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Fri, 13 Sep 2024 23:10:44 -0400 Subject: [PATCH 4/6] draft some component diagrams --- docs/dev/c4.md | 55 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/docs/dev/c4.md b/docs/dev/c4.md index 57212e7..5ca9643 100644 --- a/docs/dev/c4.md +++ b/docs/dev/c4.md @@ -2,8 +2,6 @@ Documenting prospective FloPy architecture. -## Context - ```mermaid C4Context title [Context] FloPy / MF6 @@ -34,8 +32,6 @@ C4Context ``` -## Containers - ```mermaid C4Container title [Containers] FloPy / MF6 @@ -49,7 +45,7 @@ C4Container Boundary(flopy, "FloPy") { Boundary(devs, "Developer APIs") { System(fpycodegen, "Code generation") - System(fpycore, "Object/data model") + System(fpycore, "Core framework") } Boundary(users, "User APIs") { System(fpymf6, "MODFLOW 6 module") @@ -81,10 +77,51 @@ C4Container UpdateLayoutConfig($c4ShapeInRow="5", $c4BoundaryInRow="5") ``` -## Components +```mermaid +C4Component + title [Component] FloPy core framework + + Container(fpyprepost, "Pre-/post-processing") + Container(fpycodegen, "Code generation") + Container(fpymf6, "MF6 Module") -TODO + Container_Boundary(fpycore, "Core framework") { + Component(dis, "Discretization") + Component(idm, "Input contexts") + Component(io, "De/serialization") + } + + Rel(fpyprepost, dis, "imports") + Rel(fpyprepost, idm, "imports") + Rel(fpycodegen, idm, "uses") + Rel(fpycodegen, fpymf6, "generates") + Rel(fpymf6, dis, "import") + Rel(fpymf6, idm, "imports") + Rel(fpymf6, io, "imports") +``` -## Code +```mermaid +C4Component + title [Component] FloPy code generation -TODO \ No newline at end of file + Container_Boundary(fpycodegen, "Code generation") { + Component(templates, "Jinja templates") + Component(genscript, "Generate script") + } + + Container_Boundary(fpymf6, "MF6 module") { + Component(comp1, "IDM component 1") + Component(comp2, "IDM component 2") + } + + Container_Boundary(fpycore, "Core framework") { + Component(ctx, "Input contexts") + } + + Rel(genscript, templates, "uses") + Rel(genscript, comp1, "creates") + Rel(genscript, comp2, "creates") + Rel(genscript, ctx, "uses") + Rel(comp1, ctx, "imports") + Rel(comp2, ctx, "imports") +``` From 9127a57254ecaac0edb4426ced4634970b488764 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Tue, 17 Sep 2024 13:07:32 -0400 Subject: [PATCH 5/6] draft external connections diagram --- docs/dev/c4.md | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/docs/dev/c4.md b/docs/dev/c4.md index 5ca9643..1093afe 100644 --- a/docs/dev/c4.md +++ b/docs/dev/c4.md @@ -77,6 +77,48 @@ C4Container UpdateLayoutConfig($c4ShapeInRow="5", $c4BoundaryInRow="5") ``` +```mermaid +C4Container + title [Containers] FloPy external connections + + Boundary(flopy, "FloPy"){ + System(exs, "Examples API") + System(gen, "Code generation") + System(imp, "Data import") + System(exp, "Data export") + } + + Boundary(github, "GitHub") { + System(mf6, "MODFLOW 6") + System(mf6exs, "MODFLOW 6 examples") + } + + Boundary(blob, "Storage") { + System(aws, "Amazon S3") + System(abs, "Azure Blob Storage") + System(gcs, "Google Cloud Storage") + System(hdfs, "HDFS") + System(web, "File server") + System(net, "Network file system") + } + + Boundary(usgs, "USGS") { + System(scibase, "ScienceBase") + } + + Rel(gen, mf6, "retrieves DFNs") + Rel(exs, mf6exs, "loads models (e.g. with Pooch)") + Rel(imp, aws, "loads data") + Rel(imp, abs, "") + Rel(imp, gcs, "") + Rel(imp, hdfs, "") + Rel(imp, web, "") + Rel(imp, net, "") + Rel(exp, scibase, "loads metadata") + + UpdateRelStyle(gen, mf6, $offsetX="-20") +``` + ```mermaid C4Component title [Component] FloPy core framework @@ -106,7 +148,7 @@ C4Component Container_Boundary(fpycodegen, "Code generation") { Component(templates, "Jinja templates") - Component(genscript, "Generate script") + Component(genscript, "Generator script") } Container_Boundary(fpymf6, "MF6 module") { @@ -124,4 +166,4 @@ C4Component Rel(genscript, ctx, "uses") Rel(comp1, ctx, "imports") Rel(comp2, ctx, "imports") -``` +``` \ No newline at end of file From 55a78385b58d436a77a85e2eb73e9ae49ad84cd4 Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Wed, 2 Oct 2024 22:50:30 -0400 Subject: [PATCH 6/6] remove external connections and core framework diagrams (questionable utility) --- docs/dev/c4.md | 65 -------------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/docs/dev/c4.md b/docs/dev/c4.md index 1093afe..7a5594c 100644 --- a/docs/dev/c4.md +++ b/docs/dev/c4.md @@ -77,71 +77,6 @@ C4Container UpdateLayoutConfig($c4ShapeInRow="5", $c4BoundaryInRow="5") ``` -```mermaid -C4Container - title [Containers] FloPy external connections - - Boundary(flopy, "FloPy"){ - System(exs, "Examples API") - System(gen, "Code generation") - System(imp, "Data import") - System(exp, "Data export") - } - - Boundary(github, "GitHub") { - System(mf6, "MODFLOW 6") - System(mf6exs, "MODFLOW 6 examples") - } - - Boundary(blob, "Storage") { - System(aws, "Amazon S3") - System(abs, "Azure Blob Storage") - System(gcs, "Google Cloud Storage") - System(hdfs, "HDFS") - System(web, "File server") - System(net, "Network file system") - } - - Boundary(usgs, "USGS") { - System(scibase, "ScienceBase") - } - - Rel(gen, mf6, "retrieves DFNs") - Rel(exs, mf6exs, "loads models (e.g. with Pooch)") - Rel(imp, aws, "loads data") - Rel(imp, abs, "") - Rel(imp, gcs, "") - Rel(imp, hdfs, "") - Rel(imp, web, "") - Rel(imp, net, "") - Rel(exp, scibase, "loads metadata") - - UpdateRelStyle(gen, mf6, $offsetX="-20") -``` - -```mermaid -C4Component - title [Component] FloPy core framework - - Container(fpyprepost, "Pre-/post-processing") - Container(fpycodegen, "Code generation") - Container(fpymf6, "MF6 Module") - - Container_Boundary(fpycore, "Core framework") { - Component(dis, "Discretization") - Component(idm, "Input contexts") - Component(io, "De/serialization") - } - - Rel(fpyprepost, dis, "imports") - Rel(fpyprepost, idm, "imports") - Rel(fpycodegen, idm, "uses") - Rel(fpycodegen, fpymf6, "generates") - Rel(fpymf6, dis, "import") - Rel(fpymf6, idm, "imports") - Rel(fpymf6, io, "imports") -``` - ```mermaid C4Component title [Component] FloPy code generation