Skip to content

Conversation

@samsrabin
Copy link
Member

@samsrabin samsrabin commented May 1, 2025

Description of changes

RegionalCase no longer (necessarily) fails with an error about comparisons not being supported between float and Longitude. It now tries to convert input file longitude values to match _lon_type of --lon1 and --lon2. This is tested with new system tests of subset_data.

This capability required several supporting changes and tests thereof:

  • Add Longitude methods for comparison operators.
  • Make Longitude type work if initialized with lists or arrays.
  • subset_data no longer fails on missing but unused config file sections. E.g., if you didn't say --create-landuse, it won't try to read anything from the config file's landuse section.

Note that RegionalCase will still fail if the input file's longitude values are (a) of an ambiguous type or (b) of a different type than --lon1 and --lon2. It would be good to resolve this, but perhaps that should be saved for a future PR.

Specific notes

Contributors other than yourself, if any: None

CTSM Issues Fixed:

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? No

Does this create a need to change or add documentation? Did you do so? No

Testing performed, if any:
As of 3fa2980:

  • Python unit tests
  • Python system tests
  • clm_pymods suite compared to ctsm5.3.043 (/glade/derecho/scratch/samrabin/tests_0515-105341de/)

@samsrabin samsrabin added bug something is working incorrectly test: python Pass clm_pymods test suite plus Python sys/unit tests before merging labels May 1, 2025
@samsrabin samsrabin self-assigned this May 1, 2025
@samsrabin samsrabin force-pushed the subset-data-lon-3093 branch from eddd7d9 to 443f0ac Compare May 1, 2025 21:02
@samsrabin samsrabin force-pushed the subset-data-lon-3093 branch from 443f0ac to 8797c44 Compare May 1, 2025 21:33
@samsrabin samsrabin changed the base branch from master to b4b-dev May 1, 2025 21:42
@samsrabin samsrabin marked this pull request as ready for review May 1, 2025 22:23
@samsrabin samsrabin changed the title [WIP] Fix Longitude comparison error for regional subset_data Fix Longitude comparison error for regional subset_data May 1, 2025
@samsrabin samsrabin added next this should get some attention in the next week or two. Normally each Thursday SE meeting. PR status: awaiting review Work on this PR is paused while waiting for review. labels May 1, 2025
@samsrabin samsrabin requested a review from adrifoster May 2, 2025 16:21
Copy link
Collaborator

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work. And I think it's a great example of refactoring to improve the code, rather than putting up with brittle code. You add unit and system testing that gives us much more confidence that subset data is working correctly and will continue working.

I do have a bunch of suggestions. As always many I'm flexible on. Some I think will be helpful to do. Some I may be wrong on. So please reach out if you disagree.

Again though, this is a great improvement to our testing for subset_data, and hopefully will catch most future bugs from happening. It gives me so much more confidence in our testing of the important tool of subset_data.

@samsrabin
Copy link
Member Author

samsrabin commented May 7, 2025

Thanks, @ekluzek!

@ekluzek ekluzek removed the PR status: awaiting review Work on this PR is paused while waiting for review. label May 7, 2025
@samsrabin samsrabin removed the request for review from adrifoster May 8, 2025 10:33
@samsrabin samsrabin requested a review from ekluzek May 9, 2025 09:27
samsrabin added 7 commits May 12, 2025 13:49
This ensures that GitHub format workflow fails if only Pylint has errors (i.e., Black passes).
Merge b4bdev 20250509

Updates to the b4b-dev branch since its last merge to master (PRs ESCOMP#3091 ESCOMP#3092), as shown by git log:

- Merge pull request Update docs infrastructure ESCOMP#2809 from samsrabin/update-docs-builder-2
  Update docs infrastructure
- Merge pull request Update externals to cesm3_0_alpha06c ESCOMP#3106 from ekluzek/update_to_alpha06c
  Update externals to cesm3_0_alpha06c
- Merge pull request User control over snow thermal conductivity scheme over glaciers ESCOMP#3072 from wwieder/JordanGlacier
  User control over snow thermal conductivity scheme over glaciers
@samsrabin samsrabin added PR status: awaiting review Work on this PR is paused while waiting for review. and removed next this should get some attention in the next week or two. Normally each Thursday SE meeting. labels May 12, 2025
@ekluzek ekluzek removed the PR status: awaiting review Work on this PR is paused while waiting for review. label May 15, 2025
@samsrabin samsrabin merged commit 7fe40b6 into ESCOMP:b4b-dev May 15, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug something is working incorrectly test: python Pass clm_pymods test suite plus Python sys/unit tests before merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

subset_data: Longitude comparison error

2 participants