Skip to content

Commit 90a3bca

Browse files
committed
Performance optimization with MPASdiag
1 parent d98abba commit 90a3bca

24 files changed

Lines changed: 1741 additions & 1525 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ conda create -n modvx python=3.10 -y
2424
conda activate modvx
2525

2626
# Install dependencies
27-
conda install -y -c conda-forge numpy scipy xarray matplotlib pyyaml
27+
conda install -y -c conda-forge numpy scipy xarray matplotlib pyyaml pytest mpi4py netCDF4 ruff black pluggy coverage pytest-cov cartopy
2828

2929
# Install modvx in development mode
3030
git clone https://github.com/mrixlam/modvx.git
@@ -198,7 +198,7 @@ pytest tests/
198198
Run tests with coverage report:
199199

200200
```bash
201-
pytest --cov=modvx tests/
201+
pytest --cov=modvx tests/ --cov-report=term-missing
202202
```
203203

204204
## License

configs/test_liuz.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,60 @@
44
experiment_name: "liuz_3_3dhyb_asrama_asrmhs_atms2025"
55

66
# MPAS mesh settings (update mpas_grid_file to point to your grid)
7-
mpas_grid_file: "fcst/liuz_3_3dhyb_asrama_asrmhs_atms2025/grid/x1.grid.nc"
7+
mpas_grid_file: "fcst/grids/x1.2621442.static.nc"
88
mpas_remap_resolution: 0.1
99

1010
# Single cycle for testing
1111
initial_cycle_start: "20250613T00"
12-
final_cycle_start: "20250613T00"
12+
final_cycle_start: "20250709T00"
1313

1414
forecast_step_hours: 12
1515
observation_interval_hours: 1
1616
cycle_interval_hours: 24
1717
forecast_length_hours: 240
1818

19-
# Grid
19+
# Specify target resolution for regridding (obs grid in this case)
2020
target_resolution: "obs"
2121

22-
# Single domain for quick test
22+
# List of verification domains
2323
vxdomain:
2424
- "GLOBAL"
2525

26-
# Minimal parameter sweep for testing
26+
# Percentile thresholds for categorical verification
2727
thresholds:
2828
- 90.0
29+
- 95.0
30+
- 97.5
31+
- 99.0
32+
33+
# Window sizes for neighborhood-based verification
2934
window_sizes:
3035
- 1
31-
32-
# Variable names
36+
- 3
37+
- 5
38+
- 7
39+
- 9
40+
- 11
41+
- 13
42+
- 15
43+
44+
# Variable names for obs loading
3345
obs_var_name: "precip"
3446

35-
# Directories (relative to base_dir) — update base_dir for your system
36-
base_dir: "/Users/mrislam/Documents/NCAR/precipvx"
47+
# Directories (relative to base_dir)
48+
base_dir: "/glade/work/mrislam/software/modvx"
3749
fcst_dir: "fcst"
3850
obs_dir: "obs/FIMERG"
3951
mask_dir: "masks"
4052
output_dir: "output"
4153
debug_dir: "debug"
4254

43-
# Obs vintage preference (LTE files for June/July 2025)
55+
# Obs vintage preference (LTE for Late Run, FNL for Final Run)
4456
obs_vintage_preference:
4557
- "FNL"
4658
- "LTE"
4759

48-
# Runtime
60+
# Runtime settings
4961
verbose: true
50-
save_intermediate: false
62+
save_intermediate: true
5163
enable_logs: false

src/modvx/__init__.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1+
#!/usr/bin/env python3
2+
13
"""
2-
modvx — Model Verification Toolkit
3-
====================================
4+
Package entry points and convenience imports for modvx.
45
5-
A community Python package for computing spatial verification metrics
6-
(Fractions Skill Score, RMSE, and more) for gridded forecast experiments
7-
against satellite-based precipitation observations.
6+
This module exposes the primary public classes and helpers that make up the modvx verification toolkit. It provides a concise, importable surface for constructing configurations, building work-units, running parallel processing backends, performing I/O and data validation, computingperformance metrics, and producing plots. Importing from this module is the recommended way for downstream tools to access the canonical API.
87
9-
Classes
10-
-------
11-
TaskManager Orchestrates work-unit enumeration, logging, and execution.
12-
ParallelProcessor MPI-based parallelism via mpi4py (graceful serial fallback).
13-
FileManager All I/O: forecast/observation loading, caching, output writing.
14-
DataValidator Grid preparation, regridding, mask application, QC checks.
15-
PerfMetrics Verification scores (FSS, RMSE, …).
16-
Visualizer Plotting: FSS-vs-lead-time, horizontal precip maps, diffs.
8+
Author: Rubaiat Islam
9+
Institution: Mesoscale & Microscale Meteorology Laboratory, NCAR
10+
Email: mrislam@ucar.edu
11+
Date: February 2026
12+
Version: 1.0.0
1713
"""
1814

1915
__version__ = "0.1.0"
2016

21-
from modvx.config import ModvxConfig, load_config
17+
from modvx.config import ModvxConfig, load_config_from_yaml
2218
from modvx.task_manager import TaskManager
2319
from modvx.parallel import ParallelProcessor
2420
from modvx.file_manager import FileManager
@@ -28,7 +24,7 @@
2824

2925
__all__ = [
3026
"ModvxConfig",
31-
"load_config",
27+
"load_config_from_yaml",
3228
"TaskManager",
3329
"ParallelProcessor",
3430
"FileManager",

0 commit comments

Comments
 (0)