From b2171736d66c1b413e1d36cfe513dd35d9173ce6 Mon Sep 17 00:00:00 2001 From: Ignacio Vizzo Date: Fri, 1 Mar 2024 11:17:48 +0100 Subject: [PATCH] Prepend `kiss_icp_` for env variable usage (#286) * Prepend `kiss_icp_` for env variable usage Before this didn't work ``` export DATA=carlos kiss_icp_pipeline ... ``` After, you need to be more explicit to break it: ``` export KISS_ICP_DATA=carlos kiss_icp_pipeline ... ``` This allow us to mantain the API as well * Add to help --------- Co-authored-by: Benedikt Mersch --- python/kiss_icp/config/parser.py | 3 ++- python/kiss_icp/tools/cmd.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/kiss_icp/config/parser.py b/python/kiss_icp/config/parser.py index 5f2b58ec..831f3039 100644 --- a/python/kiss_icp/config/parser.py +++ b/python/kiss_icp/config/parser.py @@ -28,12 +28,13 @@ from pathlib import Path from typing import Any, Dict, Optional -from pydantic_settings import BaseSettings +from pydantic_settings import BaseSettings, SettingsConfigDict from kiss_icp.config.config import AdaptiveThresholdConfig, DataConfig, MappingConfig class KISSConfig(BaseSettings): + model_config = SettingsConfigDict(env_prefix="kiss_icp_") out_dir: str = "results" data: DataConfig = DataConfig() mapping: MappingConfig = MappingConfig() diff --git a/python/kiss_icp/tools/cmd.py b/python/kiss_icp/tools/cmd.py index 87f94bd9..5ae7369e 100644 --- a/python/kiss_icp/tools/cmd.py +++ b/python/kiss_icp/tools/cmd.py @@ -114,6 +114,10 @@ def name_callback(value: str): # Use a more specific dataloader: {", ".join(_available_dl_help)} $ kiss_icp_pipeline --dataloader kitti --sequence 07 --visualize :open_file_folder: + +# To change single config parameters on-the-fly, you can export them beforehand: +$ export kiss_icp_out_dir=':open_file_folder:' +$ export kiss_icp_data='{{"max_range": 50}}' """