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

Document more methods of HfFileSystem #2100

Open
severo opened this issue Mar 8, 2024 · 3 comments
Open

Document more methods of HfFileSystem #2100

severo opened this issue Mar 8, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@severo
Copy link
Contributor

severo commented Mar 8, 2024

https://huggingface.co/docs/huggingface_hub/package_reference/hf_file_system does not contain doc for rm, find, glob, etc

@severo severo added the documentation Improvements or additions to documentation label Mar 8, 2024
@Wauplin Wauplin added this to the in next release? milestone Apr 22, 2024
@lappemic
Copy link
Contributor

Which methods should all be documented? I assume it would be the following:

  1. __init__(self, *args, endpoint=None, token=None, **storage_options)
  2. resolve_path(self, path, revision=None)
  3. invalidate_cache(self, path=None)
  4. rm(self, path, recursive=False, maxdepth=None, revision=None, **kwargs)
  5. ls(self, path, detail=True, refresh=False, revision=None, **kwargs)
  6. glob(self, path, **kwargs)
  7. find(self, path, maxdepth=None, withdirs=False, detail=False, refresh=False, revision=None, **kwargs)
  8. cp_file(self, path1, path2, revision=None, **kwargs)
  9. modified(self, path, **kwargs)
  10. info(self, path, refresh=False, revision=None, **kwargs)
  11. exists(self, path, **kwargs)
  12. isdir(self, path)
  13. isfile(self, path)
  14. url(self, path)
  15. get_file(self, rpath, lpath, callback=_DEFAULT_CALLBACK, outfile=None, **kwargs)

@Wauplin
Copy link
Contributor

Wauplin commented May 24, 2024

Hi @lappemic, how did you find this list? It would be more or less this yes.

To be honest I would like to find a way to (semi-)automate the process and avoid maintaining the documentation manually. For most methods we would just need fsspec's docs but in some cases we will want to complete it with an additional paragraph (e.g. in document in get_file that it's more optimized than reading chunks).

Solutions I imagine:

  1. list supported methods in a markdown-like file. For each method, redirect to fsspec docs + add a sentence or two to explain the specificities of HffileSystem. Pro: easy to maintain/no complex logic. Cons: search bar would not index all specs/extra clicks needed on user's side.
  2. have a script to automatically generate docs based on fsspec + custom explanations. Pro: all info would be in our docs dircetly. Cons: more logic to maintain.

@severo @lhoestq @lappemic any opinion about this? Maybe we can start with 1., at least to have an idea of what we want and then think about 2. if we really need to. I'm open to other suggestions as well.

@severo
Copy link
Contributor Author

severo commented May 24, 2024

No preference on my side. I would say: the simplest one, because something is better than nothing.

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

No branches or pull requests

3 participants