DiamondLightSource / DiamondLightSource/ImagingHub

Auto button for loader `rotation_angles` parameter sets value incorrectly

Open
#99 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2
Forks
1
Avg merge
7h 4m
Merged PRs (30d)
24

Description

The typescript type used to represent the `rotation_angles` parameter of the loader is not quite correct regarding where the `auto` should be placed. The type has this: https://github.com/DiamondLightSource/TomoHub/blob/1bc40efd239fd37e575970a062e9dea8bea53f2f/frontend/src/contexts/LoaderContext.tsx#L15-L21

but the `auto` should be for the entire `rotation_angles` field, not the `data_path` subfield.

Ie, the type should look something like this instead:
```ts
rotation_angles: {
data_path?: string
user_defined?: {
start_angle: number;
stop_angle: number;
angles_total: number;
} | "auto" | null; // Allow null and 'auto';
```

A consequence of the incorrect type is that when the auto toggle button in the `Loader` component is toggled on, this causes the `rotation_angles` parameter config to be this:
```
rotation_angles: {
data_path: "auto"
}
```

which is incorrect, it should be:
```ts
rotation_angles: "auto"
```

This ultimately leads to a workflow triggered with the auto button toggled on to fail, because httomo is given an incorrect configuration of the `rotation_angles` parameter.

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.