Track: Avoid sys.path.insert(0, '../') to import files in a sibling folder #22

Open
opened 2024-03-25 18:13:38 +01:00 by Benjamin_Loison · 0 comments

See Benjamin-Loison/cpython/issues/17.

# See [Robust_image_source_identification_on_modern_smartphones/issues/22](https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/issues/22).
match DISTANCE:
case Distance.ROOT_MEAN_SQUARE:
import sys
sys.path.insert(0, '../../algorithms/distance/')
from rms_diff import rmsDiffNumpy
case PEARSON_CORRELATION:
import scipy
from utils import getPearsonCorrelation

# See [Robust_image_source_identification_on_modern_smartphones/issues/22](https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/issues/22).
match DISTANCE:
case Distance.ROOT_MEAN_SQUARE:
import sys
sys.path.insert(0, '../../algorithms/distance/')
from rms_diff import rmsDiffNumpy
case PEARSON_CORRELATION:
import scipy
from utils import getPearsonCorrelation

See [Benjamin-Loison/cpython/issues/17](https://github.com/Benjamin-Loison/cpython/issues/17). https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/src/commit/60a9dfe89ce6cbf403a3ff424d772f2e07f1cceb/datasets/raise/attribute_source_camera.py#L21-L29 https://gitea.lemnoslife.com/Benjamin_Loison/Robust_image_source_identification_on_modern_smartphones/src/commit/60a9dfe89ce6cbf403a3ff424d772f2e07f1cceb/datasets/raise/split_and_compare_prnus_of_subgroups.py#L15-L23
Benjamin_Loison changed title from Track: to Track: Avoid `sys.path.insert(0, '../')` to `import` files in a sibling folder 2024-03-25 18:13:43 +01:00
Benjamin_Loison added the
meta
label 2024-03-26 02:06:07 +01:00
Benjamin_Loison added the
medium priority
quick
labels 2024-03-26 02:13:28 +01:00
Sign in to join this conversation.
No description provided.