8000 Import start.py using absolute path. by yakutovicha · Pull Request #73 · aiidalab/aiidalab-home · GitHub
[go: up one dir, main page]

Skip to content

Import start.py using absolute path. - #73

Merged
yakutovicha merged 3 commits into
developfrom
fix/import-start-py-using-absolute-path
Oct 6, 2021
Merged

yakutovicha merged 3 commits into
developfrom
fix/import-start-py-using-absolute-path

Conversation

@yakutovicha
Copy link
Copy Markdown
Member

Previously, the apps folder was considered a python module. Since
this is not true anymore [1,2], the loading of the apps' start.py
needs to be adapted.

[1] aiidateam/aiida-prerequisites#37
[2] aiidalab/aiidalab-docker-stack#213

Previously, the apps folder was considered a python module. Since
this is not true anymore [1,2], the loading of the apps' start.py
needs to be adapted.
[1] aiidateam/aiida-prerequisites#37
[2] aiidalab/aiidalab-docker-stack#213
@yakutovicha
yakutovicha requested a review from csadorf October 5, 2021 15:14
@csadorf csadorf left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Could you briefly comment about the motivation to use this particular approach as opposed to importlib.machinery.SourceFileLoader? I did some cursory search and found the following article: https://www.geeksforgeeks.org/how-to-import-a-python-module-given-the-full-path/

@yakutovicha
Copy link
Copy Markdown
Member Author

Looks good. Could you briefly comment about the motivation to use this particular approach as opposed to importlib.machinery.SourceFileLoader? I did some cursory search and found the following article: https://www.geeksforgeeks.org/how-to-import-a-python-module-given-the-full-path/

I didn't find the importlib.machinery.SourceFileLoader approach, before. But since it is shorter, I will use it.

@yakutovicha
Copy link
Copy Markdown
Member Author

I didn't find the importlib.machinery.SourceFileLoader approach, before. But since it is shorter, I will use it.

The amount of code is the only difference I see between those two approaces. @csadorf are you aware of the other differences?

@csadorf
csadorf commented Oct 6, 2021
Copy link
Copy Markdown
Member

I didn't find the importlib.machinery.SourceFileLoader approach, before. But since it is shorter, I will use it.

The amount of code is the only difference I see between those two approaces. @csadorf are you aware of the other differences?

No, I am not aware of any differences besides the length and that the currently implemented approach allows one to control the execution of the module. It looks like both approaches are part of the public API and would be equally well-supported.

@yakutovicha
Copy link
Copy Markdown
Member Author

I didn't find the importlib.machinery.SourceFileLoader approach, before. But since it is shorter, I will use it.

The amount of code is the only difference I see between those two approaces. @csadorf are you aware of the other differences?

No, I am not aware of any differences besides the length and that the currently implemented approach allows one to control the execution of the module. It looks like both approaches are part of the public API and would be equally well-supported.

ok, then the shorter one wins, I think.

@yakutovicha
Copy link
Copy Markdown
Member Author

changed, tested - works.

@yakutovicha
yakutovicha requested a review from csadorf October 6, 2021 13:49
@csadorf csadorf left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Assuming it works, approved! 😃

@yakutovicha
yakutovicha merged commit 436ed37 into develop Oct 6, 2021
@yakutovicha
yakutovicha deleted the fix/import-start-py-using-absolute-path branch October 6, 2021 13:52
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.

2 participants

0