コード例 #1
0
def test_factory_switch():
    Engine.put("Test")
    assert FactoryDispatcher.get_factory() == PandasOnTestFactory
    assert FactoryDispatcher.get_factory().io_cls == "Foo"
    Engine.put("Python")  # revert engine to default

    StorageFormat.put("Test")
    assert FactoryDispatcher.get_factory() == TestOnPythonFactory
    assert FactoryDispatcher.get_factory().io_cls == "Bar"
    StorageFormat.put("Pandas")  # revert engine to default
コード例 #2
0
ファイル: test_dispatcher.py プロジェクト: zhfanrui/modin
def test_engine_switch():
    Engine.put("Test")
    assert EngineDispatcher.get_engine() == PandasOnTestFactory
    assert EngineDispatcher.get_engine().io_cls == "Foo"
    Engine.put("Python")  # revert engine to default

    Backend.put("Test")
    assert EngineDispatcher.get_engine() == TestOnPythonFactory
    assert EngineDispatcher.get_engine().io_cls == "Bar"
    Backend.put("Pandas")  # revert engine to default
コード例 #3
0
ファイル: test_dispatcher.py プロジェクト: zhfanrui/modin
def test_engine_wrong_factory():
    with pytest.raises(FactoryNotFoundError):
        Engine.put("BadEngine")
    Engine.put("Python")  # revert engine to default
コード例 #4
0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.

import os
import pandas
import numpy as np
import pyarrow
import pytest

from modin.config import IsExperimental, Engine, Backend

IsExperimental.put(True)
Engine.put("ray")
Backend.put("omnisci")

import modin.pandas as pd
from modin.pandas.test.utils import (
    df_equals,
    bool_arg_values,
    to_pandas,
    test_data_values,
    test_data_keys,
    generate_multiindex,
    eval_general,
)


def set_execution_mode(frame, mode, recursive=False):