From bdb68f75ae3bacb926bc1301af690860eac199d8 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 22 Nov 2024 10:14:58 -0500 Subject: [PATCH 1/6] chore(tox): Add UV_EXTRA_INDEX_URL for pre-releases --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index d3d58f325a9..a90b454aee1 100644 --- a/tox.ini +++ b/tox.ini @@ -42,6 +42,7 @@ pass_env = extras = tests setenv = pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple + pre: UV_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple uv_resolution = min: lowest-direct From 6e3dd279ae4730fff090309bdf74ffca185b50ec Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 22 Nov 2024 10:59:58 -0500 Subject: [PATCH 2/6] fix: Copy correlation values before zeroing diagonal --- niworkflows/viz/plots.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/niworkflows/viz/plots.py b/niworkflows/viz/plots.py index a4659ed5b58..a591ce6704b 100644 --- a/niworkflows/viz/plots.py +++ b/niworkflows/viz/plots.py @@ -926,7 +926,11 @@ def confounds_correlation_plot( gs_descending = gs_descending[:max_dim] features = [p for p in corr.columns if p in gs_descending] corr = corr.loc[features, features] - np.fill_diagonal(corr.values, 0) + + # Modifying in-place is no longer supported + corr_vals = corr.to_numpy(copy=True) + np.fill_diagonal(corr_vals, 0) + corr.iloc[:, :] = corr_vals if figure is None: plt.figure(figsize=(15, 5)) From b992befd30fe720ccd5e9cb3337e19ab1546eaf1 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 21 Nov 2024 16:19:49 -0500 Subject: [PATCH 3/6] fix: Pandas deprecation --- niworkflows/interfaces/utility.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/niworkflows/interfaces/utility.py b/niworkflows/interfaces/utility.py index b0c6684dd5d..2f0b1843f39 100644 --- a/niworkflows/interfaces/utility.py +++ b/niworkflows/interfaces/utility.py @@ -251,8 +251,7 @@ class AddTSVHeader(SimpleInterface): >>> addheader.inputs.in_file = 'data.tsv' >>> addheader.inputs.columns = ['a', 'b', 'c', 'd', 'e'] >>> res = addheader.run() - >>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True, - ... index_col=None) + >>> df = pd.read_csv(res.outputs.out_file, sep='\s+', index_col=None) >>> df.columns.ravel().tolist() ['a', 'b', 'c', 'd', 'e'] @@ -311,7 +310,7 @@ class JoinTSVColumns(SimpleInterface): >>> join.inputs.in_file = 'data.tsv' >>> join.inputs.join_file = 'add.tsv' >>> res = join.run() - >>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True, + >>> df = pd.read_csv(res.outputs.out_file, sep='\s+', ... index_col=None, dtype=float, header=None) >>> df.columns.ravel().tolist() == list(range(5)) True @@ -328,8 +327,7 @@ class JoinTSVColumns(SimpleInterface): >>> res = join.run() >>> res.outputs.out_file # doctest: +ELLIPSIS '...data_joined.tsv' - >>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True, - ... index_col=None) + >>> df = pd.read_csv(res.outputs.out_file, sep='\s+', index_col=None) >>> df.columns.ravel().tolist() ['a', 'b', 'c', 'd', 'e'] @@ -342,8 +340,7 @@ class JoinTSVColumns(SimpleInterface): >>> join.inputs.side = 'left' >>> join.inputs.columns = ['a', 'b', 'c', 'd', 'e'] >>> res = join.run() - >>> df = pd.read_csv(res.outputs.out_file, delim_whitespace=True, - ... index_col=None) + >>> df = pd.read_csv(res.outputs.out_file, sep='\s+', index_col=None) >>> df.columns.ravel().tolist() ['a', 'b', 'c', 'd', 'e'] From 47b0fa4ffc85565dda2a47f937bd0e146752059f Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 22 Nov 2024 11:21:48 -0500 Subject: [PATCH 4/6] chore(tox): Pass environment variables --- tox.ini | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a90b454aee1..801670033fa 100644 --- a/tox.ini +++ b/tox.ini @@ -27,6 +27,20 @@ labels = test pip_pre = pre: true pass_env = + TEMPLATEFLOW_HOME + # Freesurfer variables searched for + FREESURFER_HOME + SUBJECTS_DIR + FS_LICENSE + # CI variables + TEST_DATA_HOME + TEST_OUTPUT_DIR + TEST_WORK_DIR + FMRIPREP_REGRESSION_SOURCE + CACHED_WORK_DIRECTORY + # CircleCI-specific + CIRCLE_NPROCS + SAVE_CIRCLE_ARTIFACTS # getpass.getuser() sources for Windows: LOGNAME USER @@ -92,7 +106,6 @@ set_env = # https://github.com/pypa/pip/issues/11684 # https://github.com/pypa/pip/issues/12243 strict: PYTHONWARNINGS=error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:Unimplemented abstract methods {'locate_file'}:DeprecationWarning:pip._internal.metadata.importlib._dists -commands_pre = commands = python -m build python -m twine check dist/* From 6b67e1abca29f95d83c59411e8c4d4b543616aa5 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 22 Nov 2024 11:24:28 -0500 Subject: [PATCH 5/6] chore(ci): Enable Python 3.13 tests --- .github/workflows/pythonpackage.yml | 2 +- tox.ini | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 9d2ea662066..e1f5c5c82a0 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -94,7 +94,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] dependencies: [latest, pre] include: - python-version: "3.9" diff --git a/tox.ini b/tox.ini index 801670033fa..6efe90bb503 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,7 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [gh-actions:env] DEPENDS = @@ -53,6 +54,8 @@ pass_env = CLICOLOR CLICOLOR_FORCE PYTHON_GIL +deps = + py313: traits @ git+https://github.com/enthought/traits.git@10954eb extras = tests setenv = pre: PIP_EXTRA_INDEX_URL=https://pypi.anaconda.org/scientific-python-nightly-wheels/simple From 6bac0d984fc376622b1ebcec4536903f6d4b8e48 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 22 Nov 2024 11:49:52 -0500 Subject: [PATCH 6/6] chore: Disable 3.13. runs until traits is figured out --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index e1f5c5c82a0..f0474c03629 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -94,7 +94,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.9", "3.10", "3.11", "3.12"] #, "3.13"] dependencies: [latest, pre] include: - python-version: "3.9"