Skip to content

Commit 186bc5c

Browse files
authored
Merge pull request #301 from MODFLOW-ORG/v1.9.1
Release 1.9.1
2 parents ecd2e64 + 193e422 commit 186bc5c

File tree

19 files changed

+275
-168
lines changed

19 files changed

+275
-168
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
working-directory: modflow-devtools/autotest
125125
env:
126126
REPOS_PATH: ${{ github.workspace }}
127-
MODFLOW_DEVTOOLS_NO_AUTO_SYNC: 1
127+
MODFLOW_DEVTOOLS_AUTO_SYNC: 0
128128
TEST_DFN_PATH: ${{ github.workspace }}/modflow6/doc/mf6io/mf6ivar/dfn
129129
# use --dist loadfile to so tests requiring pytest-virtualenv run on the same worker
130130
run: uv run pytest -v -n auto --dist loadfile --durations 0 --ignore test_download.py --ignore test_models.py --ignore test_dfns_registry.py

HISTORY.md

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,19 @@
1-
### Version 1.9.0
1+
### Version 1.9.1
22

3-
#### New features
3+
#### Bug fixes
44

5-
* [feat(misc)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/910a1f1d201c262e218da27865b7e9487271e4d2): Add verbose option to set_dir (#258). Committed by wpbonelli on 2025-11-06.
6-
* [feat(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/c8a136872198e1d9f36be74e958d003cdc75f6eb): Improve models API (#268). Committed by wpbonelli on 2026-01-15.
7-
* [feat(programs)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/5e85417270cea1b4e5081d531c8c98b072acc371): Add programs API (#270). Committed by wpbonelli on 2026-01-16.
8-
* [feat(version)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/f9e26de1efdda95d509c0cc0cb1cf886a3f6c278): Add project version management tool (#284). Committed by wpbonelli on 2026-02-13.
9-
* [feat(dfns)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/aa99c56f5bc5fc2e846262d5bb5c6d80dc9d69b9): Improve DFNs API (#271). Committed by wpbonelli on 2026-02-23.
10-
* [feat(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/c430e8b26157e954a5543344b083125dc5b2ed18): Add copy command (#295). Committed by wpbonelli on 2026-02-25.
5+
* [fix(dfn)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/2dd65bf57307aa42a6043aca3e6da8f8253dc4f9): Restore old dfn2toml logic (#299). Committed by wpbonelli on 2026-03-04.
6+
* [fix](https://github.com/MODFLOW-ORG/modflow-devtools/commit/1e94d1bae8d33acf27becce3560bec092922dc35): Fix version comparison, improve autosync behavior (#300). Committed by wpbonelli on 2026-03-04.
117

12-
#### Bug fixes
8+
### Version 1.9.0
9+
10+
#### New features
1311

14-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/d736dfd881cbc39d2fe82180d98d1d2a0130f146): Backwards-compatibility adjustments (#272). Committed by wpbonelli on 2026-01-20.
15-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/a1497797fc9b1a7cf4ed7cd72e43f0b290fd49d4): Miscellaneous fixes (#273). Committed by wpbonelli on 2026-01-21.
16-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/5dce2af85369063d037c58a3bfc12a2e32c74770): Check env var before auto-sync, fix tests (#275). Committed by wpbonelli on 2026-01-23.
17-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/f6cc9bbbcc8577a4384e18159597c128181e3ecf): Exclude output files from registries (#274). Committed by wpbonelli on 2026-01-23.
18-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/5aa924836fe700bb7ccf4c56faeea52b72368bb5): Auto-sync only on api commands (#277). Committed by wpbonelli on 2026-02-10.
19-
* [fix(programs)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/2674176f6151814fa158269478015b1b175ba884): Exe path at program or dist level, add tests, update docs (#281). Committed by wpbonelli on 2026-02-11.
20-
* [fix(programs)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/a9584012258e5ca52be86a7d631da2f0bf10b75c): Multiple fixes/improvements (#282). Committed by wpbonelli on 2026-02-12.
21-
* [fix](https://github.com/MODFLOW-ORG/modflow-devtools/commit/18af51ae53bf1c8fb877620b0fa26e7be28ea210): More fixes/improvements (#283). Committed by wpbonelli on 2026-02-12.
22-
* [fix](https://github.com/MODFLOW-ORG/modflow-devtools/commit/448993522772773ea650206e94185ad8ec72bb83): Multiple fixes (#285). Committed by wpbonelli on 2026-02-20.
23-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/02ab50dac6540191914506329dcc9ef52820f7ff): Fix model registry generation from release assets (#290). Committed by wpbonelli on 2026-02-23.
24-
* [fix(dfn)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/ebaffb9e2d364210789cd003a5654f4d6741436d): Restore dfn module and tests (#291). Committed by wpbonelli on 2026-02-23.
25-
* [fix(tests)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/d83dfa9470c619693c36da2aacd526916141aec1): Fix test branch (#292). Committed by wpbonelli on 2026-02-24.
26-
* [fix(models)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/9dfa972efffe310f5de79fa31cdc0235716edc2c): Don't exclude .obs files when copying input files (#293). Committed by wpbonelli on 2026-02-25.
12+
This release improves the architecture of the models API, decoupling model repositories from devtools and adding a CLI. The improvements should all be backwards-compatible.
2713

28-
#### Refactoring
14+
This release also contains an experimental programs API that can be used to inspect available versions of MODFLOW 6 and related programs, and help with installs, as well as an experimental redesign of the MF6 DFN specification file utilities.
2915

30-
* [refactor(programs)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/bb76dc1c36f235b3e8bd5b10231661081dda7fe9): Multiple programs api improvements (#276). Committed by wpbonelli on 2026-02-09.
31-
* [refactor(registries)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/75c6909a6202da02b30a1b7b5743e75498aa26a7): Leaner model/program registry file contents (#279). Committed by wpbonelli on 2026-02-10.
32-
* [refactor(dependencies)](https://github.com/MODFLOW-ORG/modflow-devtools/commit/fa8c8d9753da38a9a400c0f7d736944d08a3a059): Introduce ecosystem group (#289). Committed by wpbonelli on 2026-02-22.
16+
The aim here is to unify this project's ecosystem management utilities with consistent design and UX once we reach version 2. No breaking changes (and new stuff will stay experimental) for the remainder of 1.x.
3317

3418
### Version 1.8.0
3519

autotest/test_dfns.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
import pytest
55
from packaging.version import Version
66

7-
from modflow_devtools.dfn2toml import convert, is_valid
87
from modflow_devtools.dfns import Dfn, _load_common, load, load_flat
8+
from modflow_devtools.dfns.dfn2toml import convert, is_valid
99
from modflow_devtools.dfns.fetch import fetch_dfns
1010
from modflow_devtools.dfns.schema.v1 import FieldV1
1111
from modflow_devtools.dfns.schema.v2 import FieldV2
1212
from modflow_devtools.markers import requires_pkg
1313

1414
PROJ_ROOT = Path(__file__).parents[1]
15-
DFN_DIR = PROJ_ROOT / "autotest" / "temp" / "dfn"
15+
DFN_DIR = PROJ_ROOT / "autotest" / "temp" / "dfns"
1616
TOML_DIR = DFN_DIR / "toml"
1717
SPEC_DIRS = {1: DFN_DIR, 2: TOML_DIR}
1818
MF6_OWNER = "MODFLOW-ORG"

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
project = "modflow-devtools"
1010
author = "MODFLOW Team"
11-
release = "1.9.0"
11+
release = "1.9.1"
1212

1313
# -- General configuration ---------------------------------------------------
1414
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

docs/md/dev/dfns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ status = get_sync_status()
476476
- **At install time**: Best-effort sync to default refs during package installation (fail silently on network errors)
477477
- **On first use**: If registry cache is empty for requested ref, attempt to sync before raising errors
478478
- **Lazy loading**: Don't sync until DFN access is actually requested
479-
- **Configurable**: Users can disable auto-sync via environment variable: `MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1`
479+
- **Configurable (Experimental)**: Auto-sync is opt-in via environment variable: `MODFLOW_DEVTOOLS_AUTO_SYNC=1` (set to "1", "true", or "yes")
480480

481481
### Source repository integration
482482

@@ -1295,7 +1295,7 @@ dfn.name # attribute access
12951295
5. Implement `sync_dfns()` function
12961296
6. Add registry metadata caching with hash verification
12971297
7. Implement version-controlled registry discovery
1298-
8. Add auto-sync on first use (with opt-out via `MODFLOW_DEVTOOLS_NO_AUTO_SYNC`)
1298+
8. Add auto-sync on first use (opt-in via `MODFLOW_DEVTOOLS_AUTO_SYNC` while experimental)
12991299
9. **Implement `DfnSpec` dataclass** with `Mapping` protocol for single canonical hierarchical representation with flat dict access
13001300

13011301
**CLI and module API** (depends on Registry infrastructure):

docs/md/dev/programs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ status = get_sync_status()
509509

510510
- **At install time**: Best-effort sync during package installation (fail silently on network errors)
511511
- **On first use**: If registry cache is empty, attempt to sync before raising errors
512-
- **Configurable**: Users can disable auto-sync via environment variable: `MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1`
512+
- **Configurable (Experimental)**: Auto-sync is opt-in via environment variable: `MODFLOW_DEVTOOLS_AUTO_SYNC=1` (set to "1", "true", or "yes")
513513

514514
#### Force semantics
515515

docs/md/models.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ python -m modflow_devtools.models cp mf6/example/ex-gwf-twri01 /path/to/workspac
156156
```
157157

158158
The copy command:
159-
- Automatically attempts to sync registries before copying (unless `MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1`)
159+
- Automatically attempts to sync registries before copying (if `MODFLOW_DEVTOOLS_AUTO_SYNC=1`)
160160
- Creates the workspace directory if it doesn't exist
161161
- Copies all input files for the specified model
162162
- Preserves subdirectory structure within the workspace
@@ -316,16 +316,16 @@ mf models clear --force
316316

317317
## Automatic Synchronization
318318

319-
By default, `modflow-devtools` attempts to sync registries:
320-
- On first import (best-effort, fails silently on network errors)
321-
- When accessing models (unless `MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1`)
322-
323-
To disable auto-sync:
319+
Auto-sync is **opt-in** (experimental). To enable:
324320

325321
```bash
326-
export MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1
322+
export MODFLOW_DEVTOOLS_AUTO_SYNC=1 # or "true" or "yes"
327323
```
328324

325+
When enabled, `modflow-devtools` attempts to sync registries:
326+
- On first access (best-effort, fails silently on network errors)
327+
- When accessing models via the API or CLI
328+
329329
Then manually sync when needed:
330330

331331
```bash

docs/md/programs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,17 +347,17 @@ mf programs install mf6 --force
347347
348348
## Automatic Synchronization
349349
350-
By default, `modflow-devtools` attempts to sync registries:
351-
- On first import (best-effort, fails silently on network errors)
352-
- Before installation (unless `MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1`)
353-
- Before listing available programs
354-
355-
To disable auto-sync:
350+
Auto-sync is **opt-in** (experimental). To enable:
356351
357352
```bash
358-
export MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1
353+
export MODFLOW_DEVTOOLS_AUTO_SYNC=1 # or "true" or "yes"
359354
```
360355
356+
When enabled, `modflow-devtools` attempts to sync registries:
357+
- On first access (best-effort, fails silently on network errors)
358+
- Before installation
359+
- Before listing available programs
360+
361361
Then manually sync when needed:
362362
363363
```bash

modflow_devtools/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__author__ = "Joseph D. Hughes"
2-
__date__ = "Feb 25, 2026"
3-
__version__ = "1.9.0"
2+
__date__ = "Mar 05, 2026"
3+
__version__ = "1.9.1"
44
__maintainer__ = "Joseph D. Hughes"
55
__email__ = "jdhughes@usgs.gov"
66
__status__ = "Production"

modflow_devtools/cli.py

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
Root CLI for modflow-devtools.
33
44
Usage:
5+
mf sync
6+
mf dfns sync
7+
mf dfns info
8+
mf dfns list
9+
mf dfns clean
510
mf models sync
611
mf models info
712
mf models list
@@ -17,6 +22,56 @@
1722

1823
import argparse
1924
import sys
25+
import warnings
26+
27+
28+
def _sync_all():
29+
"""Sync all registries (dfns, models, programs)."""
30+
print("Syncing all registries...")
31+
print()
32+
33+
# Sync DFNs
34+
print("=== DFNs ===")
35+
try:
36+
from modflow_devtools.dfns.registry import sync_dfns
37+
38+
registries = sync_dfns()
39+
for registry in registries:
40+
meta = registry.registry_meta
41+
print(f" {registry.ref}: {len(meta.files)} files")
42+
print(f"Synced {len(registries)} DFN registry(ies)")
43+
except Exception as e:
44+
print(f"Error syncing DFNs: {e}")
45+
print()
46+
47+
# Sync Models
48+
print("=== Models ===")
49+
try:
50+
from modflow_devtools.models import ModelSourceConfig
51+
52+
config = ModelSourceConfig.load()
53+
config.sync()
54+
print("Models synced successfully")
55+
except Exception as e:
56+
print(f"Error syncing models: {e}")
57+
print()
58+
59+
# Sync Programs
60+
print("=== Programs ===")
61+
try:
62+
# Suppress experimental warning
63+
with warnings.catch_warnings():
64+
warnings.filterwarnings("ignore", message=".*modflow_devtools.programs.*experimental.*")
65+
from modflow_devtools.programs import ProgramSourceConfig
66+
67+
config = ProgramSourceConfig.load()
68+
config.sync()
69+
print("Programs synced successfully")
70+
except Exception as e:
71+
print(f"Error syncing programs: {e}")
72+
print()
73+
74+
print("All registries synced!")
2075

2176

2277
def main():
@@ -27,6 +82,12 @@ def main():
2782
)
2883
subparsers = parser.add_subparsers(dest="subcommand", help="Available commands")
2984

85+
# Sync subcommand (syncs all APIs)
86+
subparsers.add_parser("sync", help="Sync all registries (dfns, models, programs)")
87+
88+
# DFNs subcommand
89+
subparsers.add_parser("dfns", help="Manage MODFLOW 6 definition files")
90+
3091
# Models subcommand
3192
subparsers.add_parser("models", help="Manage MODFLOW model registries")
3293

@@ -41,7 +102,14 @@ def main():
41102
sys.exit(1)
42103

43104
# Dispatch to the appropriate module CLI with remaining args
44-
if args.subcommand == "models":
105+
if args.subcommand == "sync":
106+
_sync_all()
107+
elif args.subcommand == "dfns":
108+
from modflow_devtools.dfns.__main__ import main as dfns_main
109+
110+
sys.argv = ["mf dfns", *remaining]
111+
sys.exit(dfns_main())
112+
elif args.subcommand == "models":
45113
from modflow_devtools.models.__main__ import main as models_main
46114

47115
# Replace sys.argv to make it look like we called the submodule directly

0 commit comments

Comments
 (0)