wetransform-os / ProMCDA

A tool to estimate ranks of alternatives and their uncertainties based on the Multi Criteria Decision Analysis approach.
Eclipse Public License 2.0
5 stars 1 forks source link

import * in mcda_run.py #51

Open paulrougieux opened 1 month ago

paulrougieux commented 1 month ago

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:

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

paulrougieux commented 1 month ago

Related to the JOSS review https://github.com/openjournals/joss-reviews/issues/6190