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

docs(rtd): include DFN specification in dev docs #1948

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 20 additions & 2 deletions .build_rtd_docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
dstdir = "_dev"
fpth = "DEVELOPER.md"
src = os.path.join("..", fpth)
dst = os.path.join(dstdir, fpth)
dst = os.path.join(dstdir, fpth.lower())
# clean up an existing _mf6run directory
if os.path.isdir(dstdir):
shutil.rmtree(dstdir)
Expand All @@ -72,7 +72,7 @@
# -- copy contributor docs
fpth = "CONTRIBUTING.md"
src = os.path.join("..", fpth)
dst = os.path.join(dstdir, fpth)
dst = os.path.join(dstdir, fpth.lower())
shutil.copy(src, dst)

# -- copy style guide
Expand All @@ -81,6 +81,24 @@
dst = os.path.join(dstdir, fpth)
shutil.copy(src, dst)

# -- copy DFN spec
fpth = "readme.md"
src = os.path.join("..", "doc", "mf6io", "mf6ivar", fpth)
dst = os.path.join(dstdir, "dfn.md")
shutil.copy(src, dst)

# -- build the deprecations table --------------------------------------------
print("Build the deprecations markdown table")
pth = os.path.join("..", "doc", "mf6io", "mf6ivar")
args = (sys.executable, "deprecations.py")
# run the command
proc = Popen(args, stdout=PIPE, stderr=PIPE, cwd=pth)
stdout, stderr = proc.communicate()
if stdout:
print(stdout.decode("utf-8"))
if stderr:
print("Errors:\n{}".format(stderr.decode("utf-8")))

# -- copy deprecations markdown ---------------------------------------------
print("Copy the deprecations table")
dstdir = "_mf6run"
Expand Down
5 changes: 3 additions & 2 deletions .build_rtd_docs/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This section includes developer instructions and conventions.
:maxdepth: 1
:glob:

_dev/CONTRIBUTING.md
_dev/DEVELOPER.md
_dev/contributing.md
_dev/developer.md
_dev/styleguide.md
_dev/dfn.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ CMakeFiles/
.build_rtd_docs/_mf6io
.build_rtd_docs/_mf6src
.build_rtd_docs/_mf6run
.build_rtd_docs/_dev
latex/
html/
xml/
Expand Down
11 changes: 7 additions & 4 deletions doc/mf6io/mf6ivar/deprecations.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os
from pathlib import Path
from typing import List, Optional, Tuple

from packaging.version import Version

PROJ_ROOT_PATH = Path(__file__).parents[3]
MF6IVAR_PATH = PROJ_ROOT_PATH / "doc" / "mf6io" / "mf6ivar"


def get_deprecations(
dfndir,
Expand Down Expand Up @@ -33,7 +35,7 @@ def get_deprecations(

def create_deprecations_file(dfndir, mddir, verbose):
deprecations = get_deprecations(dfndir)
deps_path = (Path(mddir) / "deprecations.md").absolute()
deps_path = (mddir / "deprecations.md").absolute()
if verbose:
print(f"Found {len(deprecations)} deprecations, writing {deps_path}")
with open(deps_path, "w") as f:
Expand All @@ -50,6 +52,7 @@ def create_deprecations_file(dfndir, mddir, verbose):


if __name__ == "__main__":
dfndir = os.path.join(".", "dfn")
mddir = os.path.join(".", "md")
dfndir = MF6IVAR_PATH / "dfn"
mddir = MF6IVAR_PATH / "md"
mddir.mkdir(exist_ok=True)
create_deprecations_file(dfndir, mddir, verbose=True)
Loading
Loading