DiamondLightSource / DiamondLightSource/httomo

Inappropriate tuple-like type for `RawAngles`

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

Description

When generating a pydantic model to represent the standard tomo loader config, I noticed that the `rotation_angles` parameter was being seen as an array of 1 element. This is because `RawAngles` is a `NamedTuple`: https://github.com/DiamondLightSource/httomo/blob/584e15ccd84fbd7f440454b6d3c48a071b8f2f83/httomo/loaders/types.py#L9-L14

and a `NamedTuple` has the ability to access elements by a zero-based index (like a normal tuple).

This way of accessing the single entry in `RawAngles` isn't particularly useful in any way, so is unnecessary. Accessing values via the keys in the dict is the only way that makes much sense for `RawAngles`, therefore, a `TypedDict` seems like a more sensible type for it.

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.