-
Notifications
You must be signed in to change notification settings - Fork 6
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 some nits in the codebase #708
Open
DiamondJoseph
wants to merge
12
commits into
main
Choose a base branch
from
nits
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
19e5c8f
S5915 Unindent asserts in context blocks
DiamondJoseph 5ae758a
Remove non-exported ConfigLoader
DiamondJoseph 9d82038
Import from packages for non __init__ modules
DiamondJoseph 342ab74
Remove unexported declaration
DiamondJoseph dcaa11b
Annotated fixtures and use builtin tmp_path
DiamondJoseph cc3e7c4
Remove type: ignore where possible
DiamondJoseph 7cc1d5a
Update Union typing
DiamondJoseph 3aeea90
Raise ValidationError correctly.
DiamondJoseph f4d70ae
noqa where type: ignore insufficient
DiamondJoseph dd9128c
ruff enforce absolute imports
DiamondJoseph 90963cc
Annotate more mocks and remove unused mocks without side effects
DiamondJoseph 7b885bd
test commit cast objects to mock when checking
DiamondJoseph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from ._version import __version__ | ||
from blueapi._version import __version__ | ||
|
||
__all__ = ["__version__"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .cli import main | ||
from blueapi.cli.cli import main | ||
|
||
__all__ = ["main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,7 @@ | |
from pydantic_core import CoreSchema, core_schema | ||
|
||
from blueapi.config import EnvironmentConfig, SourceKind | ||
from blueapi.utils import BlueapiPlanModelConfig, load_module_all | ||
|
||
from .bluesky_types import ( | ||
from blueapi.core.bluesky_types import ( | ||
BLUESKY_PROTOCOLS, | ||
Device, | ||
HasName, | ||
|
@@ -34,7 +32,8 @@ | |
is_bluesky_compatible_device, | ||
is_bluesky_plan_generator, | ||
) | ||
from .device_lookup import find_component | ||
from blueapi.core.device_lookup import find_component | ||
from blueapi.utils import BlueapiPlanModelConfig, load_module_all | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
@@ -61,7 +60,7 @@ def find_device(self, addr: str | list[str]) -> Device | None: | |
Find a device in this context, allows for recursive search. | ||
|
||
Args: | ||
addr (Union[str, List[str]]): Address of the device, examples: | ||
addr (str | list[str]): Address of the device, examples: | ||
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. Nit: I don't tend to bother with type annotations at all in docstrings, since I already put them in the function signatures and AFAIK that's enough for tools like autodoc. |
||
"motors", "motors.x" | ||
|
||
Returns: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .model import DeviceModel, PlanModel | ||
from blueapi.service.model import DeviceModel, PlanModel | ||
|
||
__all__ = ["PlanModel", "DeviceModel"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could: If we're against relative imports as a policy, is there any way we can make the linting fail if they are present?