-
Notifications
You must be signed in to change notification settings - Fork 219
Smarter xmlchange #2567
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
Smarter xmlchange #2567
Conversation
c11a347 to
edba864
Compare
5cc7f6a to
7d52ca8
Compare
|
@jgfouca cheyenne crashed again this morning delaying the complete testing we would like to do on this PR. However I was able to do a pretty good subset of that testing last night and I'm pretty satisfied that it's ready to go. Your careful review would be very much appreciated. |
jgfouca
left a comment
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.
I very much like the idea behind the PR. It makes much more sense to manage this in generic_xml. See inline comments.
| return node.xml_element.set(attrib_name, value) | ||
|
|
||
| def pop(self, node, attrib_name): | ||
| expect(not self.read_only, "locked") |
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.
I think you need a needsrewrite set to True here.
scripts/lib/CIME/case/case.py
Outdated
| def read_xml(self): | ||
| if self._env_files_that_need_rewrite: | ||
| expect(False, "Object(s) {} seem to have newer data than the corresponding case file".format(" ".join([env_file.filename for env_file in self._env_files_that_need_rewrite]))) | ||
| # if any self._files.needrewrite: |
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.
Delete?
| self.read_only = read_only | ||
| self.filename = infile | ||
| self.needsrewrite = False | ||
| if infile is None: |
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.
In the read or read_fd function below, you can check if needsrewrite is True, if so, we are about to blow away someone's modifications and should raise an error.
|
Testing complete? |
|
One of the new changes causes FAIL: test_a_createnewcase (main.J_TestCreateNewcase) |
|
Okay that problem is solved. All testing complete. |
Move the flag that indicates an xml file needs to be rewritten from the case object to the individual file objects and before writing a value confirm that that value is not already the same as the file value.
Test suite: scripts_regression_tests.py (running full cesm prealpha test suite in progress)
Test baseline: cesm2_0_alpha10f
Test namelist changes: none
Test status: bit for bit
Addresses #2448
User interface changes?:
Update gh-pages html (Y/N)?:
Code review: @jgfouca