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

Fix flake8 #178

Merged
merged 7 commits into from
Jun 1, 2023
Merged

Fix flake8 #178

merged 7 commits into from
Jun 1, 2023

Conversation

boldar99
Copy link
Collaborator

No description provided.

from discopy.grammar import thue
from discopy.rigid import Ob
from discopy.rigid import Ob # noqa: F401
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we avoid this # noqa F401 by adding Ob to adding an __all__ variable to the module?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In this case we really want the unused import because e.g. lambeq uses from discopy.grammar.pregroup import Ob

discopy/interaction.py Outdated Show resolved Hide resolved
discopy/quantum/circuit.py Outdated Show resolved Hide resolved
from discopy.cat import factory
from discopy.monoidal import Ob, Ty, PRO
from discopy.monoidal import Ty, PRO
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would say as a rule of thumb it's nice if every module has it's own Ob even when it's just imported from another. In that way you can from discopy.symmetric import * and you get Ob.

Copy link
Collaborator

@toumix toumix left a comment

Choose a reason for hiding this comment

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

Good stuff! Let's take care of this pregroup.Ob business (because it might break lambeq) then we can merge

Copy link
Collaborator

@toumix toumix left a comment

Choose a reason for hiding this comment

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

LGTM

@boldar99 boldar99 merged commit 7053116 into main Jun 1, 2023
2 checks passed
@boldar99 boldar99 deleted the fix-flake8 branch June 1, 2023 09:27
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.

None yet

2 participants