Methods without a `side_outputs` field may be unnecessarily included in `method_id_map`

Open
#475 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start in httomo/ui_layer.py at the method-ID map construction around lines 64-72 and 110, then follow UiLayer.build_pipeline() into update_side_output_references(). Determine whether entries without an id are required for pipeline construction or only side-output lookup; done means the map's intended contents and any needed behavior change are verified.

Written by the indexing model from the issue text.

Description

question refactor

A variable methods_id_map is defined in the UI layer when there is iteration over the methods in the pipeline config, getting ready to build the Pipeline object: https://github.com/DiamondLightSource/httomo/blob/7842bae27c1777545279aa36e8c10d9c4eeb489f/httomo/ui_layer.py#L64-L72

Based on how this variable is used by update_side_output_references() to map:

it would appear that this methods_id_map is solely for dealing with side outputs.

However, the methods_id_map includes both:

  • methods with an id field
  • methods without and id field

https://github.com/DiamondLightSource/httomo/blob/7842bae27c1777545279aa36e8c10d9c4eeb489f/httomo/ui_layer.py#L110

and some dumb printing in the loop in UiLayer.build_pipeline() confirms this:

i = 1, method_id_map is now {'centering':
<httomo.method_wrappers.rotation.RotationWrapper object at 0x7f3d48321f60>}
i = 2, method_id_map is now {'centering':
<httomo.method_wrappers.rotation.RotationWrapper object at 0x7f3d48321f60>, 'task_2':
<httomo.method_wrappers.dezinging.DezingingWrapper object at 0x7f3d41d8c220>}
i = 3, method_id_map is now {'centering':
<httomo.method_wrappers.rotation.RotationWrapper object at 0x7f3d48321f60>, 'task_2':
<httomo.method_wrappers.dezinging.DezingingWrapper object at 0x7f3d41d8c220>, 'task_3':
<httomo.method_wrappers.generic.GenericMethodWrapper object at 0x7f3d41d8e110>}
i = 4, method_id_map is now {'centering':
<httomo.method_wrappers.rotation.RotationWrapper object at 0x7f3d48321f60>, 'task_2':
<httomo.method_wrappers.dezinging.DezingingWrapper object at 0x7f3d41d8c220>, 'task_3':
<httomo.method_wrappers.generic.GenericMethodWrapper object at 0x7f3d41d8e110>, 'task_4':
<httomo.method_wrappers.generic.GenericMethodWrapper object at 0x7f3d41d8c190>}
...

Question: given that methods_id_map seems to only be used for side outputs, is there a particular reason why methods without an id field (which produce no side outputs, and thus have no reason to be referenced) are still added to methods_id_map?

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

Contributor guide

No contributing guide indexed for this repository

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 DiamondLightSource/httomo

All issues in DiamondLightSource/httomo

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.