SEED-platform / seed

Standard Energy Efficiency Data (SEED) Platform™ is a web-based application that helps organizations easily manage data on the energy performance of large groups of buildings.
Other
111 stars 54 forks source link

Add cached derived data #4763

Closed haneslinger closed 2 months ago

haneslinger commented 3 months ago

To test:

  1. Create derived columns
  2. Look at those columns, they should be empty!
  3. call the action "Update derived data on them". They will turn yellow, and update.
  4. edit a field that'll change the derived data and rerun step 3.

TO COME: calling the action automatically.

github-actions[bot] commented 3 months ago

Label error. Requires at least 1 of: Feature, Bug, Enhancement, Maintenance, Documentation, Performance, Do not publish. Found:

haneslinger commented 3 months ago

@perryr16 theses are good notes.

Looks like the tax lots update_dervied_data endpoint isn't configured yet. Property derived columns are not populated when viewing associated properties on the tax lots tab. (Same for tax lots on the properties tab)

Will fix

The evaluation seems pretty quick for 1000 properties. What are you expecting for an evaluation time on a large dataset? I ask because I think a progress bar and an auto refresh following the completion of the task would be nice for the user.

Its in the background, no need for progress bar. Run with celery to see

It's super small, but the modal could use some padding. 👍🏻

perryr16 commented 3 months ago

If you'd like to have an auto-refresh instead of requiring the user to refresh manually, you could use the uploader_service.check_status_loop to monitor the Celery task and trigger a page or UI-grid reload when it’s complete. Im cool either way :)

haneslinger commented 3 months ago

@perryr16 I think I understand. Would you be able to link an area in the code I can ape? I still dont understand the progress bar bit

perryr16 commented 2 months ago

@haneslinger, for sure.

If you take a look at the /delete_cycle_modal_controller.js line 89 you should be able to track the logic.

Essentially, the view generates a progress_key and asynchronously kicks off a background task which will perform the logic and update that progress object. While the task is running, the view immediately returns the progress_key. The frontend hits check_progress_loop with the given progress_key every 750ms to measure the percentage complete.