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

Adding KeyboardInterrupt handler for downloading process, and updating workflows #22

Merged
merged 3 commits into from
Jul 28, 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
31 changes: 29 additions & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
name: Autoreply to Issues Opened for TSDB

on: [issues]
on:
issues:
types: [opened]
pull_request:
branches: [main]
types: [opened]

jobs:
greeting:
runs-on: ubuntu-latest

permissions:
pull-requests: write
issues: write

steps:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.ACCESS_TOKEN }}
issue-message: "Hi there,<br><br>Thank you so much for your attention to TSDB! If you find TSDB helpful to your work, please star⭐️ this repository. Your star is your recognition, which can help more people notice TSDB this useful tool. It matters and is definitely a kind of contribution.<br><br>I have received your message and will respond ASAP. Thank you for your patience! 😃<br><br>Best,<br>Wenjie"
issue-message: |
Hi there 👋,

Thank you so much for your attention to TSDB! You can follow me on GitHub to receive the latest news of TSDB. If you find TSDB helpful to your work, please star⭐️ this repository. Your star is your recognition, which can help more people notice TSDB. It matters and is definitely a kind of contribution to the PyPOTS community.

I have received your message and will respond ASAP. Thank you for your patience! 😃

Best,
Wenjie

pr-message: |
Hi there 👋,

We really really appreciate that you have taken the time to make this PR on TSDB!

If you are trying to fix a bug, please reference the issue number in the description or give your details about the bug.
If you are implementing a feature request, please check with the maintainers that the feature will be accepted first.

Best,
Wenjie
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_PyPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
python -m build

- name: Publish the new package to PyPI
uses: pypa/gh-action-pypi-publish@v1.7.1
uses: pypa/gh-action-pypi-publish@v1.8.7
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v4.0.0
- uses: actions/stale@v8
with:
stale-issue-message: 'This issue had no activity for **30 days**. It will be closed in **2 weeks** unless there is some new activity. Is this issue already resolved?'
stale-issue-label: 'stale'
Expand Down
9 changes: 8 additions & 1 deletion tsdb/data_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,15 @@ def _download_and_extract(url, saving_path):
# except Exception as e:
except Exception as e:
shutil.rmtree(saving_path, ignore_errors=True)
shutil.rmtree(raw_data_saving_path, ignore_errors=True)
print(f"Exception: {e}\n" f"Download failed. Aborting.")
sys.exit()
raise
except KeyboardInterrupt:
shutil.rmtree(saving_path, ignore_errors=True)
shutil.rmtree(raw_data_saving_path, ignore_errors=True)
print("Download cancelled by the user.")
raise

print(f"Successfully downloaded data to {raw_data_saving_path}.")

if (
Expand Down
Loading