-
Notifications
You must be signed in to change notification settings - Fork 193
Adapt def _assign_imports_to_globals #47
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
base: master
Are you sure you want to change the base?
Conversation
|
Hey, thank you for your PR! Please describe the use case a little bit more in detail. |
|
Hi~ Thanks for your reply. E.g. do you add the "from keras.layers import LSTM, Dropout, Dense" to your personal pyforest imports? However, My PR is to split the string, Besides, I created 2 small personal features in my forked repo. I think this project is useful for |
|
Thank you for your reply. Please also describe the behavior/spec of pyforest before and after your PR. |
|
Hi @triper1022, So you mentioned that your PR allows writing import statements like Now, I'm wondering: If you open a fresh Notebook (with no imports written yet) and start using Will it be
Can you describe any other behavioural changes of pyforest coming with your PR? |
|
|
||
| if "," not in import_statement: | ||
| process(import_statement) | ||
| else: |
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 reply!
My PR doesn't affect any original behaviors.
At first,
PR uses new line 70. to judge whether the import statement includes multiple imports.
if "," not in import_statement,
"from keras.layers import LSTM" still behaves as original code
of original line 63, which is similar with new line 63~68.
if "," is in import_statement,
like "from keras.layers import LSTM, Dropout, Dense",
it will become
"from keras.layers import LSTM"
"from keras.layers import Dropout"
"from keras.layers import Dense" with new line 73~78.
Then, the following behaviors are still the same as the original line 63, 65, 66.
Hi~
I found we often make multiple imports in one line like below
from keras.layers import LSTM, Dropout, Dense.
Therefore, I rewrote the func., def _assign_imports_to_globals() to make this work.
If you are free, please check it out.