Closed sidharth-sundar closed 2 years ago
Two structural comments I wanted to bring up while I remembered them
poll_changes()
function or the get_scene()
function. One way we can do this is by setting app-specific environment variables on initiation. When get_all_learners()
, get_all_train_curriculum()
, and get_all_test_curriculum()
are initially invoked, we can maintain a list of learners and curricula, and can later enforce that the user-provided learners/curricula are among the selected ones.get_image
as an API call because it made sense to me for image retrieval to take place independently; however, with the current approach, selecting a scene generates 1 GET request for retrieving image paths, and 1 GET request per individual image. We could instead wrap all of this functionality into a single request, where the get_scene
call in Flask invokes get_image
within the back end itself.@sidharth-sundar Re: structural issues:
LEARNER_DIR_CONTENTS
?@spigo900 Re: Re: structural issues:
and also have the separate API call so the UI can fetch additional images as they come in.
Currently the UI is set up to just alert the user if new data is available, and the user would then have to manually retrieve said data/resubmit the request for data. In the original discussion in #1155 we proposed automatically fetching additional images as a possibility, but it wasn't in scope for what I initially planned to work on. However, I think with the approach I took to retrieve data (polling the back end), I can feasibly implement auto-fetching without too much more effort.
@sidharth-sundar Re: fetching as they come in, I meant that more as "it's convenient for future work to leave in the API call." If you feel like adding auto fetching, I think it makes sense to spend up to an hour on that. If it would take more than that, I think it makes more sense to prioritize GNN improvements.
I would like to see the pure-cleanup changes to get_scene()
split out of c7778e847db1317ef066b707050f3dc50f01d855 (change to relpath) and 88742f3893da77f801db2a5c84ee6e07c4c6a6ae (arg validation changes: and->or; any("/" in...); resolve&relative_to check), and ideally combined into one commit that comes before the "new feature" changes. Otherwise this looks good, thanks for the cleanup.
@spigo900 Re: cleanup changes
Done! I think there's one other thing which could be moved to the initial commit, which is displaying images with the format rgb_#
. However, I think it makes sense to leave it where it currently is, coupled with the larger change in get_scene
which now returns image data rather than image paths.
@sidharth-sundar That sounds fine. Are you ready to merge then?
@spigo900 Yes, it's ready to be merged
Closes the live image display portion of #1159
There are 2 major changes present in this update:
Add functionality to send image files from directory exterior to angular working directory:
Add polling service to display changes in back end
I can make some additional improvements around these features, such as presenting the notification of new data more cleanly/more gracefully handling errors with image retrieval.