Coder Social home page Coder Social logo

ce-placemats-flask's People

Contributors

guerard avatar nageshtembhurnikar avatar smriti-rao avatar vijendraintrop avatar

Watchers

 avatar  avatar  avatar

ce-placemats-flask's Issues

Add 'refresh' to Layouts API

  • Add refresh to layouts api

Layout refresh

Currently when an existing layout is fetched, we simply return it (line 25 in layouts_api.py).
Instead, we need to check if a query param refresh is set to 1 or true and re-run the layout-creation logic (including adding widgets to the widget store and enqueueing tasks to generate the data) with one critical difference: update the layout in the store vs. add it.
The way update works is that it takes the primary key (pk) as the first argument and the change dictionary as the second: in this case the only field we're changing is widgets so the call would look something like l_store.update(pk, {'widgets': w_pks}). update.

Shared code

Both of the above API's will need to use _get_query_or_default from base_api.py to get the refresh query parameter.

Gotcha's

The task queue remembers job requests for an hour, so that it can de-dupe any simultaneous requests. This means that you can only refresh the data once per hour. We can always add a hard_refresh in the future that will actually delete/overwrite the status of the existing task in the queue, but for now it's probably better to throttle widget data creation to once per hour anyway (at least in production; for development purposes this would be tedious, but you can always just delete the entire task queue collection in mongo to reset it).

World cloud + time-series for a query

  • 1. Add 'date_of_publication' field on the Article namedtuple and get the data from https://www.nlm.nih.gov/bsd/mms/medlineelements.html#dp for it. Refactor its use in author_info to hydrate the new field.
  • 2. Add a function to ncbi_client.py that returns a KeywordInfo namedtuple (similar to AuthorInfo) with 'pmid_to_keywords', 'keyword_to_pmids', 'pmid_to_articles'.
  • 3. Implement an initial strategy for assigning a year and a count to each word. For the year assignment we'll use the earliest year it was referenced, and use the number of associated PMID's for the count. Make the strategy abstract so that we can replace it easily going forward without reorganizing the rest of the code
  • 4. Transform the data from (3) into the same format as mock_data.py's TIME_SERIES_DATA

screen shot 2018-06-06 at 11 28 00 pm

from data viz_MeSHlvl1.xlsx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.