Giter VIP home page Giter VIP logo

Comments (10)

eerolinna avatar eerolinna commented on July 30, 2024

I guess this should be implemented by downloading models, datasets etc to a cache or data directory. Probably only the models the user uses should be downloaded.

I found a python package for accessing platform specific data/cache/config directories, https://github.com/ActiveState/appdirs

For example for the user trentm the cache dir on MacOS would be /Users/trentm/Library/Caches/posteriordb, on Windows C:\Users\trentm\AppData\Local\author_name\posteriordb\\Cache (author_name could also be posteriordb) and on Linux /home/trentm/.cache/posteriordb

I'm not sure if it would be better to use the cache dir or the data dir.

The main technical challenge is probably determining when a downloaded file is stale and needs to be downloaded again. One approach would be having a file in this repo that contains hashes of each file in the posterior database. Then with the hash we could be determine if a file needs to be re-downloaded. There are other approaches too, such as just redownloading everything once a new version of posteriordb is released.

from posteriordb.

eerolinna avatar eerolinna commented on July 30, 2024

Another possibility would be to include the whole PDB in the R and python packages (or as a separate posteriordbdata package). With this approach we wouldn't need to worry about platform-specific directories, but using this would mean that that the package needs to be updated to access new models etc and also that the whole database is always downloaded even if the user wants to use only a few posteriors

from posteriordb.

MansMeg avatar MansMeg commented on July 30, 2024

from posteriordb.

MansMeg avatar MansMeg commented on July 30, 2024

from posteriordb.

eerolinna avatar eerolinna commented on July 30, 2024

I feel a persistent cache is the way to go, having to redownload the models and datasets just because R session was closed doesn't feel right to me. The implementation effort of the persistent cache also doesn't seem large to me.

So with the git sha approach we redownload everything when the PDB gets new commits? I agree that for the first version this is good enough, it can be improved later.

from posteriordb.

MansMeg avatar MansMeg commented on July 30, 2024

from posteriordb.

eerolinna avatar eerolinna commented on July 30, 2024

A few questions:

  1. If the user calls pos <- posterior_names(my_pdb) is it OK that all the posterior info files in posteriors/ get downloaded? And same with model_names and dataset_names

  2. Is it best to not yet download the dataset file and model code when the user calls po <- posterior("8_schools-8_schools_centered", my_pdb) and instead download them when the user calls dataset(po) or stan_code(po)? And the same applies for downloading the model info and dataset info files.

    The posterior info however would be downloaded at this point.

    A downside to this approach is that it can be hard to validate that the posterior has valid dataset and model code.

from posteriordb.

MansMeg avatar MansMeg commented on July 30, 2024

This has now been solved. It just needs to be updated in the vignette and documentation.

from posteriordb.

eerolinna avatar eerolinna commented on July 30, 2024

Good job!

from posteriordb.

MansMeg avatar MansMeg commented on July 30, 2024

To eeros comment above. I have now added a cache_path to the pdb object so it is can be stored wherever. If we want we can point the local db path to be the cache, then nothing is cached.

from posteriordb.

Related Issues (20)

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.