Skip to content
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

Rework caching #111

Open
SamiMammouche opened this issue Mar 4, 2022 · 2 comments · May be fixed by #124
Open

Rework caching #111

SamiMammouche opened this issue Mar 4, 2022 · 2 comments · May be fixed by #124
Assignees
Labels
task Regular piece of work
Milestone

Comments

@SamiMammouche
Copy link
Collaborator

SamiMammouche commented Mar 4, 2022

Reproduction steps:

  1. Create a strategy with a timeframe
  2. Debug the get_price method which calls the get_cached_price method
  3. You should see 3 calls being made to FMP for the same data

Refactor the caching and make it easier to understand. Get data from CSV cache and if it's not available, query FMP.

https://i.imgur.com/4AzSnex.png

@SamiMammouche SamiMammouche changed the title Fix the current caching issues Rework caching Mar 4, 2022
@TristanFecteau
Copy link
Contributor

To cache data locally, we should use https://pypi.org/project/appdirs/ (user_cache_dir)
Which will give us the working caching folder on every Win, MAC, Linux.

@TristanFecteau
Copy link
Contributor

I also think we should cache json files, instead of csv, which would make it lighter on our code and the user's file system

@TristanFecteau TristanFecteau self-assigned this Mar 27, 2022
@TristanFecteau TristanFecteau added the task Regular piece of work label Mar 27, 2022
@TristanFecteau TristanFecteau added this to the MVP 2 milestone Mar 27, 2022
@TristanFecteau TristanFecteau linked a pull request Mar 29, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Regular piece of work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants