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: ensure dtcwt is not used in typing annotations #571

Merged
merged 1 commit into from
Mar 4, 2024

Conversation

mrava87
Copy link
Collaborator

@mrava87 mrava87 commented Mar 4, 2024

The previous PR introduced an unwanted import error of pylops when dtcwt was not installed; this was due to the fact we used dtcwt for typing annotation.

The current solution is not to use for any typing annotation to ensure that no problem arises if dtcwt is not installed, given that it is an optional dependency

@mrava87 mrava87 merged commit 7b8727a into PyLops:dev Mar 4, 2024
15 checks passed
@mrava87 mrava87 deleted the fix-dtcwtimport branch March 4, 2024 09:04
@cako
Copy link
Collaborator

cako commented Mar 16, 2024

For reference, one strategy is to check if the library providing the annotations is installed, and if not, alias all of the missing types to Any. Not the best solution, but at least you don't lose the annotations.

@mrava87
Copy link
Collaborator Author

mrava87 commented Mar 17, 2024

Oh, good idea :) I didn't think about that, but it make sense

@mrava87
Copy link
Collaborator Author

mrava87 commented Mar 17, 2024

@cako I created a PR, have a look if what I did is in line with your suggestion :)

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.

2 participants