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

Promote index store to frontend feature #270

Merged
merged 8 commits into from May 30, 2023
Merged

Promote index store to frontend feature #270

merged 8 commits into from May 30, 2023

Conversation

gmaze
Copy link
Member

@gmaze gmaze commented May 24, 2023

The :class:IndexFetcher is a user-friendly fetcher built on top of our internal Argo index file store.

But for one familiar with Argo index files and/or who cares about performances, it may be interesting to use directly the Argo index store. We thus try to promote this internal feature as a frontend class :class:ArgoIndex.

As explained in the doc, we have to choose which store to use for index:

from argopy.stores import indexstore_pd as indexstore  # Rely on Pandas
# or:
from argopy.stores import indexstore_pa as indexstore  # Rely on Pyarrow

The goal here, is to have a new class ``ArgoIndex```:

from argopy import ArgoIndex

that will be indexstore_pa if Pyarrow is available or fall back on indexstore_pd otherwise.

@gmaze gmaze added enhancement New feature or request internals Internal machinery labels May 24, 2023
@gmaze
Copy link
Member Author

gmaze commented May 24, 2023

This could be as easy as to have some thing like this:

import importlib
if importlib.util.find_spec("pyarrow") is not None:
    from .argo_index_pa import indexstore_pyarrow as indexstore
else:
    from .argo_index_pd import indexstore_pandas as indexstore

class ArgoIndex(indexstore):
    pass

in a new argopy.stores.argo_index.py file
In this case, ArgoIndex will not be an alias and all the docstring will be easily inherited and available in the doc

@gmaze gmaze marked this pull request as ready for review May 30, 2023 08:41
@gmaze gmaze merged commit f5e3ce3 into master May 30, 2023
24 checks passed
@gmaze gmaze deleted the ArgoIndex branch May 30, 2023 08:41
@gmaze gmaze restored the ArgoIndex branch May 30, 2023 08:45
gmaze added a commit that referenced this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internals Internal machinery
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant