diff --git a/.github/workflows/pr-close.yml b/.github/workflows/pr-close.yml deleted file mode 100644 index d8833f18..00000000 --- a/.github/workflows/pr-close.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: delete preview on PR close -on: - pull_request_target: - types: [closed] - -jobs: - delete_preview: - runs-on: ubuntu-latest - env: - PR_PATH: pull/${{github.event.number}} - steps: - - name: Checkout website repo - uses: actions/checkout@v4 - with: - ref: gh-pages - - - name: Delete preview - run: | - git rm -r ${{ env.PR_PATH }} - git commit -m "Delete preview for PR #${{ github.event.number }}" - git push origin gh-pages - - - name: Comment on PR - uses: hasura/comment-progress@v2.2.0 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - number: ${{ github.event.number }} - id: deploy-preview - message: "🪓 PR closed, deleted preview at https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/" \ No newline at end of file diff --git a/.github/workflows/preview-html.yml b/.github/workflows/preview-html.yml new file mode 100644 index 00000000..1c0996b6 --- /dev/null +++ b/.github/workflows/preview-html.yml @@ -0,0 +1,86 @@ +name: HTML Preview + +on: + workflow_run: + workflows: ["Github Pages"] + types: [completed] + +jobs: + get-pr-number: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.event == 'pull_request' }} + outputs: + output1: ${{ steps.echo_pr_nb.outputs.pr_number }} + steps: + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v2.11.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: publish.yml + run_id: ${{ github.event.workflow_run.id }} + - name: Read the pull_request_number.txt file + id: pull_request_number_reader + uses: juliangruber/read-file-action@v1.0.0 + with: + path: ./pull_request_number/pull_request_number.txt + - name: Echo pull_request_number + id: echo_pr_nb + run: echo "pr_number=${{ steps.pull_request_number_reader.outputs.content }}" >> $GITHUB_OUTPUT + + on-failure: + runs-on: ubuntu-latest + needs: get-pr-number + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure' }} + steps: + - name: 'Comment on PR - Waiting for deployment' + uses: hasura/comment-progress@v2.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ needs.get-pr-number.outputs.output1 }} + id: deploy-preview + message: "⚠️⚠️⚠️ Build Failed: No preview available." + + on-success: + runs-on: ubuntu-latest + needs: get-pr-number + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + env: + PR_PATH: dipy.org/pull/${{needs.get-pr-number.outputs.output1}} + BASE_URL: https://dipy.github.io/preview-html + steps: + - name: 'Comment on PR - Waiting for deployment' + uses: hasura/comment-progress@v2.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ needs.get-pr-number.outputs.output1 }} + id: deploy-preview + message: "Starting deployment of preview ⏳..." + - name: Download workflow artifact + uses: dawidd6/action-download-artifact@v2.11.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: publish.yml + run_id: ${{ github.event.workflow_run.id }} + name: DocumentationHTML + path: ./DocumentationHTML + - name: Deploy to PR preview + uses: peaceiris/actions-gh-pages@v3 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} + external_repository: dipy/preview-html + publish_dir: ./DocumentationHTML + publish_branch: main + destination_dir: ${{ env.PR_PATH }} + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + commit_message: ${{ github.event.head_commit.message }} + - name: Update comment + uses: hasura/comment-progress@v2.3.0 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ needs.get-pr-number.outputs.output1 }} + id: deploy-preview + message: "A preview of ${{ github.event.workflow_run.head_commit.message }} is uploaded and can be seen here:\n\n ✨ ${{ env.BASE_URL }}/${{ env.PR_PATH }} ✨\n\nChanges may take a few minutes to propagate. The source is here: https://github.com/dipy/preview-html/tree/main/${{ env.PR_PATH }}/" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7b7ee436..4986c201 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,15 @@ -name: github pages +name: Github Pages on: push: branches: - master + pull_request: + types: [opened, synchronize, edited, reopened] + branches: + - master pull_request_target: + types: [closed] branches: - master schedule: @@ -12,13 +17,10 @@ on: jobs: deploy: + if: ${{ github.event.action != 'closed' }} runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - issues: write env: - PR_PATH: pull/${{github.event.number}} + PR_PATH: dipy.org/pull/${{github.event.number}} BASE_URL: https://dipy.github.io/dipy.org HEAD: ${{ github.event.pull_request.head.repo.full_name }} BASE: ${{ github.repository }} @@ -26,15 +28,19 @@ jobs: REF: ${{github.ref}} STATUS: ${{github.event.pull_request.head.repo.full_name != github.repository}} steps: - - name: Comment on PR - uses: hasura/comment-progress@v2.3.0 - if: ${{ github.event.pull_request.head.repo.full_name != '' && github.event.pull_request.head.repo.full_name != github.repository }} + - name: Save the PR number in an artifact + if: ${{ github.event_name == 'pull_request' }} + shell: bash + env: + PULL_REQUEST_NUMBER: ${{ github.event.number }} + run: echo $PULL_REQUEST_NUMBER > pull_request_number.txt + + - name: Upload the PULL REQUEST number + if: ${{ github.event_name == 'pull_request' }} + uses: actions/upload-artifact@v2 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - number: ${{ github.event.number }} - id: deploy-preview - message: "Starting deployment of preview ⏳..." + name: pull_request_number + path: ./pull_request_number.txt - name: Checkout website repo uses: actions/checkout@v4 @@ -54,14 +60,14 @@ jobs: make -C . html - name: Upload HTML - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v2 with: name: DocumentationHTML path: _build/html/ - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == github.repository }} + if: ${{ (github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == github.repository) && github.repository_owner == 'dipy'}} with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./_build/html @@ -69,26 +75,32 @@ jobs: user_email: 'github-actions[bot]@users.noreply.github.com' commit_message: ${{ github.event.head_commit.message }} # cname: ${{ env.DOMAIN # TODO: set this if you're using a custom domain. + on-closed: + runs-on: ubuntu-latest + if: ${{ github.event.action == 'closed' }} + env: + PR_PATH: dipy.org/pull/${{github.event.number}} + steps: + - name: make empty dir + run: mkdir public - - name: Deploy to PR preview + - name: delete folder uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event.pull_request.head.repo.full_name != '' && github.event.pull_request.head.repo.full_name != github.repository }} with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html + deploy_key: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} + external_repository: dipy/preview-html + publish_dir: ./public + publish_branch: main destination_dir: ${{ env.PR_PATH }} - keep_files: true user_name: 'github-actions[bot]' user_email: 'github-actions[bot]@users.noreply.github.com' commit_message: ${{ github.event.head_commit.message }} - - name: Update comment - uses: hasura/comment-progress@v2.3.0 - if: ${{ github.event.pull_request.head.repo.full_name != '' && github.event.pull_request.head.repo.full_name != github.repository }} + - name: Update PR Comment + uses: hasura/comment-progress@v2.2.0 with: - github-token: ${{ secrets.GITHUB_TOKEN }} - repository: ${{ github.repository }} - number: ${{ github.event.number }} - id: deploy-preview - message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n ✨ ${{ env.BASE_URL }}/${{ env.PR_PATH }} ✨\n\nChanges may take a few minutes to propagate. The source is here: https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/" - + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} + id: deploy-preview + message: "🪓 PR closed, deleted preview at https://github.com/dipy/preview-html/tree/main/${{ env.PR_PATH }}/" diff --git a/conf.py b/conf.py index cc0d4976..f8bd186f 100644 --- a/conf.py +++ b/conf.py @@ -174,38 +174,48 @@ }, { "name": "Workshops", - "children": [ - { - "name": "DIPY Workshop 2024", - "url": "https://dipy.org/workshops/dipy-workshop-2024", - "link_type": "external" - }, - { - "name": "DIPY Workshop 2023", - "url": "https://dipy.org/workshops/dipy-workshop-2023", - "link_type": "external" - }, - { - "name": "DIPY Workshop 2022", - "url": "https://dipy.org/workshops/dipy-workshop-2022", - "link_type": "external" - }, - { - "name": "DIPY Workshop 2021", - "url": "https://dipy.org/workshops/dipy-workshop-2021", - "link_type": "external" - }, + "sections": [ { - "name": "DIPY Workshop 2020", - "url": "https://dipy.org/workshops/dipy-workshop-2020", - "link_type": "external" + "name": "Latest", + "children": [ + { + "name": "DIPY Workshop 2024", + "url": "https://dipy.org/workshops/dipy-workshop-2024", + "link_type": "external" + } + ] }, { - "name": "DIPY Workshop 2019", - "url": "https://dipy.org/workshops/dipy-workshop-2019", - "link_type": "external" - }, - ] + "name": "Past", + "children": [ + { + "name": "DIPY Workshop 2023", + "url": "https://dipy.org/workshops/dipy-workshop-2023", + "link_type": "external" + }, + { + "name": "DIPY Workshop 2022", + "url": "https://dipy.org/workshops/dipy-workshop-2022", + "link_type": "external" + }, + { + "name": "DIPY Workshop 2021", + "url": "https://dipy.org/workshops/dipy-workshop-2021", + "link_type": "external" + }, + { + "name": "DIPY Workshop 2020", + "url": "https://dipy.org/workshops/dipy-workshop-2020", + "link_type": "external" + }, + { + "name": "DIPY Workshop 2019", + "url": "https://dipy.org/workshops/dipy-workshop-2019", + "link_type": "external" + }, + ] + } + ], }, { "name": "Community", @@ -215,7 +225,7 @@ "children": [ { "name": "Newsletters", - "url": "", + "url": "https://mail.python.org/mailman3/lists/dipy.python.org/", "link_type": "external" }, { @@ -224,7 +234,7 @@ }, { "name": "Youtube", - "url": "blog", + "url": "https://www.youtube.com/c/diffusionimaginginpython", "link_type": "external" } ] @@ -234,16 +244,17 @@ "children": [ { "name": "Live Chat (Gitter)", - "url": "" + "url": "https://app.gitter.im/#/room/%23dipy_dipy:gitter.im", + "external": True }, { "name": "Github Discussions", - "url": "", + "url": "https://github.com/dipy/dipy/discussions", "link_type": "external" } ] } - ] + ] }, { "name": "About", @@ -315,15 +326,16 @@ "links": [ { "name": "Developers", - "link": "https://dipy.org/contributors/" + "link": "team" }, { "name": "Support", - "link": "https://dipy.org/contributors/" + "link": "https://github.com/dipy/dipy/discussions", + "link_type": "external" }, { "name": "Download", - "link": "https://dipy.org/contributors/" + "link": "installation" }, { "name": "Get Started", @@ -331,11 +343,13 @@ }, { "name": "Tutorials", - "link": "https://dipy.org/contributors/" + "link": "https://docs.dipy.org/tutorials/", + "link_type": "external" }, { "name": "Videos", - "link": "https://dipy.org/contributors/" + "link": "https://www.youtube.com/c/diffusionimaginginpython", + "link_type": "external" }, ] }, { @@ -343,23 +357,23 @@ "links": [ { "name": "Nipy Projects", - "link": "", - "external": True + "link": "http://nipy.org/", + "link_type": "external" }, { "name": "FURY", - "link": "", - "external": True + "link": "http://fury.gl/", + "link_type": "external" }, { "name": "Nibabel", - "link": "", - "external": True + "link": "http://nipy.org/nibabel", + "link_type": "external" }, { "name": "Tortoise", - "link": "", - "external": True + "link": "https://tortoise.nibib.nih.gov/", + "link_type": "external" }, ] }, { @@ -367,23 +381,23 @@ "links": [ { "name": "The department of Intelligent Systems Engineering of Indiana University", - "link": "", - "external": True + "link": "https://engineering.indiana.edu/", + "link_type": "external" }, { "name": "The National Institute of Biomedical Imaging and Bioengineering, NIH", - "link": "", - "external": True + "link": "https://www.nibib.nih.gov/", + "link_type": "external" }, { "name": "The Gordon and Betty Moore Foundation and the Alfred P. Sloan Foundation, through the University of Washington eScience Institute Data Science Environment", - "link": "", - "external": True + "link": "https://escience.washington.edu/tag/alfred-p-sloan-foundation/", + "link_type": "external" }, { "name": "Google supported DIPY through the Google Summer of Code Program during Summer 2015, 2016, 2018", - "link": "", - "external": True + "link": "https://summerofcode.withgoogle.com/", + "link_type": "external" }, ] } diff --git a/index.rst b/index.rst index 26a989e8..71db6304 100644 --- a/index.rst +++ b/index.rst @@ -31,19 +31,6 @@ Highlights - Large documentation update. Integration of Sphinx-Gallery. - Closed 53 issues and merged 34 pull requests. -See :ref:`Older Highlights `. - -************* -Announcements -************* -- :doc:`DIPY 1.7.0 ` released April 23, 2023. -- :doc:`DIPY 1.6.0 ` released January 16, 2023. -- :doc:`DIPY 1.5.0 ` released March 11, 2022. - - - - - See some of our :ref:`Past Announcements ` diff --git a/posts/2023/2023_08_21_vara_week_12_13.rst b/posts/2023/2023_08_21_vara_week_12_13.rst index ee8dee4a..b79f5798 100644 --- a/posts/2023/2023_08_21_vara_week_12_13.rst +++ b/posts/2023/2023_08_21_vara_week_12_13.rst @@ -15,7 +15,7 @@ Monai's VQVAE results on T1-weighted NFBS dataset, 125 samples, for batch size o 2. dipy's ``resize`` & scipy's ``affine_transform`` scale the volume to (128,128,128,1) shape & (1,1,1) voxel size 3. MinMax normalization to limit the range of intensities to (0,1) -Using existing training parameters, carried out two experiments, one on CC359 alone & another on both datasets combined. Additionally, I made a slight modification in the loss definition by attributing different weights of 0.5 & 1 to background & foreground pixels compared to equal weights from previous experiments. This resulted in faster convergence as shown in the red, blue & purple lines in the combined plot shown below. (Naming convention for each each training curve is ``B-``, where CC=CC359, NFBS=NFBS, both=[NFBS,CC359]) +Using existing training parameters, carried out two experiments, one on CC359 alone & another on both datasets combined. Additionally, I made a slight modification in the loss definition by attributing different weights of 0.5 & 1 to background & foreground pixels compared to equal weights from previous experiments. This resulted in faster convergence as shown in the red, blue & purple lines in the combined plot shown below. (Naming convention for each training curve is ``B-``, where CC=CC359, NFBS=NFBS, both=[NFBS,CC359]) .. image:: /_static/images/vqvae3d-monai-training-plots.png :alt: Combined trainings plots for all experiments @@ -27,13 +27,13 @@ Inference results on the best performing model, B12-both, is shown below, where :alt: VQVAE-Monai-B12-both reconstructions & originals showing equally spaced 5 slices for 2 different test samples :width: 800 -Here's a similar visualization of the inference on the next best performing model, B12-CC. +Here's a similar visualization of the inference on the next best performing model, B12-CC. .. image:: /_static/images/vqvae-monai-B12-CC.png :alt: VQVAE-Monai-B12-CC reconstructions & originals showing equally spaced 5 slices for 2 different test samples :width: 800 -This shows that our training not only converged quickly but also improved visually. Here's a comparison of our current best performing model i.e., VQVAE-Monai-B12-both & the previous one on NFBS i.e., VQVAE-Monai-B5-NFBS. The test reconstruction loss is 0.0013 & 0.0015 respectively. +This shows that our training not only converged quickly but also improved visually. Here's a comparison of our current best performing model i.e., VQVAE-Monai-B12-both & the previous one on NFBS i.e., VQVAE-Monai-B5-NFBS. The test reconstruction loss is 0.0013 & 0.0015 respectively. .. image:: /_static/images/vqvae-reconstructions-comparison.png :alt: VQVAE reconstruction comparison for B12-both & B5-NFBS diff --git a/requirements.txt b/requirements.txt index e768fbe2..685cbea8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ numpydoc sphinx!=4.4 tomli>=2.0.1 -grg-sphinx-theme>=0.1.0 +grg-sphinx-theme>=0.2.0 Jinja2 -ablog==0.11.5 \ No newline at end of file +ablog==0.11.5