feat: replace hard-coded cache paths with dynamic cache_path config (#952)

* feat: replace hard-coded cache paths with dynamic cache_path config

* style: reorder wait_retry import and format chmod list

* refactor: pass workspace_path to chmod command and use DockerConf check
This commit is contained in:
you-n-g
2025-06-12 17:44:31 +08:00
committed by GitHub
parent 698f89e07c
commit 2187081905
5 changed files with 28 additions and 9 deletions
@@ -46,10 +46,10 @@ feature_coder:
5. You should use the following cache decorator to cache the results of the function:
```python
from joblib import Memory
memory = Memory(location='./cache', verbose=0)
memory = Memory(location='{% include "scenarios.data_science.share:scen.cache_path" %}', verbose=0)
@memory.cache```
6. Coding tricks:
- If the input consists of a batch of file paths and you need to modify the file contents to complete your feature engineering task, you can accomplish your feature engineering task by modifying these files and creating new files in a subfolder within "./cache" (this path is persistent, otherwise you may lose your created file). Then the new file paths are returned.
- If the input consists of a batch of file paths and you need to modify the file contents to complete your feature engineering task, you can accomplish your feature engineering task by modifying these files and creating new files in a subfolder within "{% include "scenarios.data_science.share:scen.cache_path" %}" (this path is persistent, otherwise you may lose your created file). Then the new file paths are returned.
{% include "scenarios.data_science.share:guidelines.coding" %}
@@ -43,7 +43,7 @@ model_coder:
4. You should use the following cache decorator to cache the results of the function:
```python
from joblib import Memory
memory = Memory(location='./cache', verbose=0)
memory = Memory(location='{% include "scenarios.data_science.share:scen.cache_path" %}', verbose=0)
@memory.cache``
{% include "scenarios.data_science.share:guidelines.coding" %}
@@ -273,7 +273,7 @@ data_loader_coder:
3. You should use the following cache decorator to cache the results of the function:
```python
from joblib import Memory
memory = Memory(location='./cache', verbose=0)
memory = Memory(location='{% include "scenarios.data_science.share:scen.cache_path" %}', verbose=0)
@memory.cache```
{% include "scenarios.data_science.share:guidelines.coding" %}