pfnet / pfio

IO library to access various filesystems with unified API
https://pfio.readthedocs.io/
MIT License
52 stars 20 forks source link

Add function interface to add custom scheme #321

Closed niboshi closed 1 year ago

niboshi commented 1 year ago

pfio has the ability to configure additional custom schemes via an ini file (https://pfio.readthedocs.io/en/latest/design.html#custom-scheme). However, there are cases where we prefer not to rely on the environment and instead configure custom schemes explicitly.

pfio.v2.config.add_custom_scheme() in this PR would allow programs to configure custom schemes prior to using other pfio features without relying on an environment file.

niboshi commented 1 year ago

Is this PR responsible for these errors?

tests/v2_tests/test_fs.py:87:16: E721 do not compare types, for exact checks use is / is not, for instance checks use isinstance() tests/v2_tests/test_s3_zip.py:29:48: E231 missing whitespace after ',' tests/v2_tests/test_s3_zip.py:160:48: E231 missing whitespace after ','

kuenishi commented 1 year ago

@niboshi Sorry, I've been that late. I think the code is all OK to me, but please add documentation stuff; e.g. add a reference line in docs/source/reference.rst .

niboshi commented 1 year ago

Thank you. I have a question on the comment about loading: https://github.com/pfnet/pfio/pull/321#discussion_r1311020044 Please check it :bow: