From d0d9e7790f57ce59441470f2f351f62489d28b00 Mon Sep 17 00:00:00 2001 From: Noelle Cheng Date: Fri, 29 Aug 2025 12:42:40 +0800 Subject: [PATCH 1/4] rename directory to m2l to avoid import conflicts --- docs/conf.py | 2 +- {map2loop => m2l}/__about__.py | 0 {map2loop => m2l}/__init__.py | 0 {map2loop => m2l}/gui/__init__.py | 0 {map2loop => m2l}/gui/dlg_settings.py | 6 +++--- {map2loop => m2l}/gui/dlg_settings.ui | 0 {map2loop => m2l}/main/vectorLayerWrapper.py | 0 {map2loop => m2l}/metadata.txt | 0 {map2loop => m2l}/plugin_main.py | 8 ++++---- {map2loop => m2l}/processing/__init__.py | 0 {map2loop => m2l}/processing/algorithms/__init__.py | 0 .../processing/algorithms/extract_basal_contacts.py | 2 +- {map2loop => m2l}/processing/algorithms/sampler.py | 0 {map2loop => m2l}/processing/algorithms/sorter.py | 2 +- .../processing/algorithms/thickness_calculator.py | 0 {map2loop => m2l}/processing/provider.py | 2 +- .../resources/i18n/plugin_map2loop_en.ts | 0 .../resources/i18n/plugin_translation.pro | 0 {map2loop => m2l}/resources/images/default_icon.png | Bin {map2loop => m2l}/toolbelt/__init__.py | 0 {map2loop => m2l}/toolbelt/env_var_parser.py | 0 {map2loop => m2l}/toolbelt/log_handler.py | 4 ++-- {map2loop => m2l}/toolbelt/preferences.py | 6 +++--- tests/qgis/test_env_var_parser.py | 2 +- tests/qgis/test_plg_preferences.py | 4 ++-- tests/qgis/test_processing.py | 2 +- tests/unit/test_plg_metadata.py | 2 +- 27 files changed, 21 insertions(+), 21 deletions(-) rename {map2loop => m2l}/__about__.py (100%) rename {map2loop => m2l}/__init__.py (100%) rename {map2loop => m2l}/gui/__init__.py (100%) rename {map2loop => m2l}/gui/dlg_settings.py (96%) rename {map2loop => m2l}/gui/dlg_settings.ui (100%) rename {map2loop => m2l}/main/vectorLayerWrapper.py (100%) rename {map2loop => m2l}/metadata.txt (100%) rename {map2loop => m2l}/plugin_main.py (96%) rename {map2loop => m2l}/processing/__init__.py (100%) rename {map2loop => m2l}/processing/algorithms/__init__.py (100%) rename {map2loop => m2l}/processing/algorithms/extract_basal_contacts.py (98%) rename {map2loop => m2l}/processing/algorithms/sampler.py (100%) rename {map2loop => m2l}/processing/algorithms/sorter.py (98%) rename {map2loop => m2l}/processing/algorithms/thickness_calculator.py (100%) rename {map2loop => m2l}/processing/provider.py (98%) rename {map2loop => m2l}/resources/i18n/plugin_map2loop_en.ts (100%) rename {map2loop => m2l}/resources/i18n/plugin_translation.pro (100%) rename {map2loop => m2l}/resources/images/default_icon.png (100%) rename {map2loop => m2l}/toolbelt/__init__.py (100%) rename {map2loop => m2l}/toolbelt/env_var_parser.py (100%) rename {map2loop => m2l}/toolbelt/log_handler.py (98%) rename {map2loop => m2l}/toolbelt/preferences.py (97%) diff --git a/docs/conf.py b/docs/conf.py index 6d7892e..d7cc5df 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,7 @@ import sphinx_rtd_theme # noqa: F401 theme of Read the Docs # Package -from map2loop import __about__ +from m2l import __about__ # -- Build environment ----------------------------------------------------- on_rtd = environ.get("READTHEDOCS", None) == "True" diff --git a/map2loop/__about__.py b/m2l/__about__.py similarity index 100% rename from map2loop/__about__.py rename to m2l/__about__.py diff --git a/map2loop/__init__.py b/m2l/__init__.py similarity index 100% rename from map2loop/__init__.py rename to m2l/__init__.py diff --git a/map2loop/gui/__init__.py b/m2l/gui/__init__.py similarity index 100% rename from map2loop/gui/__init__.py rename to m2l/gui/__init__.py diff --git a/map2loop/gui/dlg_settings.py b/m2l/gui/dlg_settings.py similarity index 96% rename from map2loop/gui/dlg_settings.py rename to m2l/gui/dlg_settings.py index bf6c8b1..351a008 100644 --- a/map2loop/gui/dlg_settings.py +++ b/m2l/gui/dlg_settings.py @@ -18,15 +18,15 @@ from qgis.PyQt.QtGui import QDesktopServices, QIcon # project -from map2loop.__about__ import ( +from m2l.__about__ import ( __icon_path__, __title__, __uri_homepage__, __uri_tracker__, __version__, ) -from map2loop.toolbelt import PlgLogger, PlgOptionsManager -from map2loop.toolbelt.preferences import PlgSettingsStructure +from m2l.toolbelt import PlgLogger, PlgOptionsManager +from m2l.toolbelt.preferences import PlgSettingsStructure # ############################################################################ # ########## Globals ############### diff --git a/map2loop/gui/dlg_settings.ui b/m2l/gui/dlg_settings.ui similarity index 100% rename from map2loop/gui/dlg_settings.ui rename to m2l/gui/dlg_settings.ui diff --git a/map2loop/main/vectorLayerWrapper.py b/m2l/main/vectorLayerWrapper.py similarity index 100% rename from map2loop/main/vectorLayerWrapper.py rename to m2l/main/vectorLayerWrapper.py diff --git a/map2loop/metadata.txt b/m2l/metadata.txt similarity index 100% rename from map2loop/metadata.txt rename to m2l/metadata.txt diff --git a/map2loop/plugin_main.py b/m2l/plugin_main.py similarity index 96% rename from map2loop/plugin_main.py rename to m2l/plugin_main.py index f803c9a..a286f1e 100644 --- a/map2loop/plugin_main.py +++ b/m2l/plugin_main.py @@ -15,17 +15,17 @@ from qgis.PyQt.QtWidgets import QAction # project -from map2loop.__about__ import ( +from m2l.__about__ import ( DIR_PLUGIN_ROOT, __icon_path__, __title__, __uri_homepage__, ) -from map2loop.gui.dlg_settings import PlgOptionsFactory -from map2loop.processing import ( +from m2l.gui.dlg_settings import PlgOptionsFactory +from m2l.processing import ( Map2LoopProvider, ) -from map2loop.toolbelt import PlgLogger +from m2l.toolbelt import PlgLogger # ############################################################################ # ########## Classes ############### diff --git a/map2loop/processing/__init__.py b/m2l/processing/__init__.py similarity index 100% rename from map2loop/processing/__init__.py rename to m2l/processing/__init__.py diff --git a/map2loop/processing/algorithms/__init__.py b/m2l/processing/algorithms/__init__.py similarity index 100% rename from map2loop/processing/algorithms/__init__.py rename to m2l/processing/algorithms/__init__.py diff --git a/map2loop/processing/algorithms/extract_basal_contacts.py b/m2l/processing/algorithms/extract_basal_contacts.py similarity index 98% rename from map2loop/processing/algorithms/extract_basal_contacts.py rename to m2l/processing/algorithms/extract_basal_contacts.py index 534958e..f329229 100644 --- a/map2loop/processing/algorithms/extract_basal_contacts.py +++ b/m2l/processing/algorithms/extract_basal_contacts.py @@ -25,7 +25,7 @@ ) # Internal imports from ...main.vectorLayerWrapper import qgsLayerToGeoDataFrame, GeoDataFrameToQgsLayer -from map2loop import ContactExtractor +from map2loop.contact_extractor import ContactExtractor class BasalContactsAlgorithm(QgsProcessingAlgorithm): diff --git a/map2loop/processing/algorithms/sampler.py b/m2l/processing/algorithms/sampler.py similarity index 100% rename from map2loop/processing/algorithms/sampler.py rename to m2l/processing/algorithms/sampler.py diff --git a/map2loop/processing/algorithms/sorter.py b/m2l/processing/algorithms/sorter.py similarity index 98% rename from map2loop/processing/algorithms/sorter.py rename to m2l/processing/algorithms/sorter.py index a159855..5c4340a 100644 --- a/map2loop/processing/algorithms/sorter.py +++ b/m2l/processing/algorithms/sorter.py @@ -177,7 +177,7 @@ def build_input_frames(layer: QgsVectorLayer, feedback) -> tuple: (units_df, relationships_df, contacts_df, map_data) """ import pandas as pd - from map2loop.map2loop.mapdata import MapData # adjust import path if needed + from m2l.map2loop.mapdata import MapData # adjust import path if needed # Example: convert the geology layer to a very small units_df units_records = [] diff --git a/map2loop/processing/algorithms/thickness_calculator.py b/m2l/processing/algorithms/thickness_calculator.py similarity index 100% rename from map2loop/processing/algorithms/thickness_calculator.py rename to m2l/processing/algorithms/thickness_calculator.py diff --git a/map2loop/processing/provider.py b/m2l/processing/provider.py similarity index 98% rename from map2loop/processing/provider.py rename to m2l/processing/provider.py index ba879bb..4095979 100644 --- a/map2loop/processing/provider.py +++ b/m2l/processing/provider.py @@ -10,7 +10,7 @@ from qgis.PyQt.QtGui import QIcon # project -from map2loop.__about__ import ( +from m2l.__about__ import ( __icon_path__, __title__, __version__, diff --git a/map2loop/resources/i18n/plugin_map2loop_en.ts b/m2l/resources/i18n/plugin_map2loop_en.ts similarity index 100% rename from map2loop/resources/i18n/plugin_map2loop_en.ts rename to m2l/resources/i18n/plugin_map2loop_en.ts diff --git a/map2loop/resources/i18n/plugin_translation.pro b/m2l/resources/i18n/plugin_translation.pro similarity index 100% rename from map2loop/resources/i18n/plugin_translation.pro rename to m2l/resources/i18n/plugin_translation.pro diff --git a/map2loop/resources/images/default_icon.png b/m2l/resources/images/default_icon.png similarity index 100% rename from map2loop/resources/images/default_icon.png rename to m2l/resources/images/default_icon.png diff --git a/map2loop/toolbelt/__init__.py b/m2l/toolbelt/__init__.py similarity index 100% rename from map2loop/toolbelt/__init__.py rename to m2l/toolbelt/__init__.py diff --git a/map2loop/toolbelt/env_var_parser.py b/m2l/toolbelt/env_var_parser.py similarity index 100% rename from map2loop/toolbelt/env_var_parser.py rename to m2l/toolbelt/env_var_parser.py diff --git a/map2loop/toolbelt/log_handler.py b/m2l/toolbelt/log_handler.py similarity index 98% rename from map2loop/toolbelt/log_handler.py rename to m2l/toolbelt/log_handler.py index 222fa3f..284365e 100644 --- a/map2loop/toolbelt/log_handler.py +++ b/m2l/toolbelt/log_handler.py @@ -12,8 +12,8 @@ from qgis.utils import iface # project package -import map2loop.toolbelt.preferences as plg_prefs_hdlr -from map2loop.__about__ import __title__ +import m2l.toolbelt.preferences as plg_prefs_hdlr +from m2l.__about__ import __title__ # ############################################################################ # ########## Classes ############### diff --git a/map2loop/toolbelt/preferences.py b/m2l/toolbelt/preferences.py similarity index 97% rename from map2loop/toolbelt/preferences.py rename to m2l/toolbelt/preferences.py index 85986b1..8742313 100644 --- a/map2loop/toolbelt/preferences.py +++ b/m2l/toolbelt/preferences.py @@ -11,9 +11,9 @@ from qgis.core import QgsSettings # package -import map2loop.toolbelt.log_handler as log_hdlr -from map2loop.__about__ import __title__, __version__ -from map2loop.toolbelt.env_var_parser import EnvVarParser +import m2l.toolbelt.log_handler as log_hdlr +from m2l.__about__ import __title__, __version__ +from m2l.toolbelt.env_var_parser import EnvVarParser # ############################################################################ # ########## Classes ############### diff --git a/tests/qgis/test_env_var_parser.py b/tests/qgis/test_env_var_parser.py index ce4b73d..b968008 100644 --- a/tests/qgis/test_env_var_parser.py +++ b/tests/qgis/test_env_var_parser.py @@ -1,7 +1,7 @@ import os import unittest -from map2loop.toolbelt.env_var_parser import EnvVarParser +from m2l.toolbelt.env_var_parser import EnvVarParser class TestEnvVarParser(unittest.TestCase): diff --git a/tests/qgis/test_plg_preferences.py b/tests/qgis/test_plg_preferences.py index 23daa19..8ac07a3 100644 --- a/tests/qgis/test_plg_preferences.py +++ b/tests/qgis/test_plg_preferences.py @@ -18,8 +18,8 @@ from qgis.testing import unittest # project -from map2loop.__about__ import __version__ -from map2loop.toolbelt.preferences import ( +from m2l.__about__ import __version__ +from m2l.toolbelt.preferences import ( PREFIX_ENV_VARIABLE, PlgOptionsManager, PlgSettingsStructure, diff --git a/tests/qgis/test_processing.py b/tests/qgis/test_processing.py index b52b3de..6f5c719 100644 --- a/tests/qgis/test_processing.py +++ b/tests/qgis/test_processing.py @@ -15,7 +15,7 @@ from qgis.core import QgsApplication from qgis.testing import start_app, unittest -from map2loop.processing.provider import ( +from m2l.processing.provider import ( Map2LoopProvider, ) diff --git a/tests/unit/test_plg_metadata.py b/tests/unit/test_plg_metadata.py index 2baf6ed..e6373a6 100644 --- a/tests/unit/test_plg_metadata.py +++ b/tests/unit/test_plg_metadata.py @@ -18,7 +18,7 @@ from packaging.version import parse # project -from map2loop import __about__ +from m2l import __about__ # ############################################################################ # ########## Classes ############# From 34f3d25289fc12d44b5752832ef27e90355b7309 Mon Sep 17 00:00:00 2001 From: Noelle Cheng Date: Fri, 29 Aug 2025 13:40:31 +0800 Subject: [PATCH 2/4] fix linter.yml --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index f87c4e5..a725d82 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -13,7 +13,7 @@ on: workflow_dispatch: env: - PROJECT_FOLDER: "map2loop" + PROJECT_FOLDER: "m2l" PYTHON_VERSION: 3.9 permissions: contents: write From b72fbf4ae519cab812818beb7326791f625aed18 Mon Sep 17 00:00:00 2001 From: Rabii Chaarani <50892556+rabii-chaarani@users.noreply.github.com> Date: Mon, 1 Sep 2025 11:01:43 +0930 Subject: [PATCH 3/4] fix: add QgsPoint import --- m2l/main/vectorLayerWrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m2l/main/vectorLayerWrapper.py b/m2l/main/vectorLayerWrapper.py index d68ed3d..f981737 100644 --- a/m2l/main/vectorLayerWrapper.py +++ b/m2l/main/vectorLayerWrapper.py @@ -9,7 +9,8 @@ QgsWkbTypes, QgsCoordinateReferenceSystem, QgsFeatureSink, - QgsProcessingException + QgsProcessingException, + QgsPoint ) from qgis.PyQt.QtCore import QVariant, QDateTime From 04d3937dadab0945f11ccc45700b25ee7c0395c7 Mon Sep 17 00:00:00 2001 From: Rabii Chaarani <50892556+rabii-chaarani@users.noreply.github.com> Date: Mon, 1 Sep 2025 11:04:46 +0930 Subject: [PATCH 4/4] fix: add QgsPointXY import --- m2l/main/vectorLayerWrapper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m2l/main/vectorLayerWrapper.py b/m2l/main/vectorLayerWrapper.py index f981737..98597bb 100644 --- a/m2l/main/vectorLayerWrapper.py +++ b/m2l/main/vectorLayerWrapper.py @@ -10,7 +10,8 @@ QgsCoordinateReferenceSystem, QgsFeatureSink, QgsProcessingException, - QgsPoint + QgsPoint, + QgsPointXY ) from qgis.PyQt.QtCore import QVariant, QDateTime