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

Resolve TODO comment in DCSample class #347

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

prjemian
Copy link
Contributor

@prjemian prjemian added this to the v1.1.2 milestone Jan 31, 2025
@prjemian prjemian requested review from mrakitin, padraic-shafer and a team January 31, 2025 22:41
@prjemian prjemian self-assigned this Jan 31, 2025
@@ -245,8 +245,7 @@ class DCSample:
(the reciprocal of the crystal) in an orthonormal system.
"""

# TODO: Once py38 is dropped, re-enable the default value setting
U: List[List[float]] # = field(default_factory=list[list[float]])
U: List[List[float]]
Copy link
Contributor

Choose a reason for hiding this comment

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

It wasn't clear whether you had already tried initializing the default value like this?

Suggested change
U: List[List[float]]
U: List[List[float]] = field(default_factory=lambda: [[]])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try that next.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will also apply to UB (above).

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

Successfully merging this pull request may close these issues.

type annotation in DCSample class
2 participants