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

refactor(api): Move opentrons.initialize() to its own file #15191

Merged
merged 9 commits into from
May 16, 2024

Conversation

SyntaxColoring
Copy link
Contributor

@SyntaxColoring SyntaxColoring commented May 15, 2024

Overview

PR #15171 runs into a circular import problem. We can fix it by paring down the contents of api's top-level __init__.py, which might also have the benefit of improving performance (see explanation in PR #14480), so this does that. This goes towards EXEC-456.

Test plan

None needed.

Changelog

Move opentrons.initialize() to opentrons.hardware_control.initialization.initialize(), a new file.

Review requests

  • Does the new location make sense?
  • Are there any obvious ways to fix the various things that are importing the private _find_smoothie_file() function?
  • Is there an obvious place where it would make sense to move opentrons.should_use_ot3(), which currently remains in the top-level __init__.py?

Risk assessment

Low.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner May 15, 2024 20:39
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 put this in its own file to keep it close to the resources/ directory that it's referencing. Otherwise we'd be trying to access it from inside hardware_control/ with some fragile relative path.

Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

This is awesome and could even take it a step farther

api/src/opentrons/__init__.py Outdated Show resolved Hide resolved
Copy link
Contributor

@vegano1 vegano1 left a comment

Choose a reason for hiding this comment

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

This makes sense 👍

api/src/opentrons/__init__.py Outdated Show resolved Hide resolved
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