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

Import errors #44

Open
guilhermebene opened this issue Oct 23, 2021 · 1 comment
Open

Import errors #44

guilhermebene opened this issue Oct 23, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@guilhermebene
Copy link
Contributor

I am getting some errors due to import issues.

  • In spas/misc/statistics.py the following line is used import spyrit.misc.walsh_hadamard as wh but then some function calls do not start by wh as in:

    H = walsh_matrix(len(img))
    h_img = walsh_ordered2(img, H1d);
    In this case it seems I cannot train a new network because Stat_had() will fail.

  • As mentioned in Error when creating a DenoiCompNet #39 some imports in spas/learning/model_Had_DCAN.py do not work, I have noticed 3 factors that may contribute to this: circular imports, imports using * (star imports) and relative and absolute imports being used in a same file.

  • In a same file, imports like from ..misc.pattern_choice import Hadamard, matrix2conv (which is a relative import) and from spyrit.misc.statistics import * (which is not) are used, which I believe is not a best practice.

I believe it would be a good idea to review most of the imports in all relevant files, choose to use a method, i.e. relative imports, avoid star imports as much as possible and remove unnecessary legacy imports in file headers.

@guilhermebene guilhermebene added the bug Something isn't working label Oct 23, 2021
@tbaudier
Copy link
Collaborator

First point is done with 2e7df7f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants