Skip to content

Fix three small bugs in core utils - #195

Merged
AnderBiguri merged 3 commits into
CambridgeCIA:mainfrom
cslht:fix/ct-utils-small-issues
Aug 5, 2026
Merged

Fix three small bugs in core utils#195
AnderBiguri merged 3 commits into
CambridgeCIA:mainfrom
cslht:fix/ct-utils-small-issues

Conversation

@cslht

@cslht cslht commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Three small fixes in core utils:

  • normaliser.py: Normalisation("sample") crashed — torch max/min don't take a tuple dim; switched to amax/amin (and the target branch to per-batch).
  • ct_geometry.py: a bare staticmethod (no @) left the method un-decorated, so instance calls raised TypeError; added the @.
  • parameter.py: save() discarded the joinpath('.json') result, so suffix-less names saved without .json; now uses with_suffix('.json').

- normaliser: Normalisation('sample') crashed because torch max/min don't
  accept a tuple dim; switched to amax/amin. The unnormalise(target) branch
  also mixed a global max with per-sample min, now per-batch
- ct_geometry: bare 'staticmethod' (no @) never decorated the method, so
  Geometry().parallel_sparse_angle_parameters() raised TypeError
- parameter: save() did fname.joinpath('.json') and dropped the result, so
  suffix-less names saved without .json; now with_suffix('.json')
@cslht
cslht force-pushed the fix/ct-utils-small-issues branch from 947d09f to dc55768 Compare August 5, 2026 02:23
cslht added 2 commits August 4, 2026 19:28
black --all-files in pre-commit flags LIONmodel.py and two
classical_algorithms tests (from CambridgeCIA#194). Formatting only, no
behavioural changes.
@AnderBiguri
AnderBiguri merged commit 25e9ac7 into CambridgeCIA:main Aug 5, 2026
1 check passed
cslht11 pushed a commit to cslht11/LION that referenced this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants