-
Notifications
You must be signed in to change notification settings - Fork 39
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
Custom GrowthRatios and more Schedule variables #94
base: main
Are you sure you want to change the base?
Conversation
* Update setup.py * changed numpy to <1.24 * ran black * Bump patch version --------- Co-authored-by: sseraj <[email protected]>
* add config file for building docs * add newline --------- Co-authored-by: Marco Mangano <[email protected]>
* renamed Intel config file * renamed gfortran config file * updated azure script * added MPI if check in Intel config * minor cleanup * updated docs * fixed Intel env var
@DavidAnderegg thanks for the PR. Will try to take a look as soon as I can. In the meantime, can you address the failing tests. |
@eirikurj The tests fail because new the ref files have not been added. I attached a .zip in the description of this PR. |
My bad, I only read the description in a rush and saw the test are failing. I can update the reference files. I skimmed the PR content, and it looks good, but will do a more thorough pass later.
|
I have updated the files. However, in line with my previous comment on refactoring the scripts I updated the names and inserted
To avoid nightly builds failing, I named the archive with the updated files is |
@eirikurj I adjusted the code as explained in my previous comment. It is once again ready for review. Please note: i also adjusted the description and added new ref-files. |
updating MExt to support python 3.12 (mdolab#95)
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.
Great work overall. I left some comments. I am really happy with the cleanup you did with fortran, it makes so much more sense to compute those parameters in python.
@anilyil, I adressed your comments. You might want to take a look again. |
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 the updates. This is good to go for me.
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.
@DavidAnderegg we just realized the growth ratios printed with pyHypMulti is broken now. It just prints 0s. Can you look into this?
@anilyil I know why this happens... Yes, I will look into it. |
@anilyil Grid Ratios for pyHypMulti print now correctly. I also replaced that code with 'tabulate' because it is so much easier this way. |
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.
Sorry for the delay. I did a quick pass and overall the changes are very good. Just a few very minor comments or questions. Let me know if anything is unclear. Also, can you prepare and link an archive with updated reference files for the tests. Want to test this locally and I will also need to upload it to our site.
pyhyp/pyHyp.py
Outdated
@@ -405,8 +384,19 @@ def __init__(self, comm=None, options=None, debug=False): | |||
if options is None: | |||
raise Error("The options = keyword argument is *NOT* optional. " "It must always be provided") | |||
|
|||
# Deprecated options | |||
deprecated_options = self._getDeprecatedOptions() |
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.
We use camelCase
(there are exceptions) for our codebase. Please change naming (here and elsewhere) to make it consistent.
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.
I will change it.
But are not any of the tools (flake8, black, ...) supposed to catch this?
from baseclasses import BaseSolver | ||
from baseclasses.utils import Error | ||
from cgnsutilities.cgnsutilities import readGrid, combineGrids | ||
|
||
|
||
class pyHypWarning(object): |
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.
While this is fine for now, I just wanted to note that we have been moving towards using the standard library warnings
module. You can see baseclasses
for examples of usage.
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.
I can move to a standard library. I just copied the idea from ADflow. Let me know what you want?
pyhyp/pyHyp.py
Outdated
|
||
return fullDeltaS, marchDist, growth_ratios | ||
|
||
def get_growth_ratio_string(self, growth_ratios=None, n_decimals=3): |
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.
Add argument descriptions (same for other new functions). Also probably should make it "private" with an underscore, or is there a use case for the user here that I am missing?
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.
I think this depends on your definition of private/public. I understood it like this: only accessed within the class = private; gets accessed outside of the class = public.
This function is called by pyHypMulti, which does not inherit from pyHyp. Thus it is accessed from the outside and should be public.
@eirikurj I adressed your comments. I only resolved the ones where I knew what to do. The unresolved ones either need an answer or a small discussion. Regarding the ref files, I edited the PR description and updated the link to the ref-files. Regarding function description. I left out the ones in the examples. Let me know if I should add it there aswell. |
Purpose
This PR adds the ability to set custom growth ratios on each layer. Additionally, more 'schedule' variables are introduced.This PR adjusts how some options work. Apart from prescribing a single value, it is now possible to define a list with per-layer values. Additionally, it is possible to instruct pyHyp to interpolate the value linearly throughout the extrusion.
This PR removes the
volSmoothSchedule
variable as the same functionality is now possible withvolSmoothIter
.Lastly, a new variable
growthRatios
is introduced to explicitly set the growth ratio. If it is set, themarchDist
option is ignored. This variable works like the other changes introduce here.Expected time until merged
1 week
Type of change
volSmoothSchedule
is now obsolete and was removedTesting
I adjusted the
naca0012_rans
andcorner
test to include an 'interpolation' and a 'per-layer' case. I also added a test fornConstantStart
andnConstantEnd
options. And finally, i added a test forsimpleOCart
withxBounds
and no nearfield mesh.Here are the new ref-files for the new tests: schedule_ref_files.zipHere are the new ref-files for the new tests: refFiles.zip
Checklist
flake8
andblack
to make sure the Python code adheres to PEP-8 and is consistently formattedfprettify
or C/C++ code withclang-format
as applicable