Skip to content
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

Develop specact depend #150

Merged

Conversation

rburghol
Copy link
Contributor

@rburghol rburghol commented Apr 12, 2024

@PaulDudaRESPEC
This push has 12 file changes in here, which look a bit voluminous, but the reality is that 2 Are clean-up, removing "test" functions, and old debug print statement (.gitignore and SPECL.py).

The rest are as follows:

  • main.py - functionalized a block of code that sets up STATE variables for eligible domain variables (like HYDR and SEDTRN), and called new functions to take their place.
  • om.py - added function to do dependency ordering for a given domain, i.e., model_domain_dependencies(), and tidied up some variable creation routines.
  • om_model_linkage.py - cleaned up some test code and added a new linkage type (not used in this implementation)
  • om_model_object.py - new function to create the end-point for things like RSED4, IVOL etc. Also added a class for ModelRegister tho that is unused at this point.
  • om_special_action.py - small change to create a ModelConstant to insure that the dependency endpoint can be found by model_domain_dependencies() (it feels wierd to call somethign a "constant" that is bein changed, but rather than create a superfluous class like 'ModelVariable' I opted to re-use Constant. We can change if it seems wrong).
  • HYDR.py - refactored function hydr_init_ix() to clean up arguments
  • state.py - code clarity clean up and new function state_init_hsp2() called from main.py
  • SEDTRN.py
    • SEDTRN now has the first implementation of the "domain dependency order", so that only those operational components affecting SEDTRN related variables are executed, and refactored function sedtrn_init_ix() to clean up arguments.
  • test10.uci - This UCI (based on our email exchange) has 3 SPEC-ACTIONS all pointing at a single reach (RCHRES 5), and thus, only 3 operational model components are executed during the SEDTRN pass through RCHRES 5, and ignored during other
  • check_depends_endpoint.py - A new test script added to explore this functionality is included at Single Component Dependency end-point function #133 so that you can see the ordering (this code is also located in tests/testcbp/HSP2Results/check_depends_endpoint.py.

Copy link
Member

@PaulDudaRESPEC PaulDudaRESPEC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rburghol , this looks like good stuff. A few comments/requests if you don't mind:

  • Instead of modifying test10.uci, let's create a new test10spact.uci with the special actions as you mocked them up. We run test10.uci as a baseline, and I'd like to keep it the same as it has always been. Sorry if my past suggestion wasn't clear.
  • In HYDR.py, there's a minor change from njit to njit(cache=True)... was that intentional? If not, let's leave it as cache=True so we don't have an inadvertent change.

@rburghol
Copy link
Contributor Author

Thanks for the review @PaulDudaRESPEC -- I'll make these uci changes asap. As for the @njit instead of @njit(cache=True), I made that change as a test, and should have communicated about it. My sense is that it was important to do during debugging, as the cache=True argument appeared to be requiring me to reload my environment occasionally. That may have been a misunderstanding on my part -- regardless, I did not intend to leave it in there, though it might be worth seeing if it actually does anything positive and/or if it indeed can cause unwanted caching (I can verify that it does not eliminate pre-compiled speed ups).

@rburghol
Copy link
Contributor Author

Changes done. Thanks again!

Copy link
Member

@PaulDudaRESPEC PaulDudaRESPEC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks @rburghol . Would you also please revert your changes to Test10.uci?

@rburghol
Copy link
Contributor Author

Ah - thanks @PaulDudaRESPEC -- in all the switching back and forth I missed that. Done!

@PaulDudaRESPEC PaulDudaRESPEC merged commit 3fc278c into respec:develop-specact Apr 24, 2024
@PaulDudaRESPEC
Copy link
Member

Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants