From 6f0199d2c41286a17acbc8cd51b464be1b014ca1 Mon Sep 17 00:00:00 2001 From: Ali Khan Date: Mon, 2 Dec 2024 21:00:14 -0500 Subject: [PATCH] update workflow for readme --- .github/workflows/update_readme.yml | 15 ++++++++++++++- README.md | 15 ++++++--------- docs/update_readme.py | 2 -- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/update_readme.yml b/.github/workflows/update_readme.yml index eb9f6a4..50a89ff 100644 --- a/.github/workflows/update_readme.yml +++ b/.github/workflows/update_readme.yml @@ -21,14 +21,27 @@ jobs: with: python-version: '3.x' + - name: Install uv + uses: astral-sh/setup-uv@v4 + + + - name: "Set up Python" + uses: actions/setup-python@v5 + with: + python-version-file: ".python-version" + + - name: Install the project + run: uv sync --all-extras --dev + - name: Install dependencies run: | + uv python install python -m pip install --upgrade pip pip install . - name: Update README run: | - python doc/update_readme.py + uv run docs/update_readme.py - name: Commit and push changes run: | diff --git a/README.md b/README.md index a2b1a4f..c4b3e3e 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,8 @@ fig = plot_hipp_surf(label_gii.format(density=density), hemi=None, density=densi fig = plot_hipp_surf(label_gii.format(density=density), hemi=None, density=density, view='ventral') ``` -![png](doc/example1_0.png) -![png](doc/example1_1.png) +![png](docs/example1_0.png) +![png](docs/example1_1.png) ### Example 2: Plot Left and Right Hemispheres Separately @@ -59,8 +59,8 @@ fig = plot_hipp_surf(label_gii.format(density=density), hemi='right', density=de ``` -![png](doc/example2_0.png) -![png](doc/example2_1.png) +![png](docs/example2_0.png) +![png](docs/example2_1.png) ### Example 3: Plot unfolded and canonical space separately @@ -79,14 +79,13 @@ fig = plot_hipp_surf(label_gii.format(density=density), space='unfold', density= fig = plot_hipp_surf(label_gii.format(density=density), space='canonical', density=density, view='dorsal') ``` -![png](doc/example3_0.png) -![png](doc/example3_1.png) +![png](docs/example3_0.png) +![png](docs/example3_1.png) ## 🛠️ Functions ### `plot_hipp_surf` -```python Plot hippocampal surface map. This function plots a surface map of the hippocampus, which can be a label-hippdentate shape.gii, func.gii, or a Vx1 array @@ -141,8 +140,6 @@ can also be applied here, overriding the defaults set below. ###### Notes By default, this function will plot one hemisphere (left by default) in both canonical and unfolded space. Both surfaces can be plotted with hemi=None, but the same surf_map will be plotted on both. -``` - ## 🧪 Testing To run the tests, including unit tests and docstring tests, use the following command: diff --git a/docs/update_readme.py b/docs/update_readme.py index 1af6cf5..19c3a7c 100644 --- a/docs/update_readme.py +++ b/docs/update_readme.py @@ -38,9 +38,7 @@ def update_readme(readme_path, docstrings): new_lines = lines[:start_functions + 2] for func_name, docstring in docstrings.items(): new_lines.append(f"### `{func_name}`\n\n") - new_lines.append("```python\n") new_lines.append(f"{docstring}\n") - new_lines.append("```\n\n") new_lines.extend(lines[end_functions:])