Skip to content

Commit

Permalink
config
Browse files Browse the repository at this point in the history
  • Loading branch information
luweizheng committed Oct 5, 2024
1 parent 02c7fc7 commit 229998b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
12 changes: 8 additions & 4 deletions doc/source/user_guide/chunking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,22 @@ In CPU environments, setting this value higher may not yield substantial benefit
have a large amount of RAM available. However, in GPU scenarios, it's advisable to set this value
higher to maximize the data size within each chunk, thereby minimizing data transfer between GPUs.

You can set this value inside a context:
You can set this value with a context: :code:`xorbits.pandas.option_context({"chunk_store_limit": 1024 ** 3})`.

.. code-block:: python
with xorbits.option_context({"chunk_store_limit": 1024 ** 3}):
import xorbits.pandas as xpd
with xpd.option_context({"chunk_store_limit": 1024 ** 3}):
# your xorbits code
Or you can set this value at the begining of your Python script:
Or you can set this value at the begining of your Python script: :code:`xorbits.pandas.set_option({"chunk_store_limit": 1024 ** 3})`

.. code-block:: python
xorbits.options.chunk_store_limit = 1024 ** 3
import xorbits.pandas as xpd
xpd.set_option("chunk_store_limit", 1024 ** 3)
# your xorbits code
Manually
Expand Down
3 changes: 1 addition & 2 deletions python/xorbits/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@


from . import _version
from .config import option_context, options
from .core import run
from .deploy import init, shutdown

Expand Down Expand Up @@ -45,4 +44,4 @@ def _install():

__version__ = _version.get_versions()["version"]

__all__ = ["init", "shutdown", "run", "options", "option_context"]
__all__ = ["init", "shutdown", "run"]
1 change: 0 additions & 1 deletion python/xorbits/config.py

This file was deleted.

2 changes: 1 addition & 1 deletion python/xorbits/pandas/_config/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_options_execute(setup):

# test reset options
xpd.reset_option("chunk_store_limit")
assert xpd.get_option("chunk_store_limit") == 134217728
assert xpd.get_option("chunk_store_limit") == 536870912
xpd.reset_option("display.max_rows")
assert xpd.get_option("display.max_rows") == 60

Expand Down

0 comments on commit 229998b

Please sign in to comment.