-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor default constants: replace strings with enums, and relocate into relevant classes #92
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
Changes from all commits
9617fe0
dcb6d35
ebbead6
a5142b1
648d539
8a4757d
aaef13c
9a72003
54026df
957c892
fbd3abf
9be3d7c
7801bf8
9526e95
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # SPDX-FileCopyrightText: 2021-2025 EasyDiffraction Python Library contributors <https://github.com/easyscience/diffraction-lib> | ||
| # SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| from typing import TYPE_CHECKING | ||
| from typing import Any | ||
| from typing import Dict | ||
| from typing import List | ||
|
|
@@ -14,7 +15,9 @@ | |
| from easydiffraction.sample_models.sample_models import SampleModels | ||
|
|
||
| from ..analysis.reliability_factors import get_reliability_inputs | ||
| from .minimizers.minimizer_base import FitResults | ||
|
|
||
| if TYPE_CHECKING: | ||
| from .minimizers.minimizer_base import FitResults | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. circular dependencies? 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change because Ruff showed a TC001 warning (“Move application imports used only for typing into a TYPE_CHECKING block”) after I turned on the type-checking rules 🙃 |
||
| from .minimizers.minimizer_factory import MinimizerFactory | ||
|
|
||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do static type checking code analysis with ruff? Nice! Probably worth extending to other projects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Ruff has some basic type-checking support - it already helped catch one or two issues, and that's better than nothing. But we'll still need a more advanced solution, like typeguard or similar.