Adapt def _assign_imports_to_globals#47
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.
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.