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
[BUG] check_dependency for soft dependencies if defined with version in tags is failing #5963
Comments
Hm, I don't fully get it - what is actual behaviour and what is expected behaviour? |
In the PR for the adapter for tsbootstrap. I defined a lower bound for the tsbootstrap package. However, this check is not working (for testing I used Thus, basically there are two bugs:
from sktime.transformations.bootstrap import TSBootstrapAdapter
from sktime.datasets import load_airline
from sktime.utils.plotting import plot_series # doctest: +SKIP
from sktime.datasets import load_airline
from sktime.transformations.bootstrap import TSBootstrapAdapter
from tsbootstrap import MovingBlockBootstrap, MovingBlockBootstrapConfig
y = load_airline()
bootstrap = TSBootstrapAdapter(MovingBlockBootstrap(MovingBlockBootstrapConfig(10, n_bootstraps=10)))
result = bootstrap.fit_transform(y) |
can you link the Ci failure? might be that the test which fails does so due to inconsitency between init args and self params, e.g., |
Unfortunately, not now.. Since it requires a specific branch of tsbootstrap. I try to specify this version in the pyproject.toml.
No, the bug ist not associated with the initialisation. Either, I do not specify the version not correctly or there is a problem in the check_dependency function. |
hm, could you post the traceback then? copy-paste? |
Stack trace
|
I see - I think this is "circular failure". Namely, for the error message related to the failing version, it tries to print self, which tries to This should not be a problem for users once the class passes all |
In general, it would not be a good idea to first assign the parameters and call the
I do not understand this statement. I think this is not associated to failing tests of skbase. Thus, I also assume that this might affect users, if they have not installed a correct dependency of the third party library. |
I agree partially, though that is not a perfect solution since the dependency tags may depend on parameters. Admittedly a rare case, but in this case the message would be wrong/misleading. How about doing one of the following:
|
Yes, doing this in Regarding the other part of the issue, which leads to exception even if the correct version is installed. Do you agree that the following line https://github.com/sktime/sktime/blob/63a95f2c29251575b7963ad269044654cbe9d96c/sktime/utils/validation/_dependencies.py#L177C1-L178C1 seems to be wrong? |
Yes, in
Currently I cannot say, as I do not understand the rationale behind it anymore. I should have left a comment. If I could hazard a guess, it is that the empty string results in the empty specifier which could be correct for the comparison? |
@fkiraly Here is the described error in the CI https://github.com/sktime/sktime/actions/runs/8030832840/job/21939354666 As mentioned, these are two bugs.
|
I'm confused - I think this is the interaction of At least, could you move the |
Yes, I can do this. However, I am not a fan of doing initialization before the parameters of the super class are initialized. But probably for the use-case of pretty printing this is okay. |
In the extension contract, it's this way round - perhaps it's the worse convention, but it's the one followed for years. I think it has advantages in the |
If you add a new estimator with a soft dependency specifying a certain version then it will fail, since it is not checked against a certain version, instead it is checked against an empty string: See: https://github.com/sktime/sktime/blob/63a95f2c29251575b7963ad269044654cbe9d96c/sktime/utils/validation/_dependencies.py#L177C1-L178C1
Furthermore if the check fails, the msg creation may raise an exception, since the module is not fully initialized when trying to get the string representation of the estimator.
See: #5887
The text was updated successfully, but these errors were encountered: