Skip to content

Indexer cleanup#909

Open
donald-e-boyce wants to merge 4 commits intoHEXRD:masterfrom
donald-e-boyce:indexer-cleanup
Open

Indexer cleanup#909
donald-e-boyce wants to merge 4 commits intoHEXRD:masterfrom
donald-e-boyce:indexer-cleanup

Conversation

@donald-e-boyce
Copy link
Copy Markdown
Collaborator

Overview

See #908, unintentionally closed. This cleans up documentation and typing in indexer.py. The latest changes the ParamMP variable to a TypedDict.

@donald-e-boyce donald-e-boyce added the documentation Improvements or additions to documentation label Mar 26, 2026
symHKLs: NDArray
symHKLs_ix: NDArray
wavelength: float
hklList: list[Any]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really avoid Any if at all possible when typing. Is it safe to assume that hklList is a list of integers, for example? If it can be multiple types, we can address that too, e.g. list[int | float].

Copy link
Copy Markdown
Collaborator

@ZackAttack614 ZackAttack614 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely better! I'll propose that we add in typing for the elements of numpy arrays, as well. We've done that in most places, e.g. here. That allows us to statically analyze the script and know whether the data type is an int, float64, bool, or str - all of which are matrix element types we've worked with in the HEXRD ecosystem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants