Open gold2718 opened 2 years ago
Two comments:
Oops, I twiddled the digits. Fixed in the header.
After reviewing the discussion, I do not think that it is important for us to try to support allowing python code to be placed in SourceMods.
I also agree that there should really not be a reason to include the python scripts in SourceMods
, as theoretically there shouldn't be much "science" that is occurring in those scripts anyways, so if someone is modifying them then they are doing something beyond a simple science calculation or tuning experiment (which in my mind is what SourceMods
was designed for).
That being said, I could see the benefit of allowing the replacement of various XML files (e.g. the registry) in SourceMods, so I would try to keep that functionality, if possible.
I could see the benefit of allowing the replacement of various XML files (e.g. the registry) in SourceMods ...
XML files do not have import
issues so I do not see a problem with preserving this functionality.
However, the CAMDEN build is getting complicated</understatement alert>
and I am having trouble adding the new host model variables created from the namelist XML files to the initialization code (the generated code that checks the variable initialization status). Cleaning up the import
methodology we use can help.
Speaking of that, do you know if all the fun and games with doctest and inspect in cam_autogen.py would still be needed if we could move all the import statements to the top of the module (except perhaps for doctest
)?
Sadly I think so, as a lot of that code is just being used to determine the number of doctest failures to report back to the shell (which allows Github Actions to properly indicate a failed test). To be honest I think I am probably pushing the doctest
framework beyond what is designed for in cam_autogen.py
, and that much of these tests would be better suited as unittest
tests, excluding possibly some small simple tests for some of the local functions that might be needed for complete code coverage.
Also, I should note that I am bringing in some additional modularization and clean-up (e.g. #152) along with the ParamGen changes that will hopefully help somewhat, although I agree that write_init_files.py
is currently the biggest mess (hence any input for issue #145 would be helpful).
In ESMCI/cime#4130, there was a discussion of removing support for python code in SourceMods. This seems like a good idea especially since I am finding it harder and harder to support the search and import process this requires.
Thoughts?