Contributing

Development Setup

  1. Clone the repository:
git clone https://github.com/MagneticResonanceImaging/MRITwixTools.jl.git
cd MRITwixTools.jl
  1. Start Julia and activate the project:
using Pkg
Pkg.develop(path=".")
Pkg.instantiate()
  1. Run the tests:
Pkg.test("MRITwixTools")

Running Tests

The test suite consists of:

  • Unit tests — no I/O, test individual types and functions
  • Integration tests — download real .dat files from GitHub releases and verify correct parsing

Test data files are downloaded on first run and cached locally. SHA-256 checksums verify integrity.

To run from the command line:

julia --project -e 'using Pkg; Pkg.test()'

To set a custom cache directory for test data:

export MAPVBVD_TEST_DATA=/path/to/cache
julia --project -e 'using Pkg; Pkg.test()'

Project Structure

See Architecture for a full codebase walkthrough.

Key points for contributors:

  • Include order matters — see Architecture for the required order
  • Always use getfield — never use obj.field in internal code where getproperty is overridden. See the getfield rule
  • Named constants — use constants from mdh_constants.jl, don't introduce magic numbers

Building Documentation

Documentation is built with Documenter.jl:

cd docs
julia --project make.jl

The built site will be in docs/build/. Documentation CI automatically builds on every PR and deploys to GitHub Pages on pushes to main.

Pull Request Guidelines

  1. Run the full test suite before submitting
  2. Add tests for new functionality
  3. Follow the getfield rule — see Architecture
  4. Add docstrings for new exported functions
  5. Update documentation if you change user-facing behavior