-
Notifications
You must be signed in to change notification settings - Fork 322
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
Reorganizing subset_data.py to follow SE recommendations #1461
Conversation
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.
Thanks for moving forward with these initial steps, @negin513 . I have some minor comments below. In addition:
- It seems like you haven't deleted the original subset_data.py; please delete that file.
Thanks @billsacks for all your comments. I'd answer all the above comments but I did not mark them as resolved. Please mark them as resolved if you think my answers and my fixes were satisfactory. Besides your comments, I have some comments on my code and I am listing them here not to forget about them:
|
77369bb
to
408c604
Compare
This works on #1441 for these specific tools. |
@negin513 we talked about the need to have subset_data and the modify_data python tools to create a user-mod directory that can then be pointed to for create_newcase, which provides a nice workflow. It also makes the workflow for NEON very similar to the workflow for a generic site which helps. Do you want to do that as part of this PR or make that a future change? |
I'd suggest doing that separately, so this PR can get merged and @slevisconsulting can build off of it. |
OK. I think in general for these tools to create a user-mod directory that can then be easily used to create a case is a good thing. I think most of the tools should do that. So the question is should @slevisconsulting scripts create user-mod directories or not? If yes perhaps you should include it here, but if not then we should do it as a future PR. I think his scripts are just modifying a single surface dataset, so perhaps it shouldn't create a user-mod directory. If they are doing more than that though, perhaps they should. |
Thanks to @ekluzek for testing tricky part of the code (modifying surface dataset based on the user flags combination): we separated this section into a single class method called Here we are creating two "dummy" xarray dataset: one mimicking 16 pft dataset and the other is for the 78 pft dataset to check the code behavior for both crop and no crop dataset. In this single PR we added 41 python unit tests which increased the number of CTSM total python unit tests by 80%... |
@ekluzek With the addition of these random xarray dataset testing, I think I have addressed all the comments on this PR. Please let me know if there is anything else remaining.
Thanks again @ekluzek for your help with this PR. |
…ad to make a change in modify_singlept_site_neon.py
I've marked off and made sure all of the check boxes have been addressed. And the query tool shows they are all addressed. gh-pr-query -p 1461 -t -r ESCOMP/CTSM |
Description of changes
This PR is based on a meeting we had with @billsacks @ekluzek and @slevisconsulting. They suggested to add a top level skeleton code called (
subset_data
instead ofsubset_data.py
) and move thesubset_data.py
to CTSM python folder. Next, I created a seperate module file for each class.Specific notes
Contributors other than yourself, if any: @adrifoster
CTSM Issues Fixed (include github issue #):
Partially addresses #1441
Fixes #1436
Fixes #1437
Fixes #1594
Fixes #1606
Are answers expected to change (and if so in what way)?
Any User Interface Changes (namelist or namelist defaults changes)?
Testing performed, if any: tools testing python testing
I checked the subset_data for all neon sites and the results were identical (bit-for-bit) except for the two crop sites (i.e. KONA and STER sites). The crop sites previously had an issue based on #1606.