mmpp 0.5.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. mmpp-0.5.3/.flake8 +18 -0
  2. mmpp-0.5.3/.github/dependabot.yml +17 -0
  3. mmpp-0.5.3/.github/workflows/auto-format.yml +53 -0
  4. mmpp-0.5.3/.github/workflows/docs.yml +85 -0
  5. mmpp-0.5.3/.github/workflows/release.yml +122 -0
  6. mmpp-0.5.3/CONTRIBUTING.md +219 -0
  7. mmpp-0.5.3/DEVELOPMENT.md +167 -0
  8. mmpp-0.5.3/GITHUB_RELEASE_v0.5.0.md +122 -0
  9. mmpp-0.5.3/GITHUB_RELEASE_v0.5.1.md +72 -0
  10. mmpp-0.5.3/GITHUB_RELEASE_v0.5.2.md +48 -0
  11. mmpp-0.5.3/LICENSE +21 -0
  12. mmpp-0.5.3/LISTA_ZADAN_NAPRAWY.md +155 -0
  13. mmpp-0.5.3/MANIFEST.in +12 -0
  14. mmpp-0.5.3/PKG-INFO +517 -0
  15. mmpp-0.5.3/README.md +467 -0
  16. mmpp-0.5.3/RELEASE_NOTES.md +287 -0
  17. mmpp-0.5.3/build_docs.sh +41 -0
  18. mmpp-0.5.3/docs/.nojekyll +0 -0
  19. mmpp-0.5.3/docs/DATASET_AUTO_SELECTION_IMPLEMENTATION.md +131 -0
  20. mmpp-0.5.3/docs/DOCUMENTATION_API_FIXES.md +72 -0
  21. mmpp-0.5.3/docs/PROJECT_CLEANUP_SUMMARY.md +97 -0
  22. mmpp-0.5.3/docs/README.md +130 -0
  23. mmpp-0.5.3/docs/analysis/FFT_API_ANALIZA_SZCZEGOLOWA.md +438 -0
  24. mmpp-0.5.3/docs/analysis/KOMPLETNA_ANALIZA_FFT_API.md +497 -0
  25. mmpp-0.5.3/docs/analysis/README.md +57 -0
  26. mmpp-0.5.3/docs/analysis/WERYFIKACJA_POPRAWNOSCI_FFT.md +234 -0
  27. mmpp-0.5.3/docs/api/batch_operations.md +84 -0
  28. mmpp-0.5.3/docs/api/core.md +39 -0
  29. mmpp-0.5.3/docs/api/fft/compute_fft.md +89 -0
  30. mmpp-0.5.3/docs/api/fft/core.md +12 -0
  31. mmpp-0.5.3/docs/api/fft/electromagnetic_analysis.md +124 -0
  32. mmpp-0.5.3/docs/api/fft/index.md +51 -0
  33. mmpp-0.5.3/docs/api/fft/main.md +59 -0
  34. mmpp-0.5.3/docs/api/fft/modes.md +8 -0
  35. mmpp-0.5.3/docs/api/fft/plot.md +108 -0
  36. mmpp-0.5.3/docs/api/index.md +35 -0
  37. mmpp-0.5.3/docs/api/logging_config.md +52 -0
  38. mmpp-0.5.3/docs/api/plotting.md +83 -0
  39. mmpp-0.5.3/docs/api/simulation.md +66 -0
  40. mmpp-0.5.3/docs/conf.py +151 -0
  41. mmpp-0.5.3/docs/development/GITHUB_PAGES_SETUP.md +131 -0
  42. mmpp-0.5.3/docs/development/PERFORMANCE_OPTIMIZATION_SUMMARY.md +81 -0
  43. mmpp-0.5.3/docs/development/README.md +63 -0
  44. mmpp-0.5.3/docs/development/SMART_LEGEND_DOCS.md +127 -0
  45. mmpp-0.5.3/docs/development/WORKFLOW_FIXES.md +76 -0
  46. mmpp-0.5.3/docs/index.md +102 -0
  47. mmpp-0.5.3/docs/tutorials/batch_operations.md +153 -0
  48. mmpp-0.5.3/docs/tutorials/examples.md +317 -0
  49. mmpp-0.5.3/docs/tutorials/fft_spectrum_analysis.md +457 -0
  50. mmpp-0.5.3/docs/tutorials/getting_started.md +112 -0
  51. mmpp-0.5.3/docs/tutorials/index.md +22 -0
  52. mmpp-0.5.3/fix_imports.py +103 -0
  53. mmpp-0.5.3/justfile +123 -0
  54. mmpp-0.5.3/mmpp/__init__.py +193 -0
  55. mmpp-0.5.3/mmpp/batch_operations.py +551 -0
  56. mmpp-0.5.3/mmpp/cli.py +44 -0
  57. mmpp-0.5.3/mmpp/core.py +2062 -0
  58. mmpp-0.5.3/mmpp/fft/__init__.py +24 -0
  59. mmpp-0.5.3/mmpp/fft/compute_fft.py +935 -0
  60. mmpp-0.5.3/mmpp/fft/core.py +815 -0
  61. mmpp-0.5.3/mmpp/fft/electromagnetic_analysis.py +750 -0
  62. mmpp-0.5.3/mmpp/fft/main.py +599 -0
  63. mmpp-0.5.3/mmpp/fft/modes.py +2330 -0
  64. mmpp-0.5.3/mmpp/fft/plot.py +277 -0
  65. mmpp-0.5.3/mmpp/fonts/Arial/ARIALN.TTF +0 -0
  66. mmpp-0.5.3/mmpp/fonts/Arial/ARIALNB.TTF +0 -0
  67. mmpp-0.5.3/mmpp/fonts/Arial/ARIALNBI.TTF +0 -0
  68. mmpp-0.5.3/mmpp/fonts/Arial/ARIALNI.TTF +0 -0
  69. mmpp-0.5.3/mmpp/fonts/Arial/ARLRDBD.TTF +0 -0
  70. mmpp-0.5.3/mmpp/fonts/Arial/Arimo Bold Italic for Powerline.ttf +0 -0
  71. mmpp-0.5.3/mmpp/fonts/Arial/Arimo Bold for Powerline.ttf +0 -0
  72. mmpp-0.5.3/mmpp/fonts/Arial/Arimo Italic for Powerline.ttf +0 -0
  73. mmpp-0.5.3/mmpp/fonts/Arial/Arimo for Powerline.ttf +0 -0
  74. mmpp-0.5.3/mmpp/fonts/Arial/arial.ttf +0 -0
  75. mmpp-0.5.3/mmpp/fonts/Arial/arialbd.ttf +0 -0
  76. mmpp-0.5.3/mmpp/fonts/Arial/arialbi.ttf +0 -0
  77. mmpp-0.5.3/mmpp/fonts/Arial/ariali.ttf +0 -0
  78. mmpp-0.5.3/mmpp/fonts/Arial/ariblk.ttf +0 -0
  79. mmpp-0.5.3/mmpp/logging_config.py +206 -0
  80. mmpp-0.5.3/mmpp/paper.mplstyle +811 -0
  81. mmpp-0.5.3/mmpp/plotting.py +1718 -0
  82. mmpp-0.5.3/mmpp/simulation.py +435 -0
  83. mmpp-0.5.3/mmpp.egg-info/PKG-INFO +517 -0
  84. mmpp-0.5.3/mmpp.egg-info/SOURCES.txt +93 -0
  85. mmpp-0.5.3/mmpp.egg-info/dependency_links.txt +1 -0
  86. mmpp-0.5.3/mmpp.egg-info/entry_points.txt +2 -0
  87. mmpp-0.5.3/mmpp.egg-info/requires.txt +27 -0
  88. mmpp-0.5.3/mmpp.egg-info/top_level.txt +1 -0
  89. mmpp-0.5.3/pyproject.toml +133 -0
  90. mmpp-0.5.3/scripts/bump_version.py +45 -0
  91. mmpp-0.5.3/setup.cfg +4 -0
  92. mmpp-0.5.3/setup.py +70 -0
  93. mmpp-0.5.3/setup.py.bak +70 -0
  94. mmpp-0.5.3/temporal_balance.gif +0 -0
  95. mmpp-0.5.3/test_batch_operations.py +0 -0
mmpp-0.5.3/.flake8 ADDED
@@ -0,0 +1,18 @@
1
+ [flake8]
2
+ max-line-length = 88
3
+ extend-ignore = E203, E266, E501, W503, F403, F401, E402
4
+ max-complexity = 25
5
+ exclude =
6
+ .git,
7
+ __pycache__,
8
+ docs/source/conf.py,
9
+ old,
10
+ build,
11
+ dist,
12
+ .eggs,
13
+ *.egg,
14
+ venv,
15
+ .venv
16
+
17
+ per-file-ignores =
18
+ __init__.py:F401
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ # Enable version updates for Python dependencies
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ open-pull-requests-limit: 10
9
+ reviewers:
10
+ - "mateuszzelent" # Replace with your GitHub username
11
+
12
+ # Enable version updates for GitHub Actions
13
+ - package-ecosystem: "github-actions"
14
+ directory: "/"
15
+ schedule:
16
+ interval: "weekly"
17
+ open-pull-requests-limit: 5
@@ -0,0 +1,53 @@
1
+ name: Auto Format Code
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ format:
10
+ runs-on: ubuntu-latest
11
+ permissions:
12
+ contents: write
13
+
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ with:
18
+ token: ${{ secrets.GITHUB_TOKEN }}
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.11'
24
+
25
+ - name: Install formatting tools
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install ruff
29
+
30
+ - name: Format and lint code with ruff
31
+ run: |
32
+ python -m ruff format mmpp/ tests/ scripts/
33
+ python -m ruff check --fix mmpp/ tests/ scripts/
34
+
35
+ - name: Check for changes
36
+ id: verify-changed-files
37
+ run: |
38
+ if [ -n "$(git status --porcelain)" ]; then
39
+ echo "changed=true" >> $GITHUB_OUTPUT
40
+ else
41
+ echo "changed=false" >> $GITHUB_OUTPUT
42
+ fi
43
+
44
+ - name: Commit and push changes
45
+ if: steps.verify-changed-files.outputs.changed == 'true'
46
+ run: |
47
+ git config --local user.email "action@github.com"
48
+ git config --local user.name "GitHub Action"
49
+ git add -A
50
+ git commit -m "style: Auto-format code with ruff
51
+
52
+ [skip ci]"
53
+ git push
@@ -0,0 +1,85 @@
1
+ name: Build and Deploy Documentation
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, master ]
6
+ pull_request:
7
+ branches: [ main, master ]
8
+
9
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
10
+ permissions:
11
+ contents: write
12
+ pages: write
13
+ id-token: write
14
+ actions: read
15
+
16
+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17
+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18
+ concurrency:
19
+ group: "pages"
20
+ cancel-in-progress: false
21
+
22
+ jobs:
23
+ build-docs:
24
+ runs-on: ubuntu-latest
25
+ environment:
26
+ name: github-pages
27
+ url: ${{ steps.deployment.outputs.page_url }}
28
+
29
+ steps:
30
+ - name: Checkout repository
31
+ uses: actions/checkout@v4
32
+ with:
33
+ fetch-depth: 0 # Fetch full history for better Git info
34
+
35
+ - name: Setup Pages
36
+ uses: actions/configure-pages@v5
37
+
38
+ - name: Set up Python
39
+ uses: actions/setup-python@v5
40
+ with:
41
+ python-version: '3.10'
42
+
43
+ - name: Cache pip packages
44
+ uses: actions/cache@v4
45
+ with:
46
+ path: ~/.cache/pip
47
+ key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
48
+ restore-keys: |
49
+ ${{ runner.os }}-pip-
50
+
51
+ - name: Install dependencies
52
+ run: |
53
+ python -m pip install --upgrade pip setuptools wheel
54
+ pip install sphinx sphinx-rtd-theme myst-parser sphinx-autodoc-typehints linkify-it-py
55
+ # Install package dependencies
56
+ if [ -f pyproject.toml ]; then
57
+ pip install -e .
58
+ elif [ -f requirements.txt ]; then
59
+ pip install -r requirements.txt
60
+ fi
61
+
62
+ - name: Build documentation
63
+ continue-on-error: true
64
+ run: |
65
+ cd docs
66
+ # Ensure build directory exists
67
+ mkdir -p _build
68
+ # Copy .nojekyll to build directory
69
+ if [ -f .nojekyll ]; then
70
+ cp .nojekyll _build/.nojekyll
71
+ else
72
+ touch _build/.nojekyll
73
+ fi
74
+ # Build docs without treating warnings as errors and continue on errors
75
+ sphinx-build -b html . _build --keep-going -q || echo "Documentation built with warnings/errors, but continuing..."
76
+
77
+ - name: Upload Pages artifact
78
+ uses: actions/upload-pages-artifact@v3
79
+ with:
80
+ path: ./docs/_build
81
+
82
+ - name: Deploy to GitHub Pages
83
+ if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
84
+ id: deployment
85
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,122 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+ inputs:
9
+ test_pypi:
10
+ description: 'Upload to TestPyPI instead of PyPI'
11
+ required: false
12
+ default: false
13
+ type: boolean
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ matrix:
20
+ python-version: ['3.9', '3.10', '3.11','3.12']
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - name: Set up Python ${{ matrix.python-version }}
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ pip install -e ".[dev]"
34
+
35
+ - name: Auto-format code
36
+ run: |
37
+ python -m ruff format mmpp/ tests/ scripts/
38
+ python -m ruff check --fix mmpp/ tests/ scripts/
39
+
40
+ - name: Lint with ruff
41
+ run: |
42
+ python -m ruff check mmpp/ tests/ scripts/
43
+
44
+ - name: Type check with mypy
45
+ run: |
46
+ python -m mypy mmpp/ --ignore-missing-imports
47
+ continue-on-error: true
48
+
49
+ - name: Test with pytest
50
+ run: |
51
+ python -m pytest tests/ -v --cov=mmpp --cov-report=xml
52
+ continue-on-error: true
53
+
54
+ - name: Upload coverage to Codecov
55
+ uses: codecov/codecov-action@v5
56
+ if: matrix.python-version == '3.11'
57
+ with:
58
+ file: ./coverage.xml
59
+
60
+ build:
61
+ needs: test
62
+ runs-on: ubuntu-latest
63
+
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+
67
+ - name: Set up Python
68
+ uses: actions/setup-python@v5
69
+ with:
70
+ python-version: '3.11'
71
+
72
+ - name: Install build dependencies
73
+ run: |
74
+ python -m pip install --upgrade pip
75
+ pip install build twine
76
+
77
+ - name: Build package
78
+ run: python -m build --sdist --wheel
79
+
80
+ - name: Check package
81
+ run: python -m twine check dist/*
82
+
83
+ - name: Upload build artifacts
84
+ uses: actions/upload-artifact@v4
85
+ with:
86
+ name: dist
87
+ path: dist/
88
+
89
+ release:
90
+ needs: build
91
+ runs-on: ubuntu-latest
92
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
93
+
94
+ steps:
95
+ - name: Download build artifacts
96
+ uses: actions/download-artifact@v4
97
+ with:
98
+ name: dist
99
+ path: dist/
100
+
101
+ - name: Publish to PyPI
102
+ uses: pypa/gh-action-pypi-publish@release/v1
103
+ with:
104
+ password: ${{ secrets.PYPI_API_TOKEN }}
105
+
106
+ release-test:
107
+ needs: build
108
+ runs-on: ubuntu-latest
109
+ if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_pypi == 'true'
110
+
111
+ steps:
112
+ - name: Download build artifacts
113
+ uses: actions/download-artifact@v4
114
+ with:
115
+ name: dist
116
+ path: dist/
117
+
118
+ - name: Publish to TestPyPI
119
+ uses: pypa/gh-action-pypi-publish@release/v1
120
+ with:
121
+ password: ${{ secrets.TEST_PYPI_API_TOKEN }}
122
+ repository_url: https://test.pypi.org/legacy/
@@ -0,0 +1,219 @@
1
+ # Contributing to MMPP
2
+
3
+ Thank you for your interest in contributing to MMPP (Micro Magnetic Post Processing)! We welcome contributions from the community.
4
+
5
+ ## 🚀 Quick Start
6
+
7
+ ### Development Setup
8
+
9
+ 1. **Fork and Clone**
10
+ ```bash
11
+ git clone https://github.com/mateuszzelent/mmpp.git
12
+ cd mmpp
13
+ ```
14
+
15
+ 2. **Install Development Dependencies**
16
+ ```bash
17
+ pip install -e ".[dev]"
18
+ ```
19
+
20
+ 3. **Run Tests**
21
+ ```bash
22
+ pytest tests/
23
+ ```
24
+
25
+ ## 📋 Contribution Guidelines
26
+
27
+ ### Code Style
28
+
29
+ We use several tools to maintain code quality:
30
+
31
+ - **Ruff** for code formatting and linting
32
+ - **MyPy** for type checking
33
+
34
+ Run these tools before submitting:
35
+ ```bash
36
+ ruff format mmpp/
37
+ mypy mmpp/
38
+ ```
39
+
40
+ ### Testing
41
+
42
+ - Write tests for new features
43
+ - Ensure all tests pass: `pytest tests/`
44
+ - Maintain or improve test coverage
45
+
46
+ ### Documentation
47
+
48
+ - Update docstrings for new functions/classes
49
+ - Add examples to the documentation
50
+ - Update the README if needed
51
+
52
+ ## 🐛 Reporting Issues
53
+
54
+ When reporting issues, please include:
55
+
56
+ - Python version
57
+ - MMPP version
58
+ - Operating system
59
+ - Clear description of the problem
60
+ - Minimal code example to reproduce the issue
61
+
62
+ ## 💡 Feature Requests
63
+
64
+ Before requesting a feature:
65
+
66
+ 1. Check if it already exists in the [issues](https://github.com/MateuszZelent/mmpp/issues)
67
+ 2. Consider if it fits the project scope
68
+ 3. Provide a clear use case
69
+
70
+ ## 📝 Pull Request Process
71
+
72
+ 1. **Create a Branch**
73
+ ```bash
74
+ git checkout -b feature/your-feature-name
75
+ ```
76
+
77
+ 2. **Make Your Changes**
78
+ - Follow the code style guidelines
79
+ - Add tests for new functionality
80
+ - Update documentation as needed
81
+
82
+ 3. **Test Your Changes**
83
+ ```bash
84
+ pytest tests/
85
+ ruff check mmpp/
86
+ ruff format --check mmpp/
87
+ ```
88
+
89
+ 4. **Commit and Push**
90
+ ```bash
91
+ git add .
92
+ git commit -m "Add: brief description of your changes"
93
+ git push origin feature/your-feature-name
94
+ ```
95
+
96
+ 5. **Submit Pull Request**
97
+ - Use a clear title and description
98
+ - Reference any related issues
99
+ - Wait for review and address feedback
100
+
101
+ ## 🏗️ Development Workflow
102
+
103
+ ### Using Just (Recommended)
104
+
105
+ If you have [just](https://github.com/casey/just) installed:
106
+
107
+ ```bash
108
+ # Setup development environment
109
+ just dev-setup
110
+
111
+ # Run tests
112
+ just test
113
+
114
+ # Format code
115
+ just format
116
+
117
+ # Build documentation
118
+ just docs
119
+ ```
120
+
121
+ ### Manual Commands
122
+
123
+ ```bash
124
+ # Install in development mode
125
+ pip install -e ".[dev]"
126
+
127
+ # Run all tests
128
+ pytest tests/ -v
129
+
130
+ # Format code
131
+ ruff format mmpp/ tests/ scripts/
132
+
133
+ # Lint code
134
+ ruff check mmpp/ tests/ scripts/
135
+
136
+ # Type checking
137
+ mypy mmpp/
138
+
139
+ # Build documentation
140
+ cd docs && sphinx-build -b html . _build
141
+ ```
142
+
143
+ ## 🔬 Testing Guidelines
144
+
145
+ ### Test Categories
146
+
147
+ - **Unit Tests**: Test individual functions/methods
148
+ - **Integration Tests**: Test component interactions
149
+ - **Performance Tests**: Verify performance requirements
150
+
151
+ ### Writing Tests
152
+
153
+ ```python
154
+ import pytest
155
+ from mmpp import MMPP
156
+
157
+ def test_feature():
158
+ """Test description."""
159
+ # Arrange
160
+ data = setup_test_data()
161
+
162
+ # Act
163
+ result = feature_under_test(data)
164
+
165
+ # Assert
166
+ assert result.is_valid()
167
+ ```
168
+
169
+ ## 📚 Documentation
170
+
171
+ ### Building Documentation
172
+
173
+ ```bash
174
+ cd docs
175
+ pip install -r requirements.txt
176
+ sphinx-build -b html . _build
177
+ ```
178
+
179
+ ### Documentation Structure
180
+
181
+ - **tutorials/**: Step-by-step guides
182
+ - **api/**: Auto-generated API documentation
183
+ - **development/**: Development documentation
184
+
185
+ ## 🎯 Areas for Contribution
186
+
187
+ We especially welcome contributions in these areas:
188
+
189
+ - **Performance Optimization**: Improving computational efficiency
190
+ - **Visualization**: New plotting features and improvements
191
+ - **Testing**: Expanding test coverage
192
+ - **Documentation**: Examples, tutorials, and API docs
193
+ - **Bug Fixes**: Resolving issues and edge cases
194
+
195
+ ## 🤝 Community Guidelines
196
+
197
+ - Be respectful and inclusive
198
+ - Provide constructive feedback
199
+ - Help newcomers get started
200
+ - Follow the code of conduct
201
+
202
+ ## 📞 Getting Help
203
+
204
+ - **Issues**: [GitHub Issues](https://github.com/MateuszZelent/mmpp/issues)
205
+ - **Discussions**: [GitHub Discussions](https://github.com/MateuszZelent/mmpp/discussions)
206
+ - **Email**: mateusz.zelent@amu.edu.pl
207
+
208
+ ## 🏷️ Release Process
209
+
210
+ For maintainers:
211
+
212
+ 1. Update version in `pyproject.toml`
213
+ 2. Update `RELEASE_NOTES.md`
214
+ 3. Create release tag
215
+ 4. Build and publish to PyPI
216
+
217
+ ---
218
+
219
+ Thank you for contributing to MMPP! 🧲
@@ -0,0 +1,167 @@
1
+ # mmpp Development Guide
2
+
3
+ ## Setup Instructions
4
+
5
+ ### Prerequisites
6
+ - Python 3.9 or higher
7
+ - Git
8
+ - Just (command runner) - install with: `cargo install just` or `pip install just-install`
9
+
10
+ ### Quick Start
11
+
12
+ 1. **Clone the repository**
13
+ ```bash
14
+ git clone https://github.com/mateuszzelent/mmpp.git
15
+ cd mmpp
16
+ ```
17
+
18
+ 2. **Setup development environment**
19
+ ```bash
20
+ just dev-setup
21
+ source venv/bin/activate # On Windows: venv\Scripts\activate
22
+ ```
23
+
24
+ 3. **Test the setup**
25
+ ```bash
26
+ python test_setup.py
27
+ ```
28
+
29
+ ## Development Workflow
30
+
31
+ ### Available Just Commands
32
+
33
+ - `just build` - Build the package
34
+ - `just install-local` - Install package locally for testing
35
+ - `just test` - Run tests
36
+ - `just lint` - Check code quality
37
+ - `just format` - Format code with ruff
38
+ - `just clean` - Clean build artifacts
39
+ - `just prepare-release` - Prepare package for release
40
+ - `just release` - Release to PyPI
41
+ - `just release-test` - Release to TestPyPI for testing
42
+
43
+ ### Building and Testing Locally
44
+
45
+ ```bash
46
+ # Format code
47
+ just format
48
+
49
+ # Run linting
50
+ just lint
51
+
52
+ # Run tests
53
+ just test
54
+
55
+ # Build package
56
+ just build
57
+
58
+ # Install locally
59
+ just install-local
60
+
61
+ # Test installation
62
+ python -c "import mmpp; print('Success!')"
63
+ ```
64
+
65
+ ### Release Process
66
+
67
+ 1. **Prepare for release**
68
+ ```bash
69
+ just prepare-release
70
+ ```
71
+
72
+ 2. **Test on TestPyPI first**
73
+ ```bash
74
+ just release-test
75
+ ```
76
+
77
+ 3. **Create a git tag and push**
78
+ ```bash
79
+ git tag v0.1.0
80
+ git push origin v0.1.0
81
+ ```
82
+
83
+ 4. **GitHub Actions will automatically release to PyPI**
84
+
85
+ ## GitHub Actions
86
+
87
+ ### Automatic Releases
88
+
89
+ 1. **Set up PyPI tokens**:
90
+ - Go to PyPI.org and create an API token
91
+ - Add it to GitHub repository secrets as `PYPI_API_TOKEN`
92
+ - For TestPyPI, add `TEST_PYPI_API_TOKEN`
93
+
94
+ 2. **Create a release**:
95
+ - Push a tag starting with 'v' (e.g., v0.1.0)
96
+ - GitHub Actions will automatically build and release
97
+
98
+ 3. **Manual release**:
99
+ - Go to GitHub Actions tab
100
+ - Run "Release to PyPI" workflow manually
101
+ - Choose TestPyPI option for testing
102
+
103
+ ### CI/CD Pipeline
104
+
105
+ - **Continuous Integration**: Runs on every push and PR
106
+ - **Multi-platform testing**: Ubuntu, Windows, macOS
107
+ - **Multi-Python testing**: Python 3.9, 3.10, 3.11
108
+ - **Code quality checks**: ruff, mypy
109
+ - **Test coverage**: pytest with coverage reporting
110
+
111
+ ## Package Structure
112
+
113
+ ```
114
+ mmpp/
115
+ ├── mmpp/ # Main package
116
+ │ ├── __init__.py # Package initialization
117
+ │ ├── core.py # Core functionality (from main.py)
118
+ │ ├── plotting.py # Plotting utilities
119
+ │ ├── simulation.py # Simulation management (from swapper.py)
120
+ │ ├── cli.py # Command line interface
121
+ │ ├── paper.mplstyle # Matplotlib style
122
+ │ └── fonts/ # Custom fonts
123
+ ├── tests/ # Test suite
124
+ ├── .github/ # GitHub workflows
125
+ ├── pyproject.toml # Modern Python package configuration
126
+ ├── setup.py # Legacy setup (for compatibility)
127
+ ├── justfile # Task automation
128
+ ├── README.md # Package documentation
129
+ ├── LICENSE # MIT license
130
+ └── MANIFEST.in # Package data inclusion
131
+ ```
132
+
133
+ ## Troubleshooting
134
+
135
+ ### Common Issues
136
+
137
+ 1. **Import errors**: Make sure all dependencies are installed
138
+ ```bash
139
+ pip install -e ".[dev]"
140
+ ```
141
+
142
+ 2. **Font issues**: The package includes custom fonts, but system fonts will be used as fallback
143
+
144
+ 3. **Missing dependencies**: Use extras for optional features:
145
+ ```bash
146
+ pip install mmpp[plotting,interactive]
147
+ ```
148
+
149
+ ### Version Management
150
+
151
+ ```bash
152
+ # Bump patch version (0.1.0 -> 0.1.1)
153
+ just bump-patch
154
+
155
+ # Bump minor version (0.1.0 -> 0.2.0)
156
+ just bump-minor
157
+ ```
158
+
159
+ ## Contributing
160
+
161
+ 1. Fork the repository
162
+ 2. Create a feature branch
163
+ 3. Make your changes
164
+ 4. Run tests and linting
165
+ 5. Submit a pull request
166
+
167
+ All contributions are welcome!