Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
65a7b86
fix: change to no default arguments and add unit_name_column as a req…
lachlangrose Dec 1, 2025
5226b49
fix: set age based sorter args
lachlangrose Dec 1, 2025
6eb1518
fix: project import for test
lachlangrose Dec 1, 2025
b0f12b6
fix: updating requirements for alpha sorter plus add check for empty …
lachlangrose Dec 2, 2025
f2cf211
fix: update maximise contacts to compute length and check for empty c…
lachlangrose Dec 2, 2025
5fb0720
fix: add option to set logger level and handler.
lachlangrose Dec 15, 2025
71f473c
fix: updating incorrect type hints
lachlangrose Dec 15, 2025
a675be2
fix: adding safeguarding and fixing merge
lachlangrose Dec 15, 2025
17e14ca
fix: save location tracking as a line geodataframe for qgis compatibi…
lachlangrose Dec 16, 2025
46fade8
fix: only store geodataframe if layer is not empty
lachlangrose Dec 16, 2025
86b658c
fix: updating logic
lachlangrose Dec 16, 2025
6e2ee69
fix: beartype issues
lachlangrose Dec 17, 2025
92f754b
fix: add ability to specify fault field to topoloy
lachlangrose Dec 17, 2025
3c0e0e0
fix: add call methods to allow for generic debug exporting
lachlangrose Dec 18, 2025
e1cb1e6
fix: replace args for kwargs
lachlangrose Jan 18, 2026
48711c3
Enable auto-update for conda in workflow
lachlangrose Jan 19, 2026
4021640
fix: applying copilot suggestions
lachlangrose Jan 19, 2026
ec269dd
Merge branch 'fix/qgis-plugin-fixes' of github.com:Loop3D/map2loop in…
lachlangrose Jan 19, 2026
1febaa9
style: formatting
lachlangrose Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/linting_and_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ jobs:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
conda-remove-defaults: "true"

- name: Install dependencies for windows python 3.9 and 3.10
if: ${{ matrix.os == 'windows-latest' && (matrix.python-version == '3.9' || matrix.python-version == '3.10') }}
run: |
Expand Down Expand Up @@ -77,4 +76,4 @@ jobs:
- name: Run tests
run: |
conda run -n test pytest -v
conda run -n test pytest -v
50 changes: 50 additions & 0 deletions map2loop/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,53 @@ def set_level(level: str):
logger = logging.getLogger(name)
logger.setLevel(level)
logger.info(f"Logging level set to {level}")


logger = getLogger(__name__)
logger.info("Imported map2loop.logging module")


def setLogging(level="info", handler=None):
"""Set the logging parameters for log file or custom handler.

Parameters
----------
level : str, optional
Logging level to set, by default "info"
Valid options: 'info', 'warning', 'error', 'debug'
handler : logging.Handler, optional
A logging handler to use instead of the default StreamHandler, by default None

Examples
--------
>>> from map2loop.logging import setLogging
>>> setLogging('debug')
>>> setLogging('info', logging.FileHandler('loop.log'))
"""
levels = get_levels()
level_value = levels.get(level, logging.WARNING)

# Create default handler if none provided
if handler is None:
handler = logging.StreamHandler()

formatter = logging.Formatter(
"%(levelname)s: %(asctime)s: %(filename)s:%(lineno)d -- %(message)s"
)
handler.setFormatter(formatter)
handler.setLevel(level_value)

# Replace handlers in all known loggers
for name in loggers:
logger = logging.getLogger(name)
logger.handlers = []
logger.addHandler(handler)
logger.setLevel(level_value)

# Also apply to main module logger
main_logger = logging.getLogger(__name__)
main_logger.handlers = []
main_logger.addHandler(handler)
main_logger.setLevel(level_value)

main_logger.info(f"Set logging to {level}")
5 changes: 5 additions & 0 deletions map2loop/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,11 @@ def calculate_stratigraphic_order(self, take_best=False):
self.sorter.structure_data = self.map_data.get_map_data(Datatype.STRUCTURE)
if hasattr(self.sorter, 'dtm_data') and self.sorter.dtm_data is None:
self.sorter.dtm_data = self.map_data.get_map_data(Datatype.DTM)
if hasattr(self.sorter, 'min_age_column') and self.sorter.min_age_column is None:
self.sorter.min_age_column = self.stratigraphic_column.get_min_age_column()
if hasattr(self.sorter, 'max_age_column') and self.sorter.max_age_column is None:
self.sorter.max_age_column = self.stratigraphic_column.get_max_age_column()

self.stratigraphic_column.column = self.sorter.sort(
self.stratigraphic_column.stratigraphicUnits,
)
Expand Down
3 changes: 2 additions & 1 deletion map2loop/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def sample(
pandas.DataFrame: data frame containing samples
"""
pass

def __call__(self, **kwargs):
return self.sample(**kwargs)

class SamplerDecimator(Sampler):
"""
Expand Down
Loading
Loading