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 * in mcda_run.py #51

Open
paulrougieux opened this issue Sep 10, 2024 · 1 comment
Open

import * in mcda_run.py #51

paulrougieux opened this issue Sep 10, 2024 · 1 comment

Comments

@paulrougieux
Copy link

import * works but it is not recommended in packages. See for example this old thread where pyhon authors discuss it https://bugs.python.org/issue38215
It's better to explicitly name where each function or object is coming from .

The following imports are at the beginning of mcda/mcda_run.py:

from mcda.utils.utils_for_main import *
from mcda.utils.utils_for_plotting import *
from mcda.utils.utils_for_parallelization import *

I see for example the functionrun_mcda_with_indicator_uncertainty used in there. It would be better to explicitly write where it comes from by importing this way:

from mcda.utils.utils_for_main import run_mcda_with_indicator_uncertainty

The same goes for all other imports in mcda_run, such as:

  • process_indicators_and_weights
  • check_indicator_weights_polarities

A linter such as flake8 or pylint can help you notice such issues.

@paulrougieux
Copy link
Author

Related to the JOSS review openjournals/joss-reviews#6190

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

No branches or pull requests

1 participant