OpenNeuroLab / brainspell-neo

Working on a new version of Brainspell (an open-source platform for neuroimaging literature) to make a public JSON API that collaborators can contribute to, switch out the stack for better scalability, and provide statistical features to better conduct meta-analyses.
MIT License
15 stars 6 forks source link

Worked on modernizing asynchronous python calls and resolving frontend errors #71

Closed Sharabesh closed 5 years ago

Sharabesh commented 5 years ago

Summary

  1. Switched over to async await instead of using asynchronous generators.
  2. Cached User Articles on Addition to allow frontend to reflect new changes
  3. Made nSubjects an optional parameter in the database
  4. General Style updates (using static methods where appropriate) and removing unnecessary imports

Test Plan Replicated errors received on frontend including

https://brainspell.herokuapp.com/json/v2/edit-global-article?github_token=b38a4968302c2948a9e5275c88de298c6107bb01&key=8a54a6d2574394f0a6d50b37d2a67f955196ae98&pmid=18367612&edit_contents={%22experiments%22:[{%22id%22:90000,%22caption%22:%22Areas%20showing%20greater%20activation%20for%20high-conflict%20trials%20than%20low-conflict%20trials,%20on%20trials%20where%20no%20response%20was%20required.%20The%20top%20half%20of%20the%20table%20describes%20activity%20as%20a%20result%20of%20the%20direct%20

and

https://brainspell.herokuapp.com/json/v2/edit-local-article?collection_name=naturalistic&github_token=b38a4968302c2948a9e5275c88de298c6107bb01&key=8a54a6d2574394f0a6d50b37d2a67f955196ae98&pmid=18367612&key_value_pairs={"90000":[]}&exclusion_reasons={"90000":"excluded"}

  1. Verified these errors are now resolved.
  2. Further tested the add-to-collections page to verify frontend clearly reflected newly added articles.
  3. Also verified changes persist to DB and persist across refreshes of the page.

General Comments Tornado recommends the use of native async over coroutines: https://www.tornadoweb.org/en/stable/guide/coroutines.html

neelsomani commented 5 years ago

This looks good to me - good call on removing Python 3.4