-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use Geoweaver API + Better UI Response (Pandas + IPython Widgets) #24
base: main
Are you sure you want to change the base?
Conversation
Here is the testing changes for the changed functions @ZihengSun couldnt upload my local file of jupyter notebook, so uploaded to colab and pasted link here |
pygeoweaver/sc_detail.py
Outdated
d = d.json() | ||
d['nodes'] = json.loads(d['nodes']) | ||
try: | ||
from IPython import get_ipython |
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.
this section of code is repeated in all the places. Can you make it a function and reuse it when being used?
pygeoweaver/sc_detail.py
Outdated
], | ||
cwd=f"{get_root_dir()}/", | ||
) | ||
url = f"{GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/detail" |
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.
this whole section is repeated multiple times. Need to Create a utility function and reduce the redundancy please
pygeoweaver/sc_detail.py
Outdated
], | ||
cwd=f"{get_root_dir()}/", | ||
) | ||
url = f"{GEOWEAVER_DEFAULT_ENDPOINT_URL}/web/detail" |
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.
Redundancy section of code. Use utility function.
@@ -146,3 +146,28 @@ def copy_files(source_folder, destination_folder): | |||
) | |||
os.makedirs(os.path.dirname(destination_file), exist_ok=True) | |||
shutil.copy2(source_file, destination_file) | |||
|
|||
|
|||
def create_table(data, max_length=100): |
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.
Not sure this is a good idea. Also, a table is not impressive
improvement comparing to all the other libraries. What we need is a widget that have button
and dropdown, selection, text editors, or things similar that. Here is some example: https://medium.com/codex/fancy-world-of-ipywidgets-e3301de58bd7
Overall, people like interactive experiences. Not just a static table. If it is only a simple HTML table, the pandas dataframe output will do it.
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.
Some comments and it should be an interactive widget. A simple HTML table doesn't worth the efforts.
No description provided.