-
Notifications
You must be signed in to change notification settings - Fork 247
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
making python-modules work #3217
Changes from 2 commits
3261b4f
385eb8c
5579706
541af8f
7670994
0e14da0
162de93
0d8731c
74f7cd1
cfffd70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,4 +196,6 @@ install(TARGETS KratosStructuralMechanicsCore DESTINATION libs ) | |
install(TARGETS KratosStructuralMechanicsApplication DESTINATION libs ) | ||
|
||
# Add to the KratosMultiphisics Python module | ||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/StructuralMechanicsApplication.py" DESTINATION KratosMultiphysics ) | ||
install(DIRECTORY DESTINATION "KratosMultiphysics/StructuralMechanicsApplication") | ||
|
||
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/StructuralMechanicsApplication.py" DESTINATION "KratosMultiphysics/StructuralMechanicsApplication" RENAME "__init__.py") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above, I am not sure if this works in Win (using |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
application_folder = "StructuralMechanicsApplication" | ||
|
||
# The following lines are common for all applications | ||
from . import application_importer | ||
from .. import application_importer | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if this also works in python2 |
||
import inspect | ||
caller = inspect.stack()[1] # Information about the file that imported this, to check for unexpected imports | ||
application_importer.ImportApplication(application,application_name,application_folder,caller) | ||
application_importer.ImportApplication(application,application_name,application_folder,caller, __path__) |
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 am not sure if this works in Win (using
/
for separating the path)=> if not I think it can be easily fixed
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.
Usually you are safe with "/". It is also a valid separator for windows.
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.
so this is not any longer in
KratosMultiphysics/applications/StructuralMechanicsApplication?
this means that you can only make installation outside of where you compile?
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 don’t understand, can you please explain in more detail what you mean?
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.
right now on my computer i normally keep the python files in the same directory as they normally are. This is useful since when i change a file i do not need to reinstall.
I am asking if this will change after this PR or if the python files will be left where they are
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.
clarifying on my point, it may even be good if this is changed, since it may be the first step towards propoer python packaging of Kratos...however the need of installing every time a python file is modified is a little annoying, which is the reason for which i ask
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.
Ah now I understand
Answer: the current behavior is NOT changed, i.e. you DON'T have to reinstall after changing python files
Only the folder-structure changes a bit in the
KratosMultiphysics
folderfrom:
to:
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.
oh, i see.
thx!