Skip to content

[UI] Allow importing the Python script #374

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

Merged
merged 1 commit into from
Jul 14, 2023
Merged

Conversation

senwang86
Copy link
Collaborator

Summary

  • Allow importing a Python script to a pod.
  • Change right-click context menu item
  • The imported Python script is put into a scope rather than "ROOT".

Test

importLocalCode

@senwang86 senwang86 changed the title Allow importing the Python script [UI] Allow importing the Python script Jul 14, 2023
@lihebi
Copy link
Collaborator

lihebi commented Jul 14, 2023

Thanks! Merging.

Two minor concerns that we might want to address in the future:

  1. Now we have one menu, "upload" to support both .ipynb and .py files. We could have two menus, "upload .ipynb file" and "upload .py file" to make it explicit to users.
  2. A Python file could be imported into one pod without the scope. But there's a good chance that we provide an option to automatically separate a .py file into multiple pods, e.g., one pod per function. In that case, the scope is needed.

@lihebi lihebi merged commit 28c442e into codepod-io:main Jul 14, 2023
@senwang86
Copy link
Collaborator Author

senwang86 commented Jul 14, 2023

Thanks! Merging.

Two minor concerns that we might want to address in the future:

  1. Now we have one menu, "upload" to support both .ipynb and .py files. We could have two menus, "upload .ipynb file" and "upload .py file" to make it explicit to users.

I initially added a new menu item for .py import, but then realized that, to Codepod, there might not be much of a difference between .ipynb and .py, then I merged them together. We can definitely alter the menu in future though.

  1. A Python file could be imported into one pod without the scope.

I also considered whether a pod should be imported into "ROOT"; just for myself, I try to keep the number of pods w/o scopes to a minimum; personally, I feel it's more organized.

But there's a good chance that we provide an option to automatically separate a .py file into multiple pods, e.g., one pod per function. In that case, the scope is needed.

SG.

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