Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

KEMSystemMatrix: get_weighting_subset aliased to get_projection_subset

Open Beginner friendly
#228 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python, pytorch
Domain
backend

Research direction

Start in projectors/shared/kem_system_matrix.py:20 and compare the delegated methods with the SystemMatrix implementation. Trace the get_weighting_subset calls from PreconditionedGradientAscent in the prior, uncertainty, and BSREM paths, then reproduce the reported call. Done means those paths no longer raise a signature error and receive the weighting value expected by set_beta_scale and norm_BP_weight.

Written by the indexing model from the issue text.

Description

Hi, while reading through the KEM implementation I noticed KEMSystemMatrix sets

self.get_weighting_subset = self.system_matrix.get_projection_subset

in __init__ (projectors/shared/kem_system_matrix.py:20), but the two methods take different arguments:

  • get_projection_subset(projections, subset_idx) - two arguments
  • get_weighting_subset(subset_idx) - one argument

PreconditionedGradientAscent calls get_weighting_subset(subset_idx) with a single argument (in the prior, uncertainty, and BSREM paths), which would hit the two-argument get_projection_subset and raise TypeError. It also returns projections rather than the scalar weight that set_beta_scale / norm_BP_weight expect.

This looks like it would break any KEM reconstruction that uses a prior (or BSREM / uncertainty estimation). I think it should alias to self.system_matrix.get_weighting_subset. The signature mismatch reproduces locally. Let me know if I've misunderstood.

Dominant language
Python
Stars
173
Forks
38
Avg merge
1h 17m
Merged PRs (30d)
5

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PyTomography/PyTomography

All issues in PyTomography/PyTomography

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.