From f0b6f9e8cb9260229a04388a30a9ce6691c22c46 Mon Sep 17 00:00:00 2001 From: Wenjie Du Date: Fri, 28 Jun 2024 00:06:58 +0800 Subject: [PATCH 1/3] feat: change the default data_home_path from ~/.tsdb to ~/.pypots/tsdb; --- tsdb/config.ini | 2 +- tsdb/utils/file.py | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/tsdb/config.ini b/tsdb/config.ini index d4f20cb..9a59bd7 100644 --- a/tsdb/config.ini +++ b/tsdb/config.ini @@ -1,2 +1,2 @@ [path] -data_home = ~/.tsdb +data_home = ~/.pypots/tsdb diff --git a/tsdb/utils/file.py b/tsdb/utils/file.py index 76b06af..2f2bd58 100644 --- a/tsdb/utils/file.py +++ b/tsdb/utils/file.py @@ -103,25 +103,33 @@ def determine_data_home(): data_home_path = config.get("path", "data_home") # replace '~' with the absolute path if existing in the path data_home_path = data_home_path.replace("~", os.path.expanduser("~")) - old_cached_dataset_dir = os.path.join( + + # old cached dataset dir path used in TSDB v0.2 + old_cached_dataset_dir_02 = os.path.join( os.path.expanduser("~"), ".tsdb_cached_datasets" ) + # old cached dataset dir path used in TSDB v0.4 + old_cached_dataset_dir_04 = os.path.join(os.path.expanduser("~"), ".tsdb") - if os.path.exists(old_cached_dataset_dir): - # use the old path and warn the user + if os.path.exists(old_cached_dataset_dir_02) or os.path.exists( + old_cached_dataset_dir_04 + ): logger.warning( - "‼️ Detected the home dir of the old version TSDB. " - "Since v0.3, TSDB has changed the default cache dir to '~/.tsdb'. " - "Auto migrating downloaded datasets to the new path. " + "‼️ Detected the home dir of the old version TSDB. Auto migrating... Please wait." ) cached_dataset_dir = data_home_path - migrate(old_cached_dataset_dir, cached_dataset_dir) + if os.path.exists(old_cached_dataset_dir_02): + migrate(old_cached_dataset_dir_02, cached_dataset_dir) + else: + migrate(old_cached_dataset_dir_04, cached_dataset_dir) + logger.info("🌟 Migrating finished.") elif os.path.exists(data_home_path): # use the path directly, may be in a portable disk cached_dataset_dir = data_home_path else: - # use the default path - default_path = os.path.join(os.path.expanduser("~"), ".tsdb") + # use the default path for initialization, + # e.g. `data_home_path` in a portable disk but the disk is not connected + default_path = os.path.join(os.path.expanduser("~"), ".pypots", "tsdb") cached_dataset_dir = default_path if os.path.abspath(data_home_path) != os.path.abspath(default_path): logger.warning( From 27dc619ed06b245abcf830a3f0c6424dd3be5659 Mon Sep 17 00:00:00 2001 From: Wenjie Du Date: Fri, 28 Jun 2024 00:16:02 +0800 Subject: [PATCH 2/3] docs: update docs; --- README.md | 7 ++++--- docs/index.rst | 25 +++++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 11f2854..51c5111 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,8 @@ tsdb.delete_cache(dataset_name='physionet_2012') # or you can delete all cache with delete_cached_data() to free disk space tsdb.delete_cache() -# to avoid taking up too much space if downloading many datasets, +# The default cache directory is ~/.pypots/tsdb under the user's home directory. +# To avoid taking up too much space if downloading many datasets , # TSDB cache directory can be migrated to an external disk tsdb.migrate_cache("/mnt/external_disk/TSDB_cache") ``` @@ -145,9 +146,9 @@ year={2023}, } ``` or -> Wenjie Du. (2023). +> Wenjie Du. > PyPOTS: a Python toolbox for data mining on Partially-Observed Time Series. -> arXiv, abs/2305.18811. https://arxiv.org/abs/2305.18811 +> arXiv, abs/2305.18811, 2023. diff --git a/docs/index.rst b/docs/index.rst index bc66a41..e8dce9c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -49,7 +49,7 @@ Welcome to TSDB documentation! .. image:: https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FWenjieDu%2FTime_Series_Database&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=Visits+since+April+2022&edge_flat=false :alt: Visit num -📣 TSDB now supports a total of 1️⃣6️⃣9️⃣ time-series datasets ‼️ +📣 TSDB now supports a total of 1️⃣7️⃣2️⃣ time-series datasets ‼️ .. image:: https://pypots.com/figs/pypots_logos/PyPOTS/logo_FFBG.svg :width: 120 @@ -100,12 +100,15 @@ or install from source code: tsdb.download_and_extract('physionet_2012', './save_it_here') # datasets you once loaded are cached, and you can check them with list_cached_data() tsdb.list_cache() - # you can delete only one specific dataset and preserve others + # you can delete only one specific dataset's pickled cache + tsdb.delete_cache(dataset_name='physionet_2012', only_pickle=True) + # you can delete only one specific dataset raw files and preserve others tsdb.delete_cache(dataset_name='physionet_2012') # or you can delete all cache with delete_cached_data() to free disk space tsdb.delete_cache() - # to avoid taking up too much space if downloading many datasets, + # The default cache directory is ~/.pypots/tsdb under the user's home directory. + # To avoid taking up too much space if downloading many datasets , # TSDB cache directory can be migrated to an external disk tsdb.migrate_cache("/mnt/external_disk/TSDB_cache") @@ -124,6 +127,8 @@ That's all. Simple and efficient. Enjoy it! 😃 `Electricity Load Diagrams `_ :cite:`trindade2015electricity` Forecasting, Imputation `Electricity Transformer Temperature (ETT) `_ :cite:`zhou2021informer` Forecasting, Imputation `Vessel AIS data `_ :cite:`grgicevic2023ais` Forecasting, Imputation, Classification + `PeMS Traffic `_ Forecasting, Imputation + `Solar Alabama `_ Forecasting, Imputation `UCR & UEA Datasets `_ (all 163 datasets) :cite:`bagnall2018uea` :cite:`dau2018ucr` Classification ========================================================================================================================================================================== ========================================== @@ -145,22 +150,18 @@ please cite it as below and 🌟star `PyPOTS repository Date: Fri, 28 Jun 2024 09:26:02 +0800 Subject: [PATCH 3/3] feat: release v0.5; --- tsdb/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsdb/__init__.py b/tsdb/__init__.py index 0e5c951..b105112 100644 --- a/tsdb/__init__.py +++ b/tsdb/__init__.py @@ -21,7 +21,7 @@ # # Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer. # 'X.Y.dev0' is the canonical version of 'X.Y.dev' -__version__ = "0.4" +__version__ = "0.5" from .data_processing import ( CACHED_DATASET_DIR,