-
Notifications
You must be signed in to change notification settings - Fork 24
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
Adding CDEPS support #522
Adding CDEPS support #522
Conversation
I might also need to add something to the documentation but I'll check it later. |
Hi @uturuncoglu -- Thank you for this excellent contribution. I know you talked with @christinaholtNOAA about this: She and I also just spoke, and think a good way forward would be for me to add some updates to this PR adding required tests and docs, and to bring things up-to-date with some recent changes on our |
@maddenp-noaa It was impossible without your help. Thanks again. Yes. Your plan looks good to me. Let me know if you need help from my side. I think you could reach to junja2 template etc. from the Gist link that you could find in the description but let me know if you need any help or information. BTW, I saw that you already implemented SCHSIM and also WW3 drivers but those are just accessible via API, is there any plan to make them accessible via CLI too. I only test the CDEPS with CLI but maybe something needs to be added to make it available also through the API. Anyway, let me know what you think? |
@uturuncoglu Could you please add a file
and we can use it for manually testing against the JSON Schema definition. If you could add it to your branch and push it, I can pick it up and work with it. Thanks in advance. |
@maddenp-noaa I included the simple file for CDEPS and also add missing namelist option for CDEPS data ocean. I might have some syntax issue in |
|
@maddenp-noaa BTW, I need to update |
I think I see the issue already, though: The template contains expressions like
i.e. on line 139 of I don't think there's a problem with that, but it does mean that information that Jinja2 doesn't need will be exposed to it (the |
And yes, please, make any appropriate changes to |
@maddenp-noaa Thanks. It fixed in cdeps.py solved the issue. I'll push the fix along with the change in the template soon. |
If we remove that |
Here's the fix patch for the unit tests:
|
@maddenp-noaa Okay. Working on it. I think I also found a bug in the ninja template. Let me fix that one too. Thanks again |
Okay. I pushed the changes. The validate command is fine and no issue. But I am not sure about the cdeps test ninja template. In my case, I change the following part of the ninja template from
to
to produce the namelist |
The unit test for the streams file just ensures that the expected data items are passed to Jinja2, and that a template file that contains references to those data items is rendered correctly. I think that's as far as we can go with the unit tests: It's up to the application to provide a Jinja2 template file that accepts those data items and produces the kind of streams file that the application requires. Our assumption, as expressed by the unit test, is that if the YAML config specifies a Jinja2 |
@maddenp-noaa I think it is fine to UFS Coastal since the config file that I am using is fine. I just want to be sure that the exiting unit test is representative of the realistic case. Is there any way for me to run the unit test for cdeps implementation and check the generated namelist files. |
I'm sure the unit test is not representative of the realistic use case, at least in terms of values. Here's is a namelist file created by the unit test:
The namelist name, and its variable names, and the types of the values should be correct, though. You can temporarily make this change to the test code to observe this:
Then run |
@maddenp-noaa Okay. Do you have also stream namelist output? BTW, when I try to run unites I am getting following error,
I am not sure it is a bug or problem in my side. |
I'm not sure where that
A streams config file created by the unit tests looks like this:
But this isn't really relevant for you, I think, because the test uses a simple, unrealistic Jinja2 template (click this link to view) just to show that YAML config values correctly map to Jinja2 expression variables. You should use your own Jinja2 template file in a realistic |
@maddenp-noaa Okay. That makes sense. Thanks. |
@uturuncoglu When you're comfortable with your testing, there are a few comments under the Files changed tab -- some offer suggestions that you can accept and apply right in the GitHub interface (click Commit suggestion). And I think there's one open-ended question. After suggestions are applied (if you agree with them), and when any conversations are marked resolved, we'll be able to approve and merge this. (You'll likely also need to do a final sync with the main repo, as it has been updated yet again -- we never stop!) |
Co-authored-by: Paul Madden <[email protected]>
Co-authored-by: Paul Madden <[email protected]>
Co-authored-by: Paul Madden <[email protected]>
Co-authored-by: Emily Carpenter <[email protected]>
Co-authored-by: NaureenBharwaniNOAA <[email protected]>
@maddenp-noaa I sync again and merge the suggestions. Let me know if you need anything from my side. |
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 @uturuncoglu and @maddenp-noaa. This is a really nice contribution.
I'll go ahead an merge this. The CI tests failed due to some unformatted code, but I will fix that in my next PR, no worries. |
Synopsis
This PR aims to bring support for CDEPS data model driver. The new driver has CLI support at this point and can be tested with following dummy config file (partly represent realistic case and also fake parameters for data ocean) and ninja templates that can be found in the following Gist repository.
https://gist.github.com/uturuncoglu/b47e084f52698c75e6223b3f9608e526
Once those files are placed, please follow the following steps to generate namelist and stream input files (the path could be different in your end),
Type
Impact
Checklist