From 65675ac96fc42e75bead8331bc37c51121068997 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Sun, 20 Nov 2022 07:58:45 +0000 Subject: [PATCH 01/11] no torch --- .github/workflows/code-checks.yml | 7 ++----- asv_bench/asv.conf.json | 1 + environment.yml | 1 - requirements-dev.txt | 1 - 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 583619826265c..eb78c9afb2896 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -117,15 +117,12 @@ jobs: - name: Set up Conda uses: ./.github/actions/setup-conda - - name: Build Pandas - id: build - uses: ./.github/actions/build_pandas - - name: Run ASV benchmarks run: | cd asv_bench asv machine --yes - asv run --quick --dry-run --strict --durations=30 --python=same + git fetch origin main:main + asv run --quick --dry-run --strict --durations=30 build_docker_dev_environment: name: Build Docker Dev Environment diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 4a0c882640eb6..74328d706893e 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -50,6 +50,7 @@ "numexpr": [], "pytables": [null, ""], // platform dependent, see excludes below "pyarrow": [], + "pytorch": [], "tables": [null, ""], "openpyxl": [], "xlsxwriter": [], diff --git a/environment.yml b/environment.yml index 3c1df67782132..4524961a634f6 100644 --- a/environment.yml +++ b/environment.yml @@ -69,7 +69,6 @@ dependencies: - pandas-datareader - pyyaml - py - - pytorch # local testing dependencies - moto diff --git a/requirements-dev.txt b/requirements-dev.txt index 30ee35db05c50..a5d531f616061 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -58,7 +58,6 @@ coverage pandas-datareader pyyaml py -torch moto flask asv From b1610416682f71ea49f052894ceedd68a6f9f8a9 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Mon, 21 Nov 2022 16:53:52 +0000 Subject: [PATCH 02/11] set matplotlib to minimum version --- asv_bench/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 74328d706893e..25b3499724108 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "matplotlib": [], + "matplotlib": ["3.6.1"], "sqlalchemy": [], "scipy": [], "numba": [], From 6c7af59abf555a1eaf117a4e01fafd1ada9e3a6d Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Mon, 21 Nov 2022 18:17:04 +0000 Subject: [PATCH 03/11] take mpl pin out again --- asv_bench/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 25b3499724108..74328d706893e 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "matplotlib": ["3.6.1"], + "matplotlib": [], "sqlalchemy": [], "scipy": [], "numba": [], From 4911efcbcfb61f4bde0810e08d86274a580b5f52 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Mon, 21 Nov 2022 22:26:29 +0000 Subject: [PATCH 04/11] use pip for matplotlib --- asv_bench/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 74328d706893e..34ff78fa928f5 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "matplotlib": [], + "pip+matplotlib>": ["3.6.1"], "sqlalchemy": [], "scipy": [], "numba": [], From 4005c85a44a55bf810945417fdc94bfa1f94068b Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Tue, 22 Nov 2022 09:01:13 +0000 Subject: [PATCH 05/11] remove default channel --- asv_bench/asv.conf.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 34ff78fa928f5..418f5b7a01ab3 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "pip+matplotlib>": ["3.6.1"], + "matplotlib>": ["3.6.1"], "sqlalchemy": [], "scipy": [], "numba": [], @@ -58,7 +58,7 @@ "odfpy": [], "jinja2": [], }, - "conda_channels": ["defaults", "conda-forge"], + "conda_channels": ["conda-forge"], // Combinations of libraries/python versions can be excluded/included // from the set to test. Each entry is a dictionary containing additional // key-value pairs to include/exclude. From 1dd83b68202e094457cd1eed78aaf9f29ec96524 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Tue, 22 Nov 2022 09:39:00 +0000 Subject: [PATCH 06/11] no pin needed if no default channel? --- asv_bench/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 418f5b7a01ab3..1d7fc17cd74b7 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "matplotlib>": ["3.6.1"], + "matplotlib": [], "sqlalchemy": [], "scipy": [], "numba": [], From 7487adb5322c3a1caa28a2dbae507b8e7953016c Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Tue, 22 Nov 2022 09:59:16 +0000 Subject: [PATCH 07/11] turns out we gotta pin --- asv_bench/asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 1d7fc17cd74b7..141a4ec9ea000 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "matplotlib": [], + "matplotlib": ["3.6.1"], "sqlalchemy": [], "scipy": [], "numba": [], From 56e91a7a21e6e4f784497325ff6ec0e1f4fa1b97 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Thu, 24 Nov 2022 12:57:23 +0000 Subject: [PATCH 08/11] :fire: remove torch --- asv_bench/asv.conf.json | 1 - asv_bench/benchmarks/frame_ctor.py | 17 ----------------- ci/deps/actions-38-downstream_compat.yaml | 1 - pandas/tests/test_downstream.py | 14 -------------- scripts/generate_pip_deps_from_conda.py | 2 +- 5 files changed, 1 insertion(+), 34 deletions(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 141a4ec9ea000..6482aec2395a3 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -50,7 +50,6 @@ "numexpr": [], "pytables": [null, ""], // platform dependent, see excludes below "pyarrow": [], - "pytorch": [], "tables": [null, ""], "openpyxl": [], "xlsxwriter": [], diff --git a/asv_bench/benchmarks/frame_ctor.py b/asv_bench/benchmarks/frame_ctor.py index 20c0c0ea2f6fe..6fe346fd7283d 100644 --- a/asv_bench/benchmarks/frame_ctor.py +++ b/asv_bench/benchmarks/frame_ctor.py @@ -205,21 +205,4 @@ def time_frame_from_arrays_sparse(self): ) -class From3rdParty: - # GH#44616 - - def setup(self): - try: - import torch - except ImportError: - raise NotImplementedError - - row = 700000 - col = 64 - self.val_tensor = torch.randn(row, col) - - def time_from_torch(self): - DataFrame(self.val_tensor) - - from .pandas_vb_common import setup # noqa: F401 isort:skip diff --git a/ci/deps/actions-38-downstream_compat.yaml b/ci/deps/actions-38-downstream_compat.yaml index 7e127b9dfebc1..b167d992a7c1a 100644 --- a/ci/deps/actions-38-downstream_compat.yaml +++ b/ci/deps/actions-38-downstream_compat.yaml @@ -67,4 +67,3 @@ dependencies: - pandas-datareader - pyyaml - py - - pytorch diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py index 1396ab262a79a..2f603f3700413 100644 --- a/pandas/tests/test_downstream.py +++ b/pandas/tests/test_downstream.py @@ -242,20 +242,6 @@ def test_pyarrow(df): tm.assert_frame_equal(result, df) -def test_torch_frame_construction(using_array_manager): - # GH#44616 - torch = import_module("torch") - val_tensor = torch.randn(700, 64) - - df = DataFrame(val_tensor) - - if not using_array_manager: - assert np.shares_memory(df, val_tensor) - - ser = Series(val_tensor[0]) - assert np.shares_memory(ser, val_tensor) - - def test_yaml_dump(df): # GH#42748 yaml = import_module("yaml") diff --git a/scripts/generate_pip_deps_from_conda.py b/scripts/generate_pip_deps_from_conda.py index a27d089cdb9e8..2ab45b32dee93 100755 --- a/scripts/generate_pip_deps_from_conda.py +++ b/scripts/generate_pip_deps_from_conda.py @@ -22,7 +22,7 @@ EXCLUDE = {"python", "c-compiler", "cxx-compiler"} REMAP_VERSION = {"tzdata": "2022.1"} -RENAME = {"pytables": "tables", "geopandas-base": "geopandas", "pytorch": "torch"} +RENAME = {"pytables": "tables", "geopandas-base": "geopandas"} def conda_package_to_pip(package: str): From 96c24798697438461d90a94b1cc6515fcb8b9e4e Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Thu, 24 Nov 2022 13:00:37 +0000 Subject: [PATCH 09/11] undo asv.conf.json change --- .github/workflows/code-checks.yml | 7 +++++-- asv_bench/asv.conf.json | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 54bef8f2eeadf..66bc7cd917b31 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -117,12 +117,15 @@ jobs: - name: Set up Conda uses: ./.github/actions/setup-conda + - name: Build Pandas + id: build + uses: ./.github/actions/build_pandas + - name: Run ASV benchmarks run: | cd asv_bench asv machine --yes - git fetch origin main:main - asv run --quick --dry-run --strict --durations=30 + asv run --quick --dry-run --strict --durations=30 --python=same build_docker_dev_environment: name: Build Docker Dev Environment diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 6482aec2395a3..4a0c882640eb6 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -43,7 +43,7 @@ "matrix": { "numpy": [], "Cython": ["0.29.32"], - "matplotlib": ["3.6.1"], + "matplotlib": [], "sqlalchemy": [], "scipy": [], "numba": [], @@ -57,7 +57,7 @@ "odfpy": [], "jinja2": [], }, - "conda_channels": ["conda-forge"], + "conda_channels": ["defaults", "conda-forge"], // Combinations of libraries/python versions can be excluded/included // from the set to test. Each entry is a dictionary containing additional // key-value pairs to include/exclude. From 36eb4f528c409a2a00eaa7a60e89cdc40291fea6 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Thu, 24 Nov 2022 13:02:03 +0000 Subject: [PATCH 10/11] comment out pytorch --- environment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/environment.yml b/environment.yml index 4524961a634f6..c76c4f930b80e 100644 --- a/environment.yml +++ b/environment.yml @@ -69,6 +69,7 @@ dependencies: - pandas-datareader - pyyaml - py + # - pytorch https://github.com/pandas-dev/pandas/pull/49798 # local testing dependencies - moto From b8fbd127008d1801de531c09853ce2c7413d82f9 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Thu, 24 Nov 2022 16:35:27 +0000 Subject: [PATCH 11/11] remove commented-out torch --- environment.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/environment.yml b/environment.yml index c76c4f930b80e..4524961a634f6 100644 --- a/environment.yml +++ b/environment.yml @@ -69,7 +69,6 @@ dependencies: - pandas-datareader - pyyaml - py - # - pytorch https://github.com/pandas-dev/pandas/pull/49798 # local testing dependencies - moto