-
Notifications
You must be signed in to change notification settings - Fork 16
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
deprecate ModuleAvailableCache
with RequirementCache
#147
Conversation
ModuleAvailableCache
with RequirementCache
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.
This is not right. RequirementCache
may check if the module is available but the functionality is different in the classes. I would agree with deprecating ModuleAvailableCache
because we don't use it but the RequirementCache
implementation should not be changed
So how can you use with |
For that sort of check you have |
well, I don't understand... on one side you are fine with deprecation but then not extending functionality such that you do use only the module path... 😖 |
I'm proposing one of two paths:
|
so what is the difference when |
I agree with this analysis. Why deprecate it then?
It's not the same functionality, one checks for packages, other for modules. Just as we have |
The primary intention was not to deprecate but reduce variety when one class does 90%. Why not add the missing 10% instead of creating a special class for the 10% and duplicating 50% of the code req = []
if a == 1:
req.append(RequirementCache(...))
else:
req.append(ModuleAvailableCache(...))
so what |
You can annotate it with The |
Sure, user is always welcome to write whole lit utils or lightning package, but
Cool, that is what I am saying, the feature is already there...
If Overall you are adding arguments why to do this change =) |
What do you think here @awaelchli? Would you put the functionality of |
Afaik we needed to have separate functions So I would say then it makes the most sense to also keep the classes separate. If there is a concern for code duplication, maybe a better approach would be to have utility functions to share code, instead of using inheritance (when it makes sense, I haven't looked closely). |
that is fine with me but then we shall remove |
This looks like it is used in several places for convenience. Removing it would break quite severely, since utilities is a core dependency of several Lightning packages. IMO none of these removals are worth the trouble for us and the users, this just looks like more work than it is worth it. |
So to sumiraze, |
@carmocca could review this fix? 🐿️ |
I dont have anything else to add to the discussion. I strongly suggest not continuing with this refactor. Is any bug or feature blocked by this PR? |
Still the module argument is very confusing... |
Before submitting
What does this PR do?
these two classes have almost identical code API and so it is confusing which shall be used when
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.