Skip to content

Commit 7278b67

Browse files
authored
docs: don't version files generated from DFNs (#1946)
It does not seem necessary to version LaTeX, Markdown and .dat files which are autogenerated for the documentation. This PR removes them which removes the need to keep them in sync with DFNs. Also some cleanup in the dist scripts and CI workflows.
1 parent 47762d4 commit 7278b67

File tree

435 files changed

+242
-11762
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

435 files changed

+242
-11762
lines changed

.github/workflows/docs.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,9 @@ jobs:
8989
working-directory: usgslatex/usgsLaTeX
9090
run: sudo ./install.sh --all-users
9191

92-
- name: Test building MF6IO LaTeX from DFNs
93-
working-directory: modflow6/distribution
94-
run: pixi run pytest -v build_docs.py::test_build_mf6io_tex_from_dfn
95-
96-
- name: Test building PDFs from LaTeX
97-
working-directory: modflow6/distribution
98-
run: pixi run pytest -v build_docs.py::test_build_pdfs_from_tex
92+
- name: Build MF6IO files from DFNs
93+
working-directory: modflow6
94+
run: pixi run run-mf6ivar
9995

10096
- name: Setup ${{ env.FC }} ${{ env.FC_V }}
10197
uses: fortran-lang/setup-fortran@v1
@@ -172,7 +168,7 @@ jobs:
172168
working-directory: modflow6
173169
run: pixi run sphinx
174170

175-
- name: Upload results
171+
- name: Upload RTD files
176172
uses: actions/upload-artifact@v3
177173
with:
178174
name: rtd-files-for-${{ github.sha }}
@@ -184,7 +180,22 @@ jobs:
184180
modflow6/.build_rtd_docs/_mf6io/
185181
modflow6/.build_rtd_docs/_mf6run/
186182
modflow6/.build_rtd_docs/_static/
187-
183+
184+
- name: Build PDF documents
185+
working-directory: modflow6
186+
run: pixi run build-docs
187+
188+
- name: Upload PDF documents
189+
uses: actions/upload-artifact@v3
190+
with:
191+
name: mf6io.pdf
192+
path: |
193+
modflow6/mf6io.pdf
194+
modflow6/ReleaseNotes.pdf
195+
modflow6/zonebudget.pdf
196+
modflow6/converter_mf5to6.pdf
197+
modflow6/mf6suptechinfo.pdf
198+
modflow6/mf6examples.pdf
188199
189200
rtd_trigger:
190201
name: rtd-trigger

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ html/
118118
xml/
119119
distribution/run-time-comparison.md
120120
doc/ReleaseNotes/run-time-comparison.tex
121+
doc/ReleaseNotes/deprecations.tex
122+
doc/mf6io/mf6ivar/md
123+
doc/mf6io/mf6ivar/tex
121124

122125
# Intel Fortran Visual Studio intermediate files
123126
msvs/*.fdz

DEVELOPER.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Visual Studio installers can be downloaded from the [official website](https://v
196196

197197
*Doxygen & LaTeX*
198198

199-
[Doxygen](https://www.doxygen.nl/index.html) is used to generate the [MODFLOW 6 source code documentation](https://modflow-usgs.github.io/modflow6/). [Graphviz](https://graphviz.org/) is used by doxygen to produce source code diagrams. [LaTeX](https://www.latex-project.org/) is used to generate the MODFLOW 6 release notes and Input/Output documents (docs/mf6io/mf6io.nightlybuild).
199+
[Doxygen](https://www.doxygen.nl/index.html) is used to generate the [MODFLOW 6 source code documentation](https://modflow-usgs.github.io/modflow6/). [Graphviz](https://graphviz.org/) is used by doxygen to produce source code diagrams. [LaTeX](https://www.latex-project.org/) is used to generate the MODFLOW 6 release notes and Input/Output documents.
200200

201201
These programs can be installed from various sources, including by conda, macports, or from individual sources such as https://www.tug.org/. Details about USGS LaTeX libraries can be seen in addition to linux installs in the CI workflow for the docs (`.github/workflows/ci-docs.yml`).
202202

distribution/benchmark.py

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,17 @@
1717

1818
from utils import get_project_root_path
1919

20-
_verify = False
21-
_project_root_path = get_project_root_path()
22-
_examples_repo_path = _project_root_path.parent / "modflow6-examples"
23-
_build_path = _project_root_path / "builddir"
24-
_bin_path = _project_root_path / "bin"
25-
_github_repo = "MODFLOW-USGS/modflow6"
26-
_markdown_file_name = "run-time-comparison.md"
27-
_is_windows = sys.platform.lower() == "win32"
28-
_app_ext = ".exe" if _is_windows else ""
29-
_soext = ".dll" if _is_windows else ".so"
30-
_ostag = (
20+
PROJ_ROOT_PATH = get_project_root_path()
21+
EXAMPLES_REPO_PATH = PROJ_ROOT_PATH.parent / "modflow6-examples"
22+
BUILD_PATH = PROJ_ROOT_PATH / "builddir"
23+
BIN_PATH = PROJ_ROOT_PATH / "bin"
24+
GITHUB_REPO = "MODFLOW-USGS/modflow6"
25+
BENCHMARKS_FILE_NAME = "run-time-comparison.md"
26+
IS_WINDOWS = sys.platform.lower() == "win32"
27+
EXE_EXT = ".exe" if IS_WINDOWS else ""
28+
OSTAG = (
3129
"win64"
32-
if _is_windows
30+
if IS_WINDOWS
3331
else "linux"
3432
if sys.platform.lower().startswith("linux")
3533
else "mac"
@@ -38,10 +36,10 @@
3836

3937
def download_previous_version(output_path: PathLike) -> Tuple[str, Path]:
4038
output_path = Path(output_path).expanduser().absolute()
41-
version = get_latest_version(_github_repo)
42-
distname = f"mf{version}_{_ostag}"
39+
version = get_latest_version(GITHUB_REPO)
40+
distname = f"mf{version}_{OSTAG}"
4341
url = (
44-
f"https://github.com/{_github_repo}"
42+
f"https://github.com/{GITHUB_REPO}"
4543
+ f"/releases/download/{version}/{distname}.zip"
4644
)
4745
download_and_unzip(
@@ -294,7 +292,7 @@ def write_results(
294292
previous_v = get_mf6_version(previous_exe)
295293

296294
# open markdown table
297-
with open(output_path / _markdown_file_name, "w") as f:
295+
with open(output_path / BENCHMARKS_FILE_NAME, "w") as f:
298296
# get version numbers and write header
299297

300298
line = "### Benchmarks\n\n"
@@ -361,14 +359,14 @@ def run_benchmarks(
361359
# print(f"Benchmark results already exist: {results_path}")
362360
# return
363361

364-
exe_name = f"mf6{_app_ext}"
362+
exe_name = f"mf6{EXE_EXT}"
365363
current_exe = current_bin_path / exe_name
366364
previous_exe = previous_bin_path / exe_name
367365

368366
if not current_exe.is_file():
369367
print("Building current MODFLOW 6 development version")
370368
meson_build(
371-
project_path=_project_root_path,
369+
project_path=PROJ_ROOT_PATH,
372370
build_path=build_path,
373371
bin_path=current_bin_path,
374372
)
@@ -418,14 +416,14 @@ def run_benchmarks(
418416
@pytest.mark.skip(reason="for manual testing")
419417
def test_run_benchmarks(tmp_path):
420418
run_benchmarks(
421-
build_path=_build_path,
422-
current_bin_path=_bin_path,
423-
previous_bin_path=_bin_path / "rebuilt",
424-
examples_path=_examples_repo_path / "examples",
419+
build_path=BUILD_PATH,
420+
current_bin_path=BIN_PATH,
421+
previous_bin_path=BIN_PATH / "rebuilt",
422+
examples_path=EXAMPLES_REPO_PATH / "examples",
425423
output_path=tmp_path,
426424
excluded=["previous"],
427425
)
428-
assert (tmp_path / _markdown_file_name).is_file()
426+
assert (tmp_path / BENCHMARKS_FILE_NAME).is_file()
429427

430428

431429
if __name__ == "__main__":
@@ -442,33 +440,33 @@ def test_run_benchmarks(tmp_path):
442440
parser.add_argument(
443441
"--build-path",
444442
required=False,
445-
default=str(_build_path),
443+
default=str(BUILD_PATH),
446444
help="Path to the build workspace",
447445
)
448446
parser.add_argument(
449447
"--current-bin-path",
450448
required=False,
451-
default=str(_bin_path),
449+
default=str(BIN_PATH),
452450
help="Path to the directory to install current version executables",
453451
)
454452
parser.add_argument(
455453
"--previous-bin-path",
456454
required=False,
457-
default=str(_bin_path / "rebuilt"),
455+
default=str(BIN_PATH / "rebuilt"),
458456
help="Path to the directory to install previous version executables",
459457
)
460458
parser.add_argument(
461459
"-o",
462460
"--output-path",
463461
required=False,
464-
default=str(_project_root_path / "distribution" / ""),
462+
default=str(PROJ_ROOT_PATH / "distribution" / ""),
465463
help="Location to create the zip archive",
466464
)
467465
parser.add_argument(
468466
"-e",
469467
"--examples-repo-path",
470468
required=False,
471-
default=str(_project_root_path.parent / "modflow6-examples"),
469+
default=str(PROJ_ROOT_PATH.parent / "modflow6-examples"),
472470
help="Path to the directory with modflow6 examples",
473471
)
474472
args = parser.parse_args()
@@ -481,7 +479,7 @@ def test_run_benchmarks(tmp_path):
481479
examples_repo_path = (
482480
Path(args.examples_repo_path)
483481
if args.examples_repo_path
484-
else _examples_repo_path
482+
else EXAMPLES_REPO_PATH
485483
)
486484

487485
output_path.mkdir(parents=True, exist_ok=True)

0 commit comments

Comments
 (0)