Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply license BSD-3-Clause, and do some refactor #44

Merged
merged 5 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
702 changes: 28 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<img alt="the latest release version" src="https://img.shields.io/github/v/release/wenjiedu/tsdb?color=EE781F&include_prereleases&label=Release&logo=github&logoColor=white">
</a>
<a href="https://github.com/WenjieDu/TSDB/blob/main/LICENSE">
<img alt="GPL-v3 license" src="https://img.shields.io/badge/License-GPL--v3-E9BB41?logo=opensourceinitiative&logoColor=white">
<img alt="BSD-3 license" src="https://img.shields.io/badge/License-BSD--3-E9BB41?logo=opensourceinitiative&logoColor=white">
</a>
<a href='https://github.com/WenjieDu/TSDB/actions/workflows/testing_ci.yml'>
<img alt='GitHub Testing' src='https://img.shields.io/github/actions/workflow/status/wenjiedu/tsdb/testing_ci.yml?logo=github&color=C8D8E1&label=CI'>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Welcome to TSDB documentation!
.. image:: https://img.shields.io/github/v/release/wenjiedu/tsdb?color=EE781F&include_prereleases&label=Release&logo=github&logoColor=white
:alt: the latest release version
:target: https://img.shields.io/github/v/release/wenjiedu/tsdb?color=EE781F&include_prereleases&label=Release&logo=github&logoColor=white
.. image:: https://img.shields.io/badge/License-GPL--v3-E9BB41?logo=opensourceinitiative&logoColor=white
.. image:: https://img.shields.io/badge/License-BSD--3-E9BB41?logo=opensourceinitiative&logoColor=white
:alt: License
:target: https://github.com/WenjieDu/TSDB/blob/main/LICENSE
.. image:: https://img.shields.io/github/actions/workflow/status/wenjiedu/tsdb/testing_ci.yml?logo=github&color=C8D8E1&label=CI
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file stores some meta configurations for project PyPOTS.

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

[flake8]
# People may argue that coding style is personal. This may be true if the project is personal and one works like a
Expand Down
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
setup(
name="tsdb",
version=__version__,
description="TSDB (Time-Series DataBase): A Python Toolbox Helping Load Open-Source Time-Series Datasets",
description="TSDB (Time Series Data Beans): a Python toolbox helping load open-source time-series datasets",
long_description=README,
long_description_content_type="text/markdown",
license="GPL-3.0",
license="BSD-3-Clause",
author="Wenjie Du",
author_email="[email protected]",
url="https://github.com/WenjieDu/TSDB",
Expand All @@ -33,6 +33,13 @@
"imputation",
"classification",
"forecasting",
"partially observed",
"irregular sampled",
"partially-observed time series",
"incomplete time series",
"missing data",
"missing values",
"pypots",
],
packages=find_packages(exclude=["tests"]),
include_package_data=True,
Expand All @@ -48,7 +55,7 @@
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Database",
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause
9 changes: 2 additions & 7 deletions tests/test_tsdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os
import unittest
Expand All @@ -13,10 +13,6 @@
from tsdb.utils.logging import Logger

DATASETS_TO_TEST = [
"physionet_2012",
"physionet_2019",
"electricity_load_diagrams",
"beijing_multisite_air_quality",
"ucr_uea_Wine",
]

Expand Down Expand Up @@ -44,7 +40,7 @@ def test_2_dataset_loading(self):
def test_3_dataset_purging(self):
cached_datasets = tsdb.list_cache()
assert isinstance(cached_datasets, list)
tsdb.delete_cache("physionet_2012") # delete single
tsdb.delete_cache("ucr_uea_Wine") # delete single
tsdb.delete_cache() # delete all

def test_4_logging(self):
Expand Down Expand Up @@ -75,7 +71,6 @@ def test_4_logging(self):
# save log into file
self.logger_creator.set_saving_path("test_log", "testing.log")
assert os.path.exists("test_log/testing.log")
tsdb.purge_path("test_log/testing.log", ignore_errors=True)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion tsdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

# TSDB version
#
Expand Down
12 changes: 9 additions & 3 deletions tsdb/data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GPL-v3
# License: BSD-3-Clause

import os
import shutil
Expand Down Expand Up @@ -54,7 +54,7 @@ def load(dataset_name: str, use_cache: bool = True) -> dict:
"""
assert dataset_name in AVAILABLE_DATASETS, (
f'The given dataset name "{dataset_name}" is not in the database. '
f"Please fetch the full list of the available dataset_profiles with tsdb.list_available_datasets()"
f"Please fetch the full list of the available dataset_profiles with tsdb.list()"
)

profile_dir = dataset_name if "ucr_uea_" not in dataset_name else "ucr_uea_datasets"
Expand Down Expand Up @@ -103,11 +103,17 @@ def load(dataset_name: str, use_cache: bool = True) -> dict:
"ucr_uea_", ""
) # delete 'ucr_uea_' in the name
result = load_ucr_uea_dataset(dataset_saving_path, actual_dataset_name)
else:
raise NotImplementedError(
f"Dataset {dataset_name} is not supported yet. "
f"Please check the dataset name or contribute it to TSDB https://github.com/WenjieDu/TSDB/."
)

except FileExistsError:
shutil.rmtree(dataset_saving_path, ignore_errors=True)
warnings.warn(
"Dataset corrupted, already deleted. Please rerun load_specific_dataset() to re-download the raw data."
"Dataset corrupted. Just deleted it. "
"Please rerun the function tsdb.load(dataset_name) to re-download the raw data."
)
pickle_dump(result, cache_path)

Expand Down
2 changes: 1 addition & 1 deletion tsdb/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os

Expand Down
2 changes: 1 addition & 1 deletion tsdb/loading_funcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

from tsdb.loading_funcs.beijing_multisite_air_quality import (
load_beijing_air_quality,
Expand Down
2 changes: 1 addition & 1 deletion tsdb/loading_funcs/beijing_multisite_air_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os

Expand Down
5 changes: 1 addition & 4 deletions tsdb/loading_funcs/electricity_load_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os

Expand All @@ -32,9 +32,6 @@ def load_electricity(local_path):
file_path = os.path.join(local_path, "LD2011_2014.txt")
df = pd.read_csv(file_path, index_col=0, sep=";", decimal=",")
df.index = pd.to_datetime(df.index)
# feature_names = df.columns.tolist()
# feature_num = len(feature_names)
df["datetime"] = pd.to_datetime(df.index)
data = {
"X": df,
}
Expand Down
2 changes: 1 addition & 1 deletion tsdb/loading_funcs/physionet_2012.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os

Expand Down
2 changes: 1 addition & 1 deletion tsdb/loading_funcs/physionet_2019.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os

Expand Down
2 changes: 1 addition & 1 deletion tsdb/loading_funcs/ucr_uea_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os
import warnings
Expand Down
2 changes: 1 addition & 1 deletion tsdb/loading_funcs/vessel_ais.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Created by Grgičević Luka <[email protected]>
# Modified by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os
import time
Expand Down
2 changes: 1 addition & 1 deletion tsdb/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause
2 changes: 1 addition & 1 deletion tsdb/utils/downloading.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause

import os
import shutil
Expand Down
2 changes: 1 addition & 1 deletion tsdb/utils/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GLP-v3
# License: BSD-3-Clause


import os
Expand Down
2 changes: 1 addition & 1 deletion tsdb/utils/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

# Created by Wenjie Du <[email protected]>
# License: GPL-v3
# License: BSD-3

import logging
import os
Expand Down