-
Notifications
You must be signed in to change notification settings - Fork 219
address pio issues #4925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
address pio issues #4925
Changes from 1 commit
1679740
3f41b69
5882bd5
4c84023
20ffc33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||
| """ | ||||||||||||||
| Interface to the env_run.xml file. This class inherits from EnvBase | ||||||||||||||
| """ | ||||||||||||||
| from itertools import zip_longest | ||||||||||||||
| from CIME.XML.standard_module_setup import * | ||||||||||||||
|
|
||||||||||||||
| from CIME.XML.env_base import EnvBase | ||||||||||||||
|
|
@@ -66,5 +67,45 @@ def set_value(self, vid, value, subgroup=None, ignore_type=False): | |||||||||||||
| self._pio_async_interface[comp] = convert_to_type( | ||||||||||||||
| value, "logical", vid | ||||||||||||||
| ) | ||||||||||||||
| # PIO_NETCDF_FORMAT=64bit_data is not compatible with PIO_TYPENAME=netcdf4p | ||||||||||||||
| # make sure that this combination of options is not set | ||||||||||||||
| if "PIO_TYPENAME" in vid or "PIO_NETCDF_FORMAT" in vid: | ||||||||||||||
| nvid, comp, iscompvar = self.check_if_comp_var(vid, None) | ||||||||||||||
| pio_netcdf_formats = [] | ||||||||||||||
| pio_typenames = [] | ||||||||||||||
|
|
||||||||||||||
| if nvid == "PIO_TYPENAME": | ||||||||||||||
| if comp: | ||||||||||||||
| pio_netcdf_formats = [ | ||||||||||||||
| self.get_value("PIO_NETCDF_FORMAT_{}".format(comp.upper())) | ||||||||||||||
| ] | ||||||||||||||
| else: | ||||||||||||||
| pio_netcdf_formats = self.get_values("PIO_NETCDF_FORMAT") | ||||||||||||||
| pio_typenames = [value] | ||||||||||||||
| elif nvid == "PIO_NETCDF_FORMAT": | ||||||||||||||
| if comp: | ||||||||||||||
| pio_typenames = [ | ||||||||||||||
| self.get_value("PIO_TYPENAME_{}".format(comp.upper())) | ||||||||||||||
| ] | ||||||||||||||
|
||||||||||||||
| else: | ||||||||||||||
| pio_typenames = self.get_values("PIO_TYPENAME") | ||||||||||||||
| pio_netcdf_formats = [value] | ||||||||||||||
|
|
||||||||||||||
|
||||||||||||||
| # If either list is empty, we cannot perform a meaningful compatibility | |
| # check. In that case, skip the check and proceed with setting the value. | |
| if not pio_netcdf_formats or not pio_typenames: | |
| return EnvBase.set_value(self, vid, value, subgroup, ignore_type) |
jedwards4b marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Copilot
AI
Jan 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new validation logic for incompatible PIO_TYPENAME and PIO_NETCDF_FORMAT combinations lacks test coverage. Given that this repo has comprehensive automated testing (as seen in the CIME/tests directory), consider adding unit tests to verify that:
- The validation correctly prevents setting netcdf4p/netcdf4c with 64bit_data format
- The validation works for both component-specific and general PIO settings
- Edge cases like None values or empty lists are handled properly
- The validation allows valid combinations to pass through
Uh oh!
There was an error while loading. Please reload this page.