pydicom (use the most recent development version)
-
Fork the master branch of the project repository by clicking on the 'Fork' button near the top right of the page. This creates a copy of the repository under your GitHub user account. For more details on how to fork a repository see this guide.
-
Clone your fork to your local disk:
git clone https://github.com/YourUsername/pynetdicom.git cd pynetdicom
-
Create a new branch to hold your development changes:
git checkout -b my-branch
-
Develop the feature on your branch. Files can be added using
git add
and changes committed usinggit commit
. For more on using git see the Git documentation. -
When you're ready, push your changes to your GitHub account:
git push -u origin my-branch
-
You can then create a pull request using these instructions.
- Please prefix the title of your pull request with
[WIP]
if its in progress and[MRG]
when you consider it complete and ready for review. - When fixing bugs your first commit should be the addition of tests that reproduce the original issue and any related issues.
- Use pytest to run the unit tests.
- When adding features you should have complete documentation and 100% unit test coverage that covers not just the lines of code but ensure that the feature works as intended.
- When writing documentation please reference the DICOM Standard where possible. When dealing with significant parts of the code base (
DIMSEMessage.decode_msg()
for example) you should have inline comments that reference both the DICOM Standard and explain in detail what the code is doing and why. - Docstrings should use UK English and follow the numpy docstring style.
- Black is required
- Type hints should pass using the current mypy release
- There are a handful of project-specific styles that should be used:
ae
for an ApplicationEntity objectacse
for the ACSE objectassoc
for an Association objectdimse
for the DIMSE objectds
for a pydicom Dataset object- Variable and function names should be
lower_case_underscore
, including acronyms such ascontext_id
anduid
. - Where a variable corresponds directly to a DICOM Data Element use a name that is identical to the element keyword (i.e. the DIMSE command set elements such as MessageID and AffectedSOPClassUID correspond to attributes such as
C_STORE.MessageID
andC_STORE.AffectedSOPClassUID
).
To install the test requirements use:
pip install -e .[tests]
Then to run the core tests:
cd pynetdicom/tests
pytest
The application tests are in pynetdicom/apps/tests
To install the documentation build requirements use:
pip install -e .[docs]
To build the documentation run:
cd docs
make html
The built documentation should be visible in the docs/_build
directory and can be viewed locally using a web browser.