Skip to content

Typehints and debug messages - #66

Open
danielwbn wants to merge 3 commits into
OxfordIonTrapGroup:masterfrom
danielwbn:typehints
Open

Typehints and debug messages#66
danielwbn wants to merge 3 commits into
OxfordIonTrapGroup:masterfrom
danielwbn:typehints

Conversation

@danielwbn

Copy link
Copy Markdown
Contributor

No functional changes, just add a few type hints and debug log messages.

In some cases, the check of the result of a wlm library call is delayed until the result has been logged.

Tested on Ubuntu 22.04.5, python 3.10.12, HighFinesse WS8

Comment thread wand/server.py Outdated
from wand.tools import LaserOwnedException, LockException

if TYPE_CHECKING:
from frontend.wand_server import WandServer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should at least be wand.frontend.wand_server, though really, the better solution would probably be to break the cyclic dependency.

@dnadlinger

Copy link
Copy Markdown
Member

Sorry, this won't merge cleanly now anymore given the transition to Ruff, but you can just uv run --with dev poe fmt on your version and then re-create the commit to follow the formatting changes.

Correct the import statement for WandServer to include the proper
frontend module path for type checking.
@danielwbn

Copy link
Copy Markdown
Contributor Author

I fixed the merge conflicts. Love the new ruff formatting and -conda +uv changes!
Breaking the cyclic import would probably require a Protocol in a separate module, but it doesn't even happen at runtime, it's already guarded by TYPE_CHECKING.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants