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

How to use Artic properly #937

Open
octosport opened this issue Jan 11, 2022 · 1 comment
Open

How to use Artic properly #937

octosport opened this issue Jan 11, 2022 · 1 comment

Comments

@octosport
Copy link

octosport commented Jan 11, 2022

Arctic Version

Any

Arctic Store

ChunkStore

Platform and version

Linux

Description of problem and/or code sample that reproduces the issue

Although the library seems very powerful it lacks simple production use cases. If I take the example in ChunkStore:

>>> df = DataFrame(data={'data': [1, 2, 3, 4, 5, 6, 7, 8, 9],
                         'open': [1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9],
                         'close': [1.2, 2.3, 3.4, 4.5, 5.6, 6.7, 7.8, 8.9, 9.0],
                         'prev_close': [.1, .2, .3, .4, .5, .6, .7, .8, .8],
                         'volume': [1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000]
                         },
                   index=MultiIndex.from_tuples([(dt(2016, 1, 1), 1),
                                                 (dt(2016, 1, 2), 1),
                                                 (dt(2016, 1, 3), 1),
                                                 (dt(2016, 2, 1), 1),
                                                 (dt(2016, 2, 2), 1),
                                                 (dt(2016, 2, 3), 1),
                                                 (dt(2016, 3, 1), 1),
                                                 (dt(2016, 3, 2), 1),
                                                 (dt(2016, 3, 3), 1)],
                                                names=['date', 'id'])
                   )

>>> lib.write('column_test', df, chunk_size='D')
>>> lib.read('column_test', columns=['prev_close', 'volume'])

               prev_close  volume
date       id                    
2016-01-01 1          0.1    1000
2016-01-02 1          0.2    2000
2016-01-03 1          0.3    3000
2016-02-01 1          0.4    4000
2016-02-02 1          0.5    5000
2016-02-03 1          0.6    6000
2016-03-01 1          0.7    7000
2016-03-02 1          0.8    8000
2016-03-03 1          0.8    9000
  • How do you add a new column, for instance, a high or low, without making a new symbol but updating that one?
    It seems possible in ChunkStore using update but we need to precise chunk_range and the new data frame to be written has to contain old columns + the new one. It is not possible to only append one new column without deleting the rest of the data
  • How do you update each column individually on the 2016-03-04 (say I do not get each data point at the same time)?
    It seems possible in ChunkStore using update but we need to precise chunk_range otherwise, data are overwritten
  • How do you read multiple symbol volumes and get them in one data frame?
    It is possible in ChunkStore to read by passing a list of symbols
  • How do you update/append in TickStore? And I guess in VersionStore you write a new version for each update?
    My understanding is TickStore only write as ticks are only read one time

Maybe my understanding is not correct and the database is not designed for these cases which is perfectly fine. Otherwise, I can not find this information in the doc.

Thanks

@vietlq
Copy link

vietlq commented Apr 10, 2022

@mehertz ^^ probably you need to write one more article to address these requests haha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants