From a9ab8bc2e5cd40b35432e6b46b8ca6d6e12d6ff4 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Wed, 22 Jan 2025 15:56:56 +0100 Subject: [PATCH] remove temp file --- examples/use_cases/plot_employee_salaries.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/examples/use_cases/plot_employee_salaries.py b/examples/use_cases/plot_employee_salaries.py index d967de7f1..9d1696493 100644 --- a/examples/use_cases/plot_employee_salaries.py +++ b/examples/use_cases/plot_employee_salaries.py @@ -9,18 +9,9 @@ # %% # -# Creating and loading the skore project -# -------------------------------------- -# -# We start by creating a temporary directory to store our project so that we can easily -# clean it after executing this example. In addition, we set some environment variables -# to avoid some spurious warnings related to parallelism. +# We set some environment variables to avoid some spurious warnings related to +# parallelism. import os -import tempfile -from pathlib import Path - -temp_dir = tempfile.TemporaryDirectory(prefix="skore_example_") -temp_dir_path = Path(temp_dir.name) os.environ["POLARS_ALLOW_FORKING_THREAD"] = "1" os.environ["TOKENIZERS_PARALLELISM"] = "true" @@ -31,7 +22,7 @@ # experiments. import skore -project = skore.open(temp_dir_path / "my_project") +project = skore.open("my_project", create=True) # %% # @@ -296,4 +287,4 @@ def periodic_spline_transformer(period, n_splines=None, degree=3): # %% # # Finally, we clean up the project by removing the temporary directory. -temp_dir.cleanup() +project.clear()