DiamondLightSource / DiamondLightSource/httomo

`DataSetBlock` constructor takes some params with padding applied but also takes in the padding value

Open
#645 0 comments 0 reactions 0 assignees View on GitHub
framework refactor
Dominant language
Python
Stars
10
Forks
5
Avg merge
5d 17h
Merged PRs (30d)
1

Description

The padding applied to the block data is provided to the constructor: https://github.com/DiamondLightSource/httomo/blob/ab55f4c02bf404864ede10a5f8b52b8264c262de/httomo/runner/dataset.py#L16-L26

However, _some_ of the various index-related values have the padding included in them: https://github.com/DiamondLightSource/httomo/blob/ab55f4c02bf404864ede10a5f8b52b8264c262de/httomo/runner/dataset.py#L52-L58

It's confusing that the caller needs to know which ones to pad and which ones not to pad. The `DataSetBlock` constructor is essentially forcing the caller to have to know which values that it wants padded, which feels like an unnecessary burden on the caller.

A simpler and less confusing approach would be for the caller to pass:
- the unpadded values
- the padding

and the `DataSetBlock` constructor applies padding to whatever it wants/needs padding to be applied to in order to work correctly, avoiding making the caller have to know such things which are probably internal details which shouldn't need to be taken care of by callers.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.