Skip to content

Change typing types to the more specific types from pygen_structures._typing #4

@thesketh

Description

@thesketh

Currently, most of the library is typed fairly effectively, but much of the usage is messy due to long strings like the following:

Dict[Tuple[int, str], Tuple[Tuple[int, str], ...]]

Additionally, many class __init__ signatures contain types such as:

(None, List[Tuple[int, ...]])

It would be better to convert these types to those specified in _typing, to reduce clutter. This would enable the first example to read Dict[AtomID, Connection], and the second Optional[List[IndexConnection]].

This could also increase specificity by emphasising the semantic difference between types with the same signature. For example, this allows differentiation of an atom reference (where the 'residue index' refers to the order of the residues supplied to CHARMMPatchResidue.apply) and an atom ID (where the 'residue index' refers to the order of the residue in the molecule).

Metadata

Metadata

Assignees

Labels

typingChanges to Python's typing types.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions