Python pandas.tseries.converter._WARN Examples

The following are 20 code examples of pandas.tseries.converter._WARN(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.tseries.converter , or try the search function .
Example #1
Source File: test_converter.py    From twitter-stock-recommendation with MIT License 6 votes vote down vote up
def test_option_no_warning(self):
        pytest.importorskip("matplotlib.pyplot")
        ctx = cf.option_context("plotting.matplotlib.register_converters",
                                False)
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        converter._WARN = True
        # Test without registering first, no warning
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0

        # Now test with registering
        converter._WARN = True
        register_matplotlib_converters()
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #2
Source File: test_converter.py    From recruit with Apache License 2.0 6 votes vote down vote up
def test_option_no_warning(self):
        pytest.importorskip("matplotlib.pyplot")
        ctx = cf.option_context("plotting.matplotlib.register_converters",
                                False)
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        converter._WARN = True
        # Test without registering first, no warning
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0

        # Now test with registering
        converter._WARN = True
        register_matplotlib_converters()
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #3
Source File: test_converter.py    From coffeegrindsize with MIT License 6 votes vote down vote up
def test_option_no_warning(self):
        pytest.importorskip("matplotlib.pyplot")
        ctx = cf.option_context("plotting.matplotlib.register_converters",
                                False)
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        converter._WARN = True
        # Test without registering first, no warning
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0

        # Now test with registering
        converter._WARN = True
        register_matplotlib_converters()
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #4
Source File: test_converter.py    From vnpy_crypto with MIT License 6 votes vote down vote up
def test_option_no_warning(self):
        pytest.importorskip("matplotlib.pyplot")
        ctx = cf.option_context("plotting.matplotlib.register_converters",
                                False)
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        converter._WARN = True
        # Test without registering first, no warning
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0

        # Now test with registering
        converter._WARN = True
        register_matplotlib_converters()
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #5
Source File: test_converter.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 6 votes vote down vote up
def test_option_no_warning(self):
        pytest.importorskip("matplotlib.pyplot")
        ctx = cf.option_context("plotting.matplotlib.register_converters",
                                False)
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        converter._WARN = True
        # Test without registering first, no warning
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0

        # Now test with registering
        converter._WARN = True
        register_matplotlib_converters()
        with ctx:
            with tm.assert_produces_warning(None) as w:
                ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #6
Source File: test_converter.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_pandas_plots_register(self):
        pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(None) as w:
            s.plot()

        assert len(w) == 0 
Example #7
Source File: test_converter.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_pandas_plots_register(self):
        pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(None) as w:
            s.plot()

        assert len(w) == 0 
Example #8
Source File: test_converter.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_registering_no_warning(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        register_matplotlib_converters()
        with tm.assert_produces_warning(None) as w:
            ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #9
Source File: test_converter.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_warns(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warning" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False) as w:
            ax.plot(s.index, s.values)
            plt.close()

        assert len(w) == 1
        assert "Using an implicitly registered datetime converter" in str(w[0]) 
Example #10
Source File: test_converter.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_pandas_plots_register(self):
        pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(None) as w:
            s.plot()

        assert len(w) == 0 
Example #11
Source File: test_converter.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_registering_no_warning(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        register_matplotlib_converters()
        with tm.assert_produces_warning(None) as w:
            ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #12
Source File: test_converter.py    From coffeegrindsize with MIT License 5 votes vote down vote up
def test_warns(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warning" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False) as w:
            ax.plot(s.index, s.values)
            plt.close()

        assert len(w) == 1
        assert "Using an implicitly registered datetime converter" in str(w[0]) 
Example #13
Source File: test_converter.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_warns(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warning" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False) as w:
            ax.plot(s.index, s.values)
            plt.close()

        assert len(w) == 1
        assert "Using an implicitly registered datetime converter" in str(w[0]) 
Example #14
Source File: test_converter.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_registering_no_warning(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        register_matplotlib_converters()
        with tm.assert_produces_warning(None) as w:
            ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #15
Source File: test_converter.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_warns(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warning" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False) as w:
            ax.plot(s.index, s.values)
            plt.close()

        assert len(w) == 1
        assert "Using an implicitly registered datetime converter" in str(w[0]) 
Example #16
Source File: test_converter.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_pandas_plots_register(self):
        pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(None) as w:
            s.plot()

        assert len(w) == 0 
Example #17
Source File: test_converter.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_registering_no_warning(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        register_matplotlib_converters()
        with tm.assert_produces_warning(None) as w:
            ax.plot(s.index, s.values)

        assert len(w) == 0 
Example #18
Source File: test_converter.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_warns(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warning" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(FutureWarning,
                                        check_stacklevel=False) as w:
            ax.plot(s.index, s.values)
            plt.close()

        assert len(w) == 1
        assert "Using an implicitly registered datetime converter" in str(w[0]) 
Example #19
Source File: test_converter.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_pandas_plots_register(self):
        pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        with tm.assert_produces_warning(None) as w:
            s.plot()

        assert len(w) == 0 
Example #20
Source File: test_converter.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_registering_no_warning(self):
        plt = pytest.importorskip("matplotlib.pyplot")
        s = Series(range(12), index=date_range('2017', periods=12))
        _, ax = plt.subplots()

        # Set to the "warn" state, in case this isn't the first test run
        converter._WARN = True
        register_matplotlib_converters()
        with tm.assert_produces_warning(None) as w:
            ax.plot(s.index, s.values)

        assert len(w) == 0