-
Notifications
You must be signed in to change notification settings - Fork 17
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
Updating Python scripts #108
Conversation
Python main scripts have been updated to make them as similar as possible between applications. A unique python script is used for both serial and parallel execution.
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 prefer not to use * in the import
|
||
# Import define_output | ||
from KratosMultiphysics import * | ||
from KratosMultiphysics.ExternalSolversApplication import * |
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.
Why import whit *?
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.
A time ago we decided to do the import with * in the main scripts. However, I do not exactly remember why...
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 that the argument was "simplicity". However in the solvers it should be used without the *
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.
OK
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.
looks ok to me (apart for the prints which i am not sure if we want to keep)
if (parallel_type == "OpenMP") or (mpi.rank == 0): | ||
print("") | ||
print(main_model_part) | ||
for properties in main_model_part.Properties: |
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.
why do we want to print this? is it for debug purposes?
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.
Probably we can remove this one, or maybe print it when echo_level is larger than one (as is done with other print statements).
89209ff
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.
OK
Will this work with the Release branch? |
Indeed, this must be in the release branch. |
Python main scripts have been updated to make them as similar as possible between applications. A unique python script is used for both serial and parallel execution.