-
Notifications
You must be signed in to change notification settings - Fork 313
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
Refactoring of neon_site into tower_site
and neon_site
#2363
Conversation
Just a heads up that I've moved this to point at the new b4b-dev branch instead of master. This should allow it to avoid backlog and get merged sooner once it's ready. |
@ekluzek @adrifoster per our conversation last week, I'm adding you both as reviewers! Note that some changes may be made to pull out NEON-specific or PLUMBER-specific features once the PLUMBER class creation is underway. |
tower_site
and neon_site
tower_site
and neon_site
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.
Cool this is great. Nice start here!
I have a few questions we'll go over in a bit. I'd also like to know how the pylint does with this? And is:
cd python
make all
Clean?
Some of the methods are long and could maybe be broken up to be shorter and also to make them unit-testable. That could also be a future refactoring. I added some notes about that.
I also added some notes about things that look like they could be unit-testable. They might already be, but wanted to ask.
It'll be good to go over this in a bit...
There are some tests for modifying user namelists in I have addressed other comments that relate to what we wanted to do now. Regarding 'make all', I'm hoping to test this but am currently out of scratch space and am thus running into errors... Fred is making room elsewhere for a simulation that's taking up the majority of that space, so hopefully I can test this soon. |
Quick update, I'm currently running into some errors with The following pylint errors are also present:
|
@TeaganKing do you need some help with this or can you continue to figure this out? Maybe we could meet say Friday sometime? The changing out of temp-dir thing you mention is sometimes tricky because you have to do it on the test that's before the one where it breaks. So it might appear in the files you worked with, but it really originates in whatever test was done before yours. Hopefully, that makes sense enough to fix it, but otherwise let's meet later... |
@ekluzek It does look like the temp dir that's causing errors was set up during |
A few additional notes on the
Error details:
Error:
@ekluzek I will reach out to you for some help sorting out these details! |
I wanted to note a few more thoughts on these test failures after meeting with @ekluzek earlier today.
This issue is probably tied to details regarding how our testing is performed, and may require some additional brainstorming with folks who are more familiar with our testing suite. |
I replicated the above behavior in my own sandbox. So it's reproducible. I don't know what might be different inside the Makefile environment than outside, which makes this strange. A previous problem we've run into is that we are removing directory trees, but not making sure that isn't the current directory. So I tried making that update to other places, and it acts the same way. I do see something that does need to be fixed in the main code that I'll add a comment for. I'm doubtful that's the issue, but it is something good to fix. |
I did also notice that with a fresh CTSM checkout, if I use the tower_site.py and other files that I've changed, this fails, but if I use the old files, 'make all' does not fail... So this probably is also a result of splitting up run_neon into multiple classes/files. @ekluzek when you say you tested this in your own sandbox, I assume that is with these code changes specifically rather than the current CTSM code? Specifically moving build_base_case back into neon_site.py results in successful tests. |
@TeaganKing yes exactly. It fails in my sandbox where I checked out your branch, but it passes in master or b4b-dev. I don't think it's really about anything that you did, but something more subtle in the testing. What I'd like to do is to see if we can step through what's going on with a python debugger, or add more print statements to each thing going on to see how the Makefile environment is different from running directly. One guess I have is that Maybe there are different environment variable settings when run from inside the Makefile, than when run outside of make. Just checked that and the Makefile adds the following env settings:
Which doesn't look like it should matter... Sometimes when new code is added the code can be fine, but it exposes an existing problem. This is rare, but when it happens it becomes really hard to track down. |
In a discussion at the CTSM software meeting, we decided to remove the |
Thanks Erik. Just to put everything in one place, I will describe all of the unresolved conversations here. Testing-related issues which we decided to leave as is for now: Testing outside the scope of this work: Further Refactoring: |
Cool, thanks @TeaganKing. I want to get this into b4b-dev so it'll be on the next tag there that we move to main. Which means I need to get it on by tomorrow. So I'll just open those issues talked about above, and close the conversations and all that. I also did some work on the branch to deal with the temporary directory issue, so I'll check that in. It didn't solve it, but should improve the future. So I might as well check that in here. Thanks for the work on this. Looking forward to the next piece here. |
Awesome, thank you Erik! |
…the temporary directory, this is handling for ESCOMP#2405
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.
Resolved all the conversations, so this can be merged in.
Conflicts: .git-blame-ignore-revs python/ctsm/site_and_regional/neon_site.py Also moved changes on HEAD in neon_site to here.. python/ctsm/site_and_regional/tower_site.py
… fix the conflict that ended up being committed, and make sure abort is added
python testing is good and clm_pymods tests on Derecho pass. So merging in. |
Description of changes
This PR will create a TowerSite class which defines common functionalities that are in both NeonSite and Plumber2Site classes. With this structure, we will be able to implement a Plumber2Site class parallel to the NeonSite class that utilizes structure and functionalities in the parent classes.
Contributors other than yourself, if any:
@ekluzek
@adrifoster
CTSM Issues Fixed (include github issue #):
This will address part of #1487
Some work on #2405
Are answers expected to change (and if so in what way)?
No, this PR should be BFB.
Any User Interface Changes (namelist or namelist defaults changes)?
No
Note: I updated the branch I was using, so this is a continuation of the work done in #2344