brkraw 0.3.11__tar.gz → 0.5.0__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 (222) hide show
  1. brkraw-0.5.0/.github/DISCUSSION_TEMPLATE/proposal.yml +60 -0
  2. brkraw-0.5.0/.github/DISCUSSION_TEMPLATE/question.yml +40 -0
  3. brkraw-0.5.0/.github/ISSUE_TEMPLATE/bug_report.md +42 -0
  4. brkraw-0.5.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  5. brkraw-0.5.0/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
  6. brkraw-0.5.0/.github/PULL_REQUEST_TEMPLATE.md +31 -0
  7. brkraw-0.5.0/.github/copilot-instructions.md +10 -0
  8. brkraw-0.5.0/.github/workflows/ci.yml +28 -0
  9. brkraw-0.5.0/.github/workflows/docs.yml +32 -0
  10. brkraw-0.5.0/.github/workflows/publish.yml +97 -0
  11. brkraw-0.5.0/.github/workflows/release.yml +129 -0
  12. brkraw-0.5.0/.github/workflows/release_on_merge.yml +54 -0
  13. brkraw-0.5.0/.gitignore +26 -0
  14. brkraw-0.5.0/.markdownlint.yaml +6 -0
  15. brkraw-0.5.0/AGENTS.md +22 -0
  16. brkraw-0.5.0/CITATION.cff +49 -0
  17. brkraw-0.5.0/CODE_OF_CONDUCT.md +129 -0
  18. brkraw-0.5.0/CONTRIBUTING.md +6 -0
  19. brkraw-0.5.0/PKG-INFO +81 -0
  20. brkraw-0.5.0/README.md +43 -0
  21. brkraw-0.5.0/RELEASE_NOTES.md +68 -0
  22. brkraw-0.5.0/brkraw/__init__.py +14 -0
  23. brkraw-0.5.0/brkraw/apps/__init__.py +12 -0
  24. brkraw-0.5.0/brkraw/apps/addon/__init__.py +30 -0
  25. brkraw-0.5.0/brkraw/apps/addon/core.py +35 -0
  26. brkraw-0.5.0/brkraw/apps/addon/dependencies.py +402 -0
  27. brkraw-0.5.0/brkraw/apps/addon/installation.py +500 -0
  28. brkraw-0.5.0/brkraw/apps/addon/io.py +21 -0
  29. brkraw-0.5.0/brkraw/apps/hook/__init__.py +25 -0
  30. brkraw-0.5.0/brkraw/apps/hook/core.py +636 -0
  31. brkraw-0.5.0/brkraw/apps/loader/__init__.py +10 -0
  32. brkraw-0.5.0/brkraw/apps/loader/core.py +622 -0
  33. brkraw-0.5.0/brkraw/apps/loader/formatter.py +288 -0
  34. brkraw-0.5.0/brkraw/apps/loader/helper.py +797 -0
  35. brkraw-0.5.0/brkraw/apps/loader/info/__init__.py +11 -0
  36. brkraw-0.5.0/brkraw/apps/loader/info/scan.py +85 -0
  37. brkraw-0.5.0/brkraw/apps/loader/info/scan.yaml +90 -0
  38. brkraw-0.5.0/brkraw/apps/loader/info/study.py +69 -0
  39. brkraw-0.5.0/brkraw/apps/loader/info/study.yaml +156 -0
  40. brkraw-0.5.0/brkraw/apps/loader/info/transform.py +92 -0
  41. brkraw-0.5.0/brkraw/apps/loader/types.py +220 -0
  42. brkraw-0.5.0/brkraw/cli/__init__.py +5 -0
  43. brkraw-0.5.0/brkraw/cli/commands/__init__.py +2 -0
  44. brkraw-0.5.0/brkraw/cli/commands/addon.py +327 -0
  45. brkraw-0.5.0/brkraw/cli/commands/config.py +205 -0
  46. brkraw-0.5.0/brkraw/cli/commands/convert.py +903 -0
  47. brkraw-0.5.0/brkraw/cli/commands/hook.py +348 -0
  48. brkraw-0.5.0/brkraw/cli/commands/info.py +74 -0
  49. brkraw-0.5.0/brkraw/cli/commands/init.py +214 -0
  50. brkraw-0.5.0/brkraw/cli/commands/params.py +106 -0
  51. brkraw-0.5.0/brkraw/cli/commands/prune.py +288 -0
  52. brkraw-0.5.0/brkraw/cli/commands/session.py +371 -0
  53. brkraw-0.5.0/brkraw/cli/hook_args.py +80 -0
  54. brkraw-0.5.0/brkraw/cli/main.py +83 -0
  55. brkraw-0.5.0/brkraw/cli/utils.py +60 -0
  56. brkraw-0.5.0/brkraw/core/__init__.py +13 -0
  57. brkraw-0.5.0/brkraw/core/config.py +380 -0
  58. brkraw-0.5.0/brkraw/core/entrypoints.py +25 -0
  59. brkraw-0.5.0/brkraw/core/formatter.py +367 -0
  60. brkraw-0.5.0/brkraw/core/fs.py +495 -0
  61. brkraw-0.5.0/brkraw/core/jcamp.py +600 -0
  62. brkraw-0.5.0/brkraw/core/layout.py +451 -0
  63. brkraw-0.5.0/brkraw/core/parameters.py +781 -0
  64. brkraw-0.5.0/brkraw/core/zip.py +1121 -0
  65. brkraw-0.5.0/brkraw/dataclasses/__init__.py +14 -0
  66. brkraw-0.5.0/brkraw/dataclasses/node.py +139 -0
  67. brkraw-0.5.0/brkraw/dataclasses/reco.py +33 -0
  68. brkraw-0.5.0/brkraw/dataclasses/scan.py +61 -0
  69. brkraw-0.5.0/brkraw/dataclasses/study.py +131 -0
  70. brkraw-0.5.0/brkraw/default/__init__.py +3 -0
  71. brkraw-0.5.0/brkraw/default/pruner_specs/deid4share.yaml +42 -0
  72. brkraw-0.5.0/brkraw/default/rules/00_default.yaml +4 -0
  73. brkraw-0.5.0/brkraw/default/specs/metadata_dicom.yaml +236 -0
  74. brkraw-0.5.0/brkraw/default/specs/metadata_transforms.py +92 -0
  75. brkraw-0.5.0/brkraw/resolver/__init__.py +7 -0
  76. brkraw-0.5.0/brkraw/resolver/affine.py +539 -0
  77. brkraw-0.5.0/brkraw/resolver/datatype.py +69 -0
  78. brkraw-0.5.0/brkraw/resolver/fid.py +90 -0
  79. brkraw-0.5.0/brkraw/resolver/helpers.py +36 -0
  80. brkraw-0.5.0/brkraw/resolver/image.py +188 -0
  81. brkraw-0.5.0/brkraw/resolver/nifti.py +370 -0
  82. brkraw-0.5.0/brkraw/resolver/shape.py +235 -0
  83. brkraw-0.5.0/brkraw/schema/__init__.py +3 -0
  84. brkraw-0.5.0/brkraw/schema/context_map.yaml +62 -0
  85. brkraw-0.5.0/brkraw/schema/meta.yaml +57 -0
  86. brkraw-0.5.0/brkraw/schema/niftiheader.yaml +95 -0
  87. brkraw-0.5.0/brkraw/schema/pruner.yaml +55 -0
  88. brkraw-0.5.0/brkraw/schema/remapper.yaml +128 -0
  89. brkraw-0.5.0/brkraw/schema/rules.yaml +154 -0
  90. brkraw-0.5.0/brkraw/specs/__init__.py +10 -0
  91. brkraw-0.5.0/brkraw/specs/hook/__init__.py +12 -0
  92. brkraw-0.5.0/brkraw/specs/hook/logic.py +31 -0
  93. brkraw-0.5.0/brkraw/specs/hook/validator.py +22 -0
  94. brkraw-0.5.0/brkraw/specs/meta/__init__.py +5 -0
  95. brkraw-0.5.0/brkraw/specs/meta/validator.py +156 -0
  96. brkraw-0.5.0/brkraw/specs/pruner/__init__.py +15 -0
  97. brkraw-0.5.0/brkraw/specs/pruner/logic.py +361 -0
  98. brkraw-0.5.0/brkraw/specs/pruner/validator.py +119 -0
  99. brkraw-0.5.0/brkraw/specs/remapper/__init__.py +27 -0
  100. brkraw-0.5.0/brkraw/specs/remapper/logic.py +924 -0
  101. brkraw-0.5.0/brkraw/specs/remapper/validator.py +314 -0
  102. brkraw-0.5.0/brkraw/specs/rules/__init__.py +6 -0
  103. brkraw-0.5.0/brkraw/specs/rules/logic.py +263 -0
  104. brkraw-0.5.0/brkraw/specs/rules/validator.py +103 -0
  105. brkraw-0.5.0/docs/api/addon.md +295 -0
  106. brkraw-0.5.0/docs/api/convert.md +320 -0
  107. brkraw-0.5.0/docs/api/data-access.md +145 -0
  108. brkraw-0.5.0/docs/api/hook.md +187 -0
  109. brkraw-0.5.0/docs/api/info.md +160 -0
  110. brkraw-0.5.0/docs/api/layout.md +127 -0
  111. brkraw-0.5.0/docs/api/overview.md +77 -0
  112. brkraw-0.5.0/docs/api/prune.md +365 -0
  113. brkraw-0.5.0/docs/assets/brkraw-logo-dark.svg +27 -0
  114. brkraw-0.5.0/docs/assets/brkraw-logo-light.svg +27 -0
  115. brkraw-0.5.0/docs/assets/brkraw-logo.svg +27 -0
  116. brkraw-0.5.0/docs/assets/favicon-16.png +0 -0
  117. brkraw-0.5.0/docs/assets/favicon-192.png +0 -0
  118. brkraw-0.5.0/docs/assets/favicon-32.png +0 -0
  119. brkraw-0.5.0/docs/assets/favicon-512.png +0 -0
  120. brkraw-0.5.0/docs/assets/favicon-dark.svg +1 -0
  121. brkraw-0.5.0/docs/assets/favicon-light.svg +1 -0
  122. brkraw-0.5.0/docs/assets/favicon.ico +0 -0
  123. brkraw-0.5.0/docs/assets/favicon.svg +1 -0
  124. brkraw-0.5.0/docs/assets/site.webmanifest +20 -0
  125. brkraw-0.5.0/docs/cli/addon.md +171 -0
  126. brkraw-0.5.0/docs/cli/config.md +136 -0
  127. brkraw-0.5.0/docs/cli/convert.md +316 -0
  128. brkraw-0.5.0/docs/cli/hook.md +190 -0
  129. brkraw-0.5.0/docs/cli/index.md +50 -0
  130. brkraw-0.5.0/docs/cli/info.md +126 -0
  131. brkraw-0.5.0/docs/cli/prune.md +331 -0
  132. brkraw-0.5.0/docs/cli/session.md +117 -0
  133. brkraw-0.5.0/docs/dev/cli-extensions.md +59 -0
  134. brkraw-0.5.0/docs/dev/contributing.md +189 -0
  135. brkraw-0.5.0/docs/dev/contributors.md +42 -0
  136. brkraw-0.5.0/docs/dev/core-vs-addon.md +47 -0
  137. brkraw-0.5.0/docs/dev/documentation.md +58 -0
  138. brkraw-0.5.0/docs/dev/hook-packages.md +199 -0
  139. brkraw-0.5.0/docs/dev/roadmap.md +492 -0
  140. brkraw-0.5.0/docs/getting-started/api.md +150 -0
  141. brkraw-0.5.0/docs/getting-started/backup.md +10 -0
  142. brkraw-0.5.0/docs/getting-started/bids.md +19 -0
  143. brkraw-0.5.0/docs/getting-started/cli.md +136 -0
  144. brkraw-0.5.0/docs/getting-started/configuration.md +272 -0
  145. brkraw-0.5.0/docs/getting-started/hooks.md +127 -0
  146. brkraw-0.5.0/docs/getting-started/index.md +89 -0
  147. brkraw-0.5.0/docs/getting-started/mrs.md +10 -0
  148. brkraw-0.5.0/docs/getting-started/viewer.md +15 -0
  149. brkraw-0.5.0/docs/index.md +101 -0
  150. brkraw-0.5.0/docs/overrides/404.html +15 -0
  151. brkraw-0.5.0/docs/overrides/partials/extrahead.html +4 -0
  152. brkraw-0.5.0/docs/reference/addons-and-plugins.md +180 -0
  153. brkraw-0.5.0/docs/reference/cli-extensions.md +23 -0
  154. brkraw-0.5.0/docs/reference/context-map.md +434 -0
  155. brkraw-0.5.0/docs/reference/extensibility.md +168 -0
  156. brkraw-0.5.0/docs/reference/hook-packages.md +18 -0
  157. brkraw-0.5.0/docs/reference/layout.md +261 -0
  158. brkraw-0.5.0/docs/reference/rules.md +331 -0
  159. brkraw-0.5.0/docs/reference/specs.md +378 -0
  160. brkraw-0.5.0/docs/stylesheets/extra.css +23 -0
  161. brkraw-0.5.0/mkdocs.yml +91 -0
  162. brkraw-0.5.0/pyproject.toml +90 -0
  163. brkraw-0.5.0/scripts/cff_to_biblatex.py +179 -0
  164. brkraw-0.5.0/scripts/release_notes.py +99 -0
  165. brkraw-0.5.0/scripts/release_pr.py +427 -0
  166. brkraw-0.5.0/scripts/release_prep.py +199 -0
  167. brkraw-0.5.0/scripts/tag_and_push.py +43 -0
  168. brkraw-0.5.0/scripts/update_contributors.py +321 -0
  169. brkraw-0.5.0/scripts/update_readme_bibtex.py +61 -0
  170. brkraw-0.5.0/scripts/verify_release_version.py +48 -0
  171. brkraw-0.5.0/tests/conftest.py +13 -0
  172. brkraw-0.5.0/tests/helpers.py +6 -0
  173. brkraw-0.5.0/tests/test_01_core/fixtures/acqp_EPI_pv5_1.jdx +469 -0
  174. brkraw-0.5.0/tests/test_01_core/fixtures/method_EPI_pv5_1.jdx +441 -0
  175. brkraw-0.5.0/tests/test_01_core/fixtures/method_FLASH_pv360_3_1.jdx +535 -0
  176. brkraw-0.5.0/tests/test_01_core/test_formatter.py +13 -0
  177. brkraw-0.5.0/tests/test_01_core/test_fs.py +95 -0
  178. brkraw-0.5.0/tests/test_01_core/test_jcamp.py +257 -0
  179. brkraw-0.5.0/tests/test_01_core/test_parameters.py +309 -0
  180. brkraw-0.5.0/tests/test_01_core/test_resources.py +11 -0
  181. brkraw-0.5.0/tests/test_01_core/test_zip.py +439 -0
  182. brkraw-0.5.0/tests/test_02_dataclasses/test_dir-vs-zipped.py +187 -0
  183. brkraw-0.5.0/tests/test_03_resolver/test_affine.py +32 -0
  184. brkraw-0.5.0/tests/test_04_specs/test_context_map_cases.py +61 -0
  185. brkraw-0.5.0/tests/test_04_specs/test_remapper.py +92 -0
  186. brkraw-0.5.0/tests/test_apps/test_affine_post_transform.py +34 -0
  187. brkraw-0.5.0/tests/test_apps/test_loader_info_missing_visu_pars.py +54 -0
  188. brkraw-0.5.0/tests/test_cli/test_hook_args_yaml.py +74 -0
  189. brkraw-0.5.0/tests/test_cli/test_hook_preset.py +30 -0
  190. brkraw-0.5.0/tests/test_scripts/test_update_contributors.py +43 -0
  191. brkraw-0.3.11/PKG-INFO +0 -16
  192. brkraw-0.3.11/README.md +0 -88
  193. brkraw-0.3.11/brkraw/__init__.py +0 -8
  194. brkraw-0.3.11/brkraw/lib/__init__.py +0 -4
  195. brkraw-0.3.11/brkraw/lib/backup.py +0 -641
  196. brkraw-0.3.11/brkraw/lib/errors.py +0 -125
  197. brkraw-0.3.11/brkraw/lib/loader.py +0 -1220
  198. brkraw-0.3.11/brkraw/lib/orient.py +0 -194
  199. brkraw-0.3.11/brkraw/lib/parser.py +0 -48
  200. brkraw-0.3.11/brkraw/lib/pvobj.py +0 -301
  201. brkraw-0.3.11/brkraw/lib/reference.py +0 -245
  202. brkraw-0.3.11/brkraw/lib/utils.py +0 -471
  203. brkraw-0.3.11/brkraw/scripts/brk_backup.py +0 -106
  204. brkraw-0.3.11/brkraw/scripts/brkraw.py +0 -744
  205. brkraw-0.3.11/brkraw/ui/__init__.py +0 -0
  206. brkraw-0.3.11/brkraw/ui/config.py +0 -17
  207. brkraw-0.3.11/brkraw/ui/main_win.py +0 -214
  208. brkraw-0.3.11/brkraw/ui/previewer.py +0 -225
  209. brkraw-0.3.11/brkraw/ui/scan_info.py +0 -72
  210. brkraw-0.3.11/brkraw/ui/scan_list.py +0 -73
  211. brkraw-0.3.11/brkraw/ui/subj_info.py +0 -128
  212. brkraw-0.3.11/brkraw.egg-info/PKG-INFO +0 -16
  213. brkraw-0.3.11/brkraw.egg-info/SOURCES.txt +0 -30
  214. brkraw-0.3.11/brkraw.egg-info/dependency_links.txt +0 -1
  215. brkraw-0.3.11/brkraw.egg-info/entry_points.txt +0 -3
  216. brkraw-0.3.11/brkraw.egg-info/requires.txt +0 -10
  217. brkraw-0.3.11/brkraw.egg-info/top_level.txt +0 -2
  218. brkraw-0.3.11/setup.cfg +0 -4
  219. brkraw-0.3.11/setup.py +0 -51
  220. brkraw-0.3.11/tests/__init__.py +0 -0
  221. {brkraw-0.3.11 → brkraw-0.5.0}/LICENSE +0 -0
  222. {brkraw-0.3.11/brkraw/scripts → brkraw-0.5.0/tests/test_01_core}/__init__.py +0 -0
@@ -0,0 +1,60 @@
1
+ title: "Proposal: "
2
+ labels: ["discussion"]
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Thanks for starting a discussion. For BrkRaw, most extensions should be
8
+ handled via addons (rules/specs/transforms/context_map) or plugins.
9
+ - type: input
10
+ id: summary
11
+ attributes:
12
+ label: Summary
13
+ description: One sentence overview of the proposal.
14
+ placeholder: "Add support for XYZ scan metadata mapping"
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: context
19
+ attributes:
20
+ label: Context
21
+ description: Dataset type, Paravision version, and the workflow you are targeting.
22
+ placeholder: "PV 7.0.1, multi-echo sequence, needs custom NIfTI naming"
23
+ validations:
24
+ required: true
25
+ - type: dropdown
26
+ id: approach
27
+ attributes:
28
+ label: Preferred approach
29
+ description: Most changes should live outside core when possible.
30
+ options:
31
+ - Addon (rules/specs/transforms/context_map)
32
+ - Plugin (CLI entrypoint)
33
+ - Core change (Paravision compatibility only)
34
+ - Not sure yet
35
+ validations:
36
+ required: true
37
+ - type: textarea
38
+ id: details
39
+ attributes:
40
+ label: Details
41
+ description: Provide rules/specs/transforms/context_map ideas or plugin hooks.
42
+ placeholder: "Rules match on method=..., spec adds ..., transform normalizes ..."
43
+ validations:
44
+ required: true
45
+ - type: textarea
46
+ id: expected
47
+ attributes:
48
+ label: Expected output
49
+ description: What should the final behavior or artifact look like?
50
+ placeholder: "NIfTI names follow ..., metadata includes ..."
51
+ validations:
52
+ required: false
53
+ - type: textarea
54
+ id: references
55
+ attributes:
56
+ label: References
57
+ description: Links, sample data structure, or screenshots.
58
+ placeholder: "Link to sample dataset or docs"
59
+ validations:
60
+ required: false
@@ -0,0 +1,40 @@
1
+ title: "Question: "
2
+ labels: ["question"]
3
+ body:
4
+ - type: markdown
5
+ attributes:
6
+ value: |
7
+ Ask anything about BrkRaw usage, addons, rules/specs/transforms, or
8
+ dataset compatibility.
9
+ - type: input
10
+ id: summary
11
+ attributes:
12
+ label: Question
13
+ description: Short question summary.
14
+ placeholder: "How do I map custom method parameters?"
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: environment
19
+ attributes:
20
+ label: Environment
21
+ description: BrkRaw version, Paravision version, and OS.
22
+ placeholder: "BrkRaw 0.5.0a3, PV 7.0.1, macOS 14"
23
+ validations:
24
+ required: false
25
+ - type: textarea
26
+ id: context
27
+ attributes:
28
+ label: Context
29
+ description: What you are trying to achieve and what you have tried.
30
+ placeholder: "Trying to ...; current output is ..."
31
+ validations:
32
+ required: true
33
+ - type: textarea
34
+ id: references
35
+ attributes:
36
+ label: References
37
+ description: Logs, error messages, or links.
38
+ placeholder: "Error stack trace or link to docs"
39
+ validations:
40
+ required: false
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a reproducible problem.
4
+ title: "[Bug] "
5
+ labels: bug
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ Explain the bug and why it is a problem.
12
+
13
+ ## Steps to reproduce
14
+
15
+ 1.
16
+ 2.
17
+ 3.
18
+
19
+ ## Expected behavior
20
+
21
+ Describe what should happen.
22
+
23
+ ## Actual behavior
24
+
25
+ Describe what actually happens, including error output.
26
+
27
+ ## Environment
28
+
29
+ - OS:
30
+ - Python version:
31
+ - brkraw version:
32
+ - Installation method:
33
+
34
+ ## Checklist
35
+
36
+ - [ ] I verified the issue on the latest main branch or release
37
+ - [ ] I can reproduce this consistently
38
+ - [ ] I included relevant logs or stack traces
39
+
40
+ ## Additional context
41
+
42
+ Add any other context or screenshots here.
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Questions / Discussions
4
+ url: https://github.com/BrkRaw/brkraw/discussions
5
+ about: Ask questions or start a discussion.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea or enhancement.
4
+ title: "[Feature] "
5
+ labels: enhancement
6
+ assignees: ""
7
+ ---
8
+
9
+ ## Summary
10
+
11
+ Explain the feature request and why it is needed.
12
+
13
+ ## Type of change
14
+
15
+ - [ ] New feature
16
+ - [ ] Enhancement
17
+ - [ ] Docs update
18
+
19
+ ## Proposed solution
20
+
21
+ Describe the preferred approach.
22
+
23
+ ## Alternatives considered
24
+
25
+ Describe any alternatives or workarounds.
26
+
27
+ ## Checklist
28
+
29
+ - [ ] I searched for similar issues and did not find a duplicate
30
+ - [ ] I can describe a concrete use case
31
+
32
+ ## Additional context
33
+
34
+ Add any other context or mockups here.
@@ -0,0 +1,31 @@
1
+ ## Summary
2
+
3
+ Explain what this PR changes and why.
4
+
5
+ ## Type of change
6
+
7
+ - [ ] Bug fix
8
+ - [ ] New feature
9
+ - [ ] Refactor/maintenance
10
+ - [ ] Docs update
11
+ - [ ] CI/CD/workflow
12
+
13
+ ## Checklist
14
+
15
+ - [ ] I ran tests locally (`pytest`) and they pass
16
+ - [ ] I updated/add tests that cover this change
17
+ - [ ] I updated documentation where relevant (README, docstrings)
18
+ - [ ] I considered backward compatibility and breaking changes
19
+ - [ ] I followed existing code style and conventions
20
+
21
+ ## How to test
22
+
23
+ Provide steps or commands for reviewers to verify the change.
24
+
25
+ ```bash
26
+ pytest -q
27
+ ```
28
+
29
+ ## Related issues
30
+
31
+ Link to related issues or discussions (e.g., Fixes #123).
@@ -0,0 +1,10 @@
1
+ # AI coding instructions
2
+
3
+ - This repository is a Python package.
4
+ - Use the project-local virtualenv at `.venv` for Python commands.
5
+ - Target Python version: >= 3.8 (flag compatibility issues with versions supported by `pyproject.toml`).
6
+ - Prefer pure functions and type hints.
7
+ - Do not introduce new dependencies unless explicitly asked.
8
+ - Follow existing style and naming conventions.
9
+ - Avoid large refactors unless requested.
10
+ - Add/update tests for behavior changes when practical.
@@ -0,0 +1,28 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ pytest:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
14
+ pytest-version: ["7.4.*", "8.*"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ cache: "pip"
22
+ - name: Install package
23
+ run: |
24
+ python -m pip install --upgrade pip
25
+ python -m pip install . pytest==${{ matrix.pytest-version }}
26
+ - name: Run tests
27
+ run: |
28
+ pytest -q
@@ -0,0 +1,32 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build:
13
+ if: ${{ github.repository == 'BrkRaw/brkraw' && (github.event_name != 'release' || github.event.release.prerelease == false) }}
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: "3.x"
20
+ - name: Install MkDocs
21
+ run: |
22
+ python -m pip install --upgrade pip
23
+ python -m pip install mkdocs-material
24
+ - name: Build site
25
+ run: mkdocs build --strict --site-dir site
26
+ - name: Deploy to brkraw.github.io
27
+ uses: peaceiris/actions-gh-pages@v4
28
+ with:
29
+ personal_token: ${{ secrets.BRKRAW_GH_PAGES_TOKEN }}
30
+ external_repository: BrkRaw/brkraw.github.io
31
+ publish_branch: main
32
+ publish_dir: site
@@ -0,0 +1,97 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ target:
7
+ description: "Publish target"
8
+ type: choice
9
+ options: [testpypi, pypi]
10
+ default: testpypi
11
+ tag:
12
+ description: "Tag to publish (optional, e.g. v1.2.3)"
13
+ required: false
14
+ type: string
15
+ release:
16
+ types: [published]
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ build:
23
+ if: ${{ github.repository == 'BrkRaw/brkraw' && (github.event_name != 'release' || github.event.release.prerelease == false) }}
24
+ runs-on: ubuntu-latest
25
+ steps:
26
+ - name: Resolve tag
27
+ id: tag
28
+ run: |
29
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ inputs.tag }}" ]; then
30
+ echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
31
+ else
32
+ echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
33
+ fi
34
+ - uses: actions/checkout@v4
35
+ with:
36
+ ref: ${{ steps.tag.outputs.value }}
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: "3.x"
40
+ - name: Install build tooling
41
+ run: |
42
+ python -m pip install --upgrade pip
43
+ python -m pip install build twine packaging
44
+ - name: Verify version matches tag
45
+ if: ${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.tag != '') }}
46
+ env:
47
+ TAG: ${{ steps.tag.outputs.value }}
48
+ run: |
49
+ python scripts/verify_release_version.py
50
+ - name: Build dist
51
+ run: python -m build
52
+ - name: Check dist metadata
53
+ run: python -m twine check dist/*
54
+ - uses: actions/upload-artifact@v4
55
+ with:
56
+ name: dist-artifacts
57
+ path: dist/
58
+
59
+ publish:
60
+ if: ${{ github.repository == 'BrkRaw/brkraw' && (github.event_name != 'release' || github.event.release.prerelease == false) }}
61
+ runs-on: ubuntu-latest
62
+ needs: [build]
63
+ permissions:
64
+ id-token: write
65
+ contents: write
66
+ environment:
67
+ name: ${{ inputs.target || 'pypi' }}
68
+ url: https://${{ (inputs.target == 'pypi' || github.event_name == 'release') && 'pypi.org' || 'test.pypi.org' }}/p/brkraw
69
+ steps:
70
+ - uses: actions/download-artifact@v4
71
+ with:
72
+ name: dist-artifacts
73
+ path: dist/
74
+ - name: Resolve publish target
75
+ id: target
76
+ run: |
77
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
78
+ echo "target=${{ inputs.target }}" >> "$GITHUB_OUTPUT"
79
+ else
80
+ echo "target=pypi" >> "$GITHUB_OUTPUT"
81
+ fi
82
+ - name: Publish to TestPyPI
83
+ if: ${{ steps.target.outputs.target == 'testpypi' }}
84
+ uses: pypa/gh-action-pypi-publish@release/v1
85
+ with:
86
+ packages-dir: dist/
87
+ repository-url: https://test.pypi.org/legacy/
88
+ - name: Upload artifacts to GitHub Release
89
+ if: ${{ github.event_name == 'release' }}
90
+ env:
91
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92
+ run: gh release upload ${{ github.ref_name }} dist/* --clobber
93
+ - name: Publish to PyPI
94
+ if: ${{ steps.target.outputs.target == 'pypi' }}
95
+ uses: pypa/gh-action-pypi-publish@release/v1
96
+ with:
97
+ packages-dir: dist/
@@ -0,0 +1,129 @@
1
+ name: Create Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ tag:
10
+ description: "Tag to release (e.g. v1.2.3)"
11
+ required: true
12
+ type: string
13
+
14
+ permissions:
15
+ contents: write
16
+ discussions: write
17
+
18
+ jobs:
19
+ release:
20
+ if: ${{ github.repository == 'BrkRaw/brkraw' }}
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - name: Resolve tag
24
+ id: tag
25
+ run: |
26
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
27
+ echo "value=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
28
+ else
29
+ echo "value=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
30
+ fi
31
+ - uses: actions/checkout@v4
32
+ with:
33
+ ref: ${{ steps.tag.outputs.value }}
34
+ - name: Detect prerelease tag
35
+ id: prerelease
36
+ run: |
37
+ tag="${{ steps.tag.outputs.value }}"
38
+ if echo "$tag" | grep -Eq '(a|b|rc)[0-9]*$'; then
39
+ echo "value=true" >> "$GITHUB_OUTPUT"
40
+ else
41
+ echo "value=false" >> "$GITHUB_OUTPUT"
42
+ fi
43
+ - name: Create GitHub Release
44
+ uses: softprops/action-gh-release@v2
45
+ with:
46
+ tag_name: ${{ steps.tag.outputs.value }}
47
+ name: ${{ steps.tag.outputs.value }}
48
+ body_path: RELEASE_NOTES.md
49
+ prerelease: ${{ steps.prerelease.outputs.value }}
50
+ - name: Post release announcement
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+ GITHUB_REPOSITORY: ${{ github.repository }}
54
+ TAG_NAME: ${{ steps.tag.outputs.value }}
55
+ RELEASE_URL: https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.value }}
56
+ run: |
57
+ python3 - <<'PY'
58
+ import json
59
+ import os
60
+ from pathlib import Path
61
+ from urllib import request
62
+
63
+ token = os.environ.get("GITHUB_TOKEN")
64
+ repo = os.environ["GITHUB_REPOSITORY"]
65
+ tag = os.environ["TAG_NAME"]
66
+ release_url = os.environ["RELEASE_URL"]
67
+ owner, name = repo.split("/")
68
+
69
+ notes = Path("RELEASE_NOTES.md").read_text(encoding="utf-8").strip()
70
+ title = f"Release {tag}"
71
+ body = f"[Release {tag}]({release_url})\n\n{notes}"
72
+
73
+ query = {
74
+ "query": """
75
+ query($owner: String!, $name: String!) {
76
+ repository(owner: $owner, name: $name) {
77
+ id
78
+ discussionCategories(first: 50) {
79
+ nodes { id name }
80
+ }
81
+ }
82
+ }
83
+ """,
84
+ "variables": {"owner": owner, "name": name},
85
+ }
86
+
87
+ req = request.Request("https://api.github.com/graphql", method="POST")
88
+ req.add_header("Authorization", f"Bearer {token}")
89
+ req.add_header("Content-Type", "application/json")
90
+ data = json.dumps(query).encode("utf-8")
91
+ with request.urlopen(req, data=data) as resp:
92
+ payload = json.loads(resp.read().decode("utf-8"))
93
+
94
+ repo_data = payload.get("data", {}).get("repository", {})
95
+ category_id = None
96
+ for node in repo_data.get("discussionCategories", {}).get("nodes", []):
97
+ if node.get("name") == "Announcements":
98
+ category_id = node.get("id")
99
+ break
100
+ if not category_id:
101
+ print("Announcements category not found; skipping discussion.")
102
+ raise SystemExit(0)
103
+
104
+ mutation = {
105
+ "query": """
106
+ mutation($repoId: ID!, $categoryId: ID!, $title: String!, $body: String!) {
107
+ createDiscussion(input: {repositoryId: $repoId, categoryId: $categoryId, title: $title, body: $body}) {
108
+ discussion { id url }
109
+ }
110
+ }
111
+ """,
112
+ "variables": {
113
+ "repoId": repo_data.get("id"),
114
+ "categoryId": category_id,
115
+ "title": title,
116
+ "body": body,
117
+ },
118
+ }
119
+
120
+ req = request.Request("https://api.github.com/graphql", method="POST")
121
+ req.add_header("Authorization", f"Bearer {token}")
122
+ req.add_header("Content-Type", "application/json")
123
+ data = json.dumps(mutation).encode("utf-8")
124
+ with request.urlopen(req, data=data) as resp:
125
+ result = json.loads(resp.read().decode("utf-8"))
126
+ url = result.get("data", {}).get("createDiscussion", {}).get("discussion", {}).get("url")
127
+ if url:
128
+ print(f"Created discussion: {url}")
129
+ PY
@@ -0,0 +1,54 @@
1
+ name: Release On Merge
2
+
3
+ on:
4
+ pull_request:
5
+ types: [closed]
6
+ branches: [main]
7
+
8
+ permissions:
9
+ contents: write
10
+
11
+ jobs:
12
+ tag_release:
13
+ if: ${{ github.repository == 'BrkRaw/brkraw' && github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') }}
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ fetch-depth: 0
19
+ - name: Detect version change
20
+ id: version
21
+ run: |
22
+ base_sha="${{ github.event.pull_request.base.sha }}"
23
+ merge_sha="${{ github.event.pull_request.merge_commit_sha }}"
24
+ if ! git diff --name-only "$base_sha" "$merge_sha" | grep -q '^src/brkraw/__init__.py$'; then
25
+ echo "changed=false" >> "$GITHUB_OUTPUT"
26
+ exit 0
27
+ fi
28
+ version=$(python3 - <<'PY'
29
+ import re
30
+ from pathlib import Path
31
+
32
+ text = Path("src/brkraw/__init__.py").read_text(encoding="utf-8")
33
+ match = re.search(
34
+ r"^__version__(?:\\s*:\\s*[^=]+)?\\s*=\\s*['\\\"]([^'\\\"]+)['\\\"]",
35
+ text,
36
+ re.M,
37
+ )
38
+ if not match:
39
+ raise SystemExit("No __version__ found in src/brkraw/__init__.py")
40
+ print(match.group(1))
41
+ PY
42
+ )
43
+ echo "changed=true" >> "$GITHUB_OUTPUT"
44
+ echo "value=$version" >> "$GITHUB_OUTPUT"
45
+ - name: Create and push tag
46
+ if: ${{ steps.version.outputs.changed == 'true' }}
47
+ run: |
48
+ tag="${{ steps.version.outputs.value }}"
49
+ if git rev-parse "$tag" >/dev/null 2>&1; then
50
+ echo "Tag $tag already exists. Skipping."
51
+ exit 0
52
+ fi
53
+ git tag "$tag" "${{ github.event.pull_request.merge_commit_sha }}"
54
+ git push origin "$tag"
@@ -0,0 +1,26 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .mypy_cache/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .tox/
7
+ .nox/
8
+ .hypothesis/
9
+ .coverage
10
+ coverage.xml
11
+ htmlcov/
12
+ *.egg-info/
13
+ build/
14
+ dist/
15
+ site/
16
+ .DS_Store
17
+ .venv
18
+ .pycache
19
+ .env
20
+ .env.*
21
+ .direnv/
22
+ .envrc
23
+ .idea/
24
+ .vscode/
25
+ *.lock
26
+ .tmp
@@ -0,0 +1,6 @@
1
+ MD007: false
2
+ MD013:
3
+ line_length: 120
4
+ tables: false
5
+ MD022: false
6
+ MD032: false
brkraw-0.5.0/AGENTS.md ADDED
@@ -0,0 +1,22 @@
1
+ # Codex instructions (repo-wide)
2
+
3
+ ## Environment
4
+ - Use the project-local virtualenv at `.venv` (interpreter: `.venv/bin/python`) when running Python commands.
5
+ - Target Python version for development: >= 3.8. If a change would break
6
+ versions supported by `pyproject.toml`, call it out before proceeding.
7
+
8
+ ## Project constraints
9
+ - This repository is a Python package.
10
+ - Prefer pure functions and type hints.
11
+ - Do not introduce new dependencies unless explicitly requested.
12
+ - Follow existing style and naming conventions.
13
+ - Avoid large refactors unless requested.
14
+
15
+ ## Quality bar
16
+ - Add or update tests for behavior changes when practical.
17
+ - Keep user-facing CLI output stable unless explicitly requested.
18
+ - Prefer clear errors over silent failures; avoid broad `except Exception` unless there is a strong reason.
19
+
20
+ ## Handy commands
21
+ - Run tests: `.venv/bin/python -m pytest`
22
+ - Lint/type check: only run tools already configured in the repo (do not add new tooling unless asked).
@@ -0,0 +1,49 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it as below."
3
+ title: "BrkRaw: A modular toolkit for Bruker MRI raw-data handling"
4
+ type: software
5
+
6
+ authors:
7
+ - family-names: Lee
8
+ given-names: Sung-Ho
9
+ orcid: "https://orcid.org/0000-0001-5292-0747"
10
+ affiliation:
11
+ - "Center for Animal MRI (CAMRI), University of North Carolina at Chapel Hill, Chapel Hill, NC, United States"
12
+ - "Biomedical Research Imaging Center (BRIC), University of North Carolina at Chapel Hill, Chapel Hill, NC, United States"
13
+ - "Department of Neurology, UNC School of Medicine, Chapel Hill, NC, United States"
14
+ - family-names: Devenyi
15
+ given-names: Gabriel A.
16
+ orcid: "https://orcid.org/0000-0002-7766-1187"
17
+ affiliation:
18
+ - "Cerebral Imaging Centre, Douglas Mental Health University Institute, Montreal, QC, Canada"
19
+ - "Department of Psychiatry, McGill University, Montreal, QC, Canada"
20
+ - family-names: Ban
21
+ given-names: Woomi
22
+ orcid: "https://orcid.org/0000-0003-2003-717X"
23
+ affiliation:
24
+ - "Center for Animal MRI (CAMRI), University of North Carolina at Chapel Hill, Chapel Hill, NC, United States"
25
+ - "Biomedical Research Imaging Center (BRIC), University of North Carolina at Chapel Hill, Chapel Hill, NC, United States"
26
+ - "Department of Neurology, UNC School of Medicine, Chapel Hill, NC, United States"
27
+ - family-names: Shih
28
+ given-names: Yen-Yu Ian
29
+ orcid: "https://orcid.org/0000-0001-6529-911X"
30
+ affiliation:
31
+ - "Center for Animal MRI (CAMRI), University of North Carolina at Chapel Hill, Chapel Hill, NC, United States"
32
+ - "Biomedical Research Imaging Center (BRIC), University of North Carolina at Chapel Hill, Chapel Hill, NC, United States"
33
+ - "Department of Neurology, UNC School of Medicine, Chapel Hill, NC, United States"
34
+
35
+ doi: "10.5281/zenodo.3818614"
36
+ repository-code: "https://github.com/BrkRaw/brkraw"
37
+ url: "https://brkraw.github.io"
38
+
39
+ license: "GPL-3.0-only"
40
+
41
+ keywords:
42
+ - Bruker
43
+ - MRI
44
+ - preclinical MRI
45
+ - BIDS
46
+ - neuroimaging
47
+
48
+ version: "0.5.0"
49
+ date-released: "2026-01-13"