From 9ea9c41602e52eeeafaf4e7ec851723fd3af4b36 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 1 Dec 2024 13:02:54 +0000 Subject: [PATCH] add doctest to ci --- docs/index.rst | 4 +--- docs/user/common.rst | 3 ++- docs/user/reading.rst | 5 ++++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 56a0d54..1e168f7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -68,15 +68,13 @@ Pint-pandas: Unit support for pandas User Guide Advanced topics ecosystem - API Reference .. toctree:: :maxdepth: 1 :hidden: :caption: For developers - dev/contributing - dev/pint-convert + dev/contributing .. toctree:: :maxdepth: 1 diff --git a/docs/user/common.rst b/docs/user/common.rst index 0256db0..69c719f 100644 --- a/docs/user/common.rst +++ b/docs/user/common.rst @@ -59,7 +59,8 @@ The default operation of Pandas `pd.concat` function is to perform row-wise conc .. ipython:: python :suppress: - :okwarning: + :okexcept: + df = pd.concat(list_of_series, axis=1) diff --git a/docs/user/reading.rst b/docs/user/reading.rst index 93a57f5..25bada4 100644 --- a/docs/user/reading.rst +++ b/docs/user/reading.rst @@ -40,7 +40,10 @@ Let's read that into a DataFrame. Here io.StringIO is used in place of reading a df = pd.read_csv(io.StringIO(test_data), header=[0, 1], index_col=[0, 1]).T # df = pd.read_csv("/path/to/test_data.csv", header=[0, 1]) for col in df.columns: - df[col] = pd.to_numeric(df[col], errors="ignore") + try: + df[col] = pd.to_numeric(df[col]) + except ValueError: + pass df.dtypes