Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert to typing.NamedTuple #125

Closed
nstarman opened this issue Aug 3, 2023 · 3 comments
Closed

Convert to typing.NamedTuple #125

nstarman opened this issue Aug 3, 2023 · 3 comments
Labels
maintenance Maintenance: refactoring, typos, etc. typing Static typing
Milestone

Comments

@nstarman
Copy link

nstarman commented Aug 3, 2023

RadialWindow = namedtuple('RadialWindow', 'za, wa, zeff')

class RadialWindow(NamedTuple):
    """Docstring."""

    attr1: float
    """Description."""

    attr2: float
    """Description."""
@ntessore ntessore added ⚡ glass.shells maintenance Maintenance: refactoring, typos, etc. typing Static typing labels Aug 3, 2023
@ntessore ntessore added this to the v2023.8 milestone Aug 3, 2023
@ntessore
Copy link
Collaborator

ntessore commented Aug 3, 2023

Good catch. I was thinking whether a dataclass might not be better, but there probably are still a few cases of for za, wa, zeff in radial_windows scattered around.

@paddyroddy
Copy link
Member

This is being tackled in #232, closing for now

@paddyroddy
Copy link
Member

I went for typing.NamedTuple over dataclasses.dataclass as it involved fewer code changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance: refactoring, typos, etc. typing Static typing
Projects
None yet
Development

No branches or pull requests

3 participants