-
Notifications
You must be signed in to change notification settings - Fork 41
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
Build archive page from database #1030
Build archive page from database #1030
Conversation
Hello @bhilbert4, Thank you for updating !
Comment last updated at 2022-09-13 17:59:11 UTC |
This is still very much a work in progress, but I figured I should get the skeleton of it uploaded. I'm always very slow when trying to work with databases. |
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.
Initial thoughts that we will eventually implement an "Image" class to hold the observation specific thumbnails and filterable data. This Image class should be where we have the Exposure Type kept. Exposure Types can just be defined and stored as objects in the Image class (along with name and thumbnail location).
can also decide if we want to handle images and thumbnails using the |
The new page is working, but is still slower than I had anticipated. Looking at how long it's taking to do various things, the database access appears fairly fast. The slowest task is generating the list of proposal numbers. Timing results are below for the updated archived_proposals_ajax. Values are in units of seconds. Each "proposal loop" iteration shows the results when working on one proposal. Everything within the proposal loop is small (5-20ms), compared to getting the list of proposals (10-12 seconds). And note that this is timing the tasks in archived_proposals_ajax only. This doesn't say anything about archived_proposals nor the JS. But still, this argues for finding a faster way to get a list of proposals. Initial filter: 0.0008904417045414448 In proposal loop: In proposal loop: |
@mfixstsci this is ready for review. Works well when tested on the test server. |
Ah , right. I forgot about PEP8... |
Hmm, PEP8 seems to be stuck checking an old version of the files. |
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.
Looks great, I really like this models based approach. thanks for submitting this!
I also checked out the pep8 issues listed here and pulled your repo locally and it looked fine 🤷♂️ |
Resolves #1023
This PR changes the way an instrument's archive page is built. The task of querying MAST for each proposal and then working through all of the files for that proposal has been moved to a script that can be run any time. The results of the script are used to populate new database tables.
Then when someone navigates to an instrument's archive page, the database table is loaded and the information is used to build the page.