-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
797 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Build documentation | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
env: | ||
DEB_PYTHON_INSTALL_LAYOUT: deb_system | ||
DISPLAY: ":99.0" | ||
CI: 1 | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
PUBLISH_DIR: ./_build/html | ||
DISPLAY: ":99.0" | ||
PYVISTA_TRAME_SERVER_PROXY_PREFIX: "/proxy/" | ||
PYVISTA_TRAME_SERVER_PROXY_ENABLED: "True" | ||
PYVISTA_OFF_SCREEN: false | ||
PYVISTA_JUPYTER_BACKEND: "html" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies for pyvista | ||
run: apt-get update && apt-get install -y libgl1-mesa-dev xvfb | ||
|
||
- name: Install dependencies | ||
run: python3 -m pip install ".[docs]" | ||
|
||
- name: Build docs | ||
run: jupyter book build -W --keep-going . | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: ${{ env.PUBLISH_DIR }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Publish documentation | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
build: | ||
uses: ./.github/workflows/build_docs.yml | ||
|
||
deploy: | ||
needs: build | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
|
||
|
||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
_build | ||
*.DS_Store | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our community include: | ||
|
||
- Demonstrating empathy and kindness toward other people | ||
- Being respectful of differing opinions, viewpoints, and experiences | ||
- Giving and gracefully accepting constructive feedback | ||
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience | ||
- Focusing on what is best not just for us as individuals, but for the overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
- The use of sexualized language or imagery, and sexual attention or advances | ||
- Trolling, insulting or derogatory comments, and personal or political attacks | ||
- Public or private harassment | ||
- Publishing others’ private information, such as a physical or email address, without their explicit permission | ||
- Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders. All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the reporter of any incident. | ||
|
||
## Enforcement Guidelines | ||
|
||
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: | ||
|
||
### 1. Correction | ||
|
||
**Community Impact:** Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. | ||
|
||
**Consequence:** A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. | ||
|
||
### 2. Warning | ||
|
||
**Community Impact:** A violation through a single incident or series of actions. | ||
|
||
**Consequence:** A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. | ||
|
||
### 3. Temporary Ban | ||
|
||
**Community Impact:** A serious violation of community standards, including sustained inappropriate behavior. | ||
|
||
**Consequence:** A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. | ||
|
||
### 4. Permanent Ban | ||
|
||
**Community Impact:** Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. | ||
|
||
**Consequence:** A permanent ban from any sort of public interaction within the community. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant](https://contributor-covenant.org/), version [1.4](https://www.contributor-covenant.org/version/1/4/code-of-conduct/code_of_conduct.md) and [2.0](https://www.contributor-covenant.org/version/2/0/code_of_conduct/code_of_conduct.md, and was generated by [contributing-gen](https://github.com/bttger/contributing-gen). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Contributing | ||
|
||
When contributing to this repository, please first [create an issue](https://github.com/scientificcomputing/mri2mesh/issues/new/choose) containing information about the missing feature or the bug that you would like to fix. Here you can discuss the change you want to make with the maintainers of the repository. | ||
|
||
Please note we have a code of conduct, please follow it in all your interactions with the project. | ||
|
||
## New contributor guide | ||
|
||
To get an overview of the project, read the [documentation](https://scientificcomputing.github.io/mri2mesh/). Here are some resources to help you get started with open source contributions: | ||
|
||
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github) | ||
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git) | ||
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow) | ||
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests) | ||
|
||
## Pull Request Process | ||
|
||
|
||
### Pull Request | ||
|
||
- When you're finished with the changes, create a pull request, also known as a PR. It is also OK to create a [draft pull request](https://github.blog/2019-02-14-introducing-draft-pull-requests/) from the very beginning. Once you are done you can click on the ["Ready for review"] button. You can also [request a review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) from one of the maintainers. | ||
- Don't forget to [link PR to the issue that you opened ](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue). | ||
- Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge. | ||
Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information. | ||
- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. | ||
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). | ||
- If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues. | ||
- Please make sure that all tests are passing, github pages renders nicely, and code coverage are are not lower than before your contribution. You see the different github action workflows by clicking the "Action" tab in the GitHub repository. | ||
|
||
|
||
### Enforced style guide using pre-commit hooks | ||
|
||
We want to have a consistent style on all the contributions to the repository. The way we enforce this is through pre-commit hooks and contributors are encouraged to install the pre-commit hooks locally when developing. You can install the pre commit hooks by first install `pre-commit` | ||
``` | ||
python3 -m pip install pre-commit | ||
``` | ||
and then install the pre-commit hooks using the command | ||
``` | ||
pre-commit install | ||
``` | ||
at the root of the repository. This will install all the hooks listed in the file called `.pre-commit-config.yaml` in the root of the repository. | ||
|
||
Every time you make a commit to the repository a set of tests will run to make sure that the changes you made are following the style guide. Usually, the hooks will autoformat your code so that you only need to do a `git add` again and then redo the `git commit`. | ||
|
||
Note that when you make a push to the repo, the pre-commit hooks will be run on all the files in the repository. You can also run the pre-commit hooks on all the files using the command | ||
``` | ||
pre-commit run --all | ||
``` | ||
To learn more about pre-commit you can check out https://pre-commit.com | ||
|
||
## Test suite | ||
For every new feature of bugfix you should also make sure to not lower the code coverage for the test suite. This means that if you for example add a new function then you should also make sure that the function is properly tested (at a minimum it should be covered by the test suite). | ||
|
||
To run the test suite, please install the package with the optional dependencies `test`, i.e | ||
``` | ||
python3 -m pip install -e ".[test]" | ||
``` | ||
in the root of the repository. To run the tests you can execute the command | ||
``` | ||
python3 -m pytest | ||
``` | ||
You can read more about using pytest in the [official documentation of pytest](https://docs.pytest.org/). | ||
|
||
## Documentation | ||
The documentation is hosted at GitHub pages and created with [`JupyterBook`](https://jupyterbook.org/en/stable/intro.html). Contributions to the documentation is very welcomed. | ||
|
||
To build the documentation locally you can installed the `docs` optional dependencies, i.e | ||
``` | ||
python3 -m pip install -e ".[docs]" | ||
``` | ||
in the root of the repository. Now you can build the documentation by running the command | ||
``` | ||
jupyter-book build . | ||
``` | ||
from the root of the repository. The command should complete without errors or warnings. In particular, you might want to run the command | ||
``` | ||
jupyter-book build -W --keep-going . | ||
``` | ||
which will turn warnings into errors. | ||
|
||
For reference, please see the [github workflow](https://github.com/scientificcomputing/mri2mesh/blob/main/.github/workflows/build_docs.yml) that is used for building the pages. | ||
|
||
|
||
## Need help? | ||
If something is not working as expected, or you need help please file an [issue](https://github.com/finsberg/gotranx/issues/new/choose). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Book settings | ||
# Learn more at https://jupyterbook.org/customize/config.html | ||
|
||
title: mri2mesh | ||
author: Henrik Finsberg | ||
logo: "docs/logo.png" | ||
copyright: "2024" | ||
only_build_toc_files: true | ||
|
||
# Force re-execution of notebooks on each build. | ||
# See https://jupyterbook.org/content/execute.html | ||
execute: | ||
execute_notebooks: cache | ||
timeout: 3000 | ||
|
||
# Information about where the book exists on the web | ||
repository: | ||
url: https://github.com/scientificcomputing/mri2mesh # Online location of your book | ||
branch: main | ||
|
||
|
||
html: | ||
use_issues_button: true | ||
use_repository_button: true | ||
|
||
parse: | ||
myst_enable_extensions: | ||
- amsmath | ||
- dollarmath | ||
- linkify | ||
|
||
sphinx: | ||
config: | ||
html_last_updated_fmt: "%b %d, %Y" | ||
# bibtex_bibfiles: ["docs/refs.bib"] | ||
nb_execution_show_tb: True | ||
nb_custom_formats: # https://jupyterbook.org/en/stable/file-types/jupytext.html#file-types-custom | ||
.py: | ||
- jupytext.reads | ||
- fmt: py | ||
|
||
suppress_warnings: ["mystnb.unknown_mime_type"] #, "bibtex.duplicate_citation"] | ||
extra_extensions: | ||
- 'sphinx.ext.autodoc' | ||
- 'sphinx.ext.napoleon' | ||
- 'sphinx.ext.viewcode' | ||
# - 'sphinxcontrib.bibtex' | ||
|
||
exclude_patterns: [".pytest_cache/*", ".github/*", ".tox/*", "third_party/*", "venv", "examples/wildmeshing-python/**"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
format: jb-book | ||
root: README | ||
|
||
parts: | ||
- caption: Examples | ||
chapters: | ||
- file: "examples/synthseg.ipynb" | ||
- caption: Community | ||
chapters: | ||
- file: "CONTRIBUTING" | ||
- caption: Python API | ||
chapters: | ||
- file: "docs/api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
API Reference | ||
============= | ||
|
||
.. automodule:: mri2mesh | ||
:members: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.