Skip to content

Commit

Permalink
update workflow for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Dec 3, 2024
1 parent 8bcbc27 commit 6f0199d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
15 changes: 6 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions docs/update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:])

Expand Down

0 comments on commit 6f0199d

Please sign in to comment.