climate_ref.cli.test_cases
#
Test data management commands for diagnostic development.
These commands are intended for developers working on diagnostics and require a source checkout of the project with test data directories available.
fetch_test_data(ctx, provider=None, diagnostic=None, test_case=None, dry_run=False, only_missing=False, force=False)
#
Fetch test data from ESGF for running diagnostic tests.
Downloads full-resolution ESGF data based on diagnostic test_data_spec. Use --provider or --diagnostic to limit scope.
Examples:
ref test-cases fetch # Fetch all test data
ref test-cases fetch --provider ilamb # Fetch ILAMB test data only
ref test-cases fetch --diagnostic ecs # Fetch ECS diagnostic data
ref test-cases fetch --only-missing # Skip test cases with existing catalogs
Source code in packages/climate-ref/src/climate_ref/cli/test_cases.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 | |
list_cases(ctx, provider=None)
#
List test cases for all diagnostics.
Shows which test cases are defined for each diagnostic and their descriptions. Also shows whether catalog and regression data exist for each test case.
Source code in packages/climate-ref/src/climate_ref/cli/test_cases.py
317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | |
run_test_case(ctx, provider, diagnostic=None, test_case=None, output_directory=None, force_regen=False, fetch=False, size_threshold=1.0, dry_run=False, only_missing=False, if_changed=False, clean=False)
#
Run test cases for diagnostics.
Executes diagnostics using pre-defined datasets from the test_data_spec and optionally compares against regression baselines.
Use --provider to select which provider's diagnostics to run (required). Use --diagnostic and --test-case to further narrow the scope.
Examples:
ref test-cases run --provider ilamb # Run all ILAMB test cases
ref test-cases run --provider example --diagnostic global-mean-timeseries
ref test-cases run --provider ilamb --test-case default --fetch
ref test-cases run --provider pmp --only-missing # Skip test cases with regression data
ref test-cases run --provider pmp --if-changed # Only run if catalog changed
Source code in packages/climate-ref/src/climate_ref/cli/test_cases.py
605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 | |