-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Complete overhaul from v0.1.9.0 to v0.1.11 Major Changes: - Complete overhaul of RawDataReader module with improved architecture - Migration from setup.py to pyproject.toml for modern Python packaging - Removal of deprecated AeroViz.process directory Features & Improvements: 1. RawDataReader Enhancements: - Improved file handling with proper resource management - Added robust error handling for missing data - Optimized data processing performance - Enhanced logging system with proper file closure - Updated data validation logic - Added support for new data formats - Set SMPS default size range (11.8, 593.5) - Added kwargs for customizable size range 2. Project Infrastructure: - Migrated to pyproject.toml for package configuration - Enhanced test coverage configuration and reporting - Optimized CI/CD pipeline - Updated GitHub Actions workflows for PyPI publishing - Centralized dependencies management - Improved package data handling 3. Visualization & Logging: - Enhanced progress bar visualization - Optimized ANSI support for Windows - Added new HYSPLIT plotting method - Improved VOC processing 4. Documentation: - Updated project documentation - Improved code syntax and structure - Added comprehensive test coverage documentation This release represents a significant upgrade focusing on performance, reliability, and maintainability of the AeroViz package.
- Loading branch information
1 parent
5bda1ad
commit ed7ed88
Showing
180 changed files
with
10,138 additions
and
9,419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# .github/workflows/cleanup.yml | ||
name: Repository Cleanup | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
action_type: | ||
description: '選擇要執行的操作' | ||
required: true | ||
type: choice | ||
options: | ||
- 'Cleanup Workflow' | ||
- 'Cleanup Deployments' | ||
workflow_status: | ||
description: '要清理的工作流程狀態 (僅在選擇 Cleanup Workflow 時需要)' | ||
required: false | ||
type: choice | ||
options: | ||
- 'disabled' # 已停用的工作流程 | ||
- 'active' # 活躍的工作流程 | ||
- 'all' # 所有工作流程 | ||
environment: | ||
description: '要清理的部署環境 (僅在選擇 Cleanup Deployments 時需要)' | ||
required: false | ||
type: choice | ||
options: | ||
- 'all' | ||
- 'github-pages' | ||
- 'pypi' | ||
|
||
jobs: | ||
cleanup-workflows: | ||
if: ${{ github.event.inputs.action_type == 'Cleanup Workflow' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: write | ||
steps: | ||
- name: Cleanup workflows | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
script: | | ||
const status = '${{ github.event.inputs.workflow_status }}'; | ||
console.log(`Cleaning up workflows with status: ${status}`); | ||
// 獲取所有工作流程 | ||
const workflows = await github.rest.actions.listRepoWorkflows({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo | ||
}); | ||
for (const workflow of workflows.data.workflows) { | ||
// 根據選擇的狀態過濾工作流程 | ||
if (status === 'all' || | ||
(status === 'disabled' && !workflow.state === 'active') || | ||
(status === 'active' && workflow.state === 'active')) { | ||
console.log(`Processing workflow: ${workflow.name} (${workflow.state})`); | ||
// 獲取此工作流程的所有運行 | ||
const runs = await github.rest.actions.listWorkflowRuns({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
workflow_id: workflow.id, | ||
}); | ||
// 刪除運行 | ||
console.log(`Found ${runs.data.total_count} runs to delete`); | ||
for (const run of runs.data.workflow_runs) { | ||
console.log(`Deleting run #${run.run_number} of ${workflow.name}`); | ||
await github.rest.actions.deleteWorkflowRun({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: run.id | ||
}); | ||
} | ||
} | ||
} | ||
console.log('Cleanup completed'); | ||
cleanup-deployments: | ||
if: ${{ github.event.inputs.action_type == 'Cleanup Deployments' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
deployments: write | ||
actions: write | ||
contents: write | ||
steps: | ||
- name: Delete github-pages deployments | ||
if: ${{ github.event.inputs.environment == 'github-pages' || github.event.inputs.environment == 'all' }} | ||
uses: strumwolf/delete-deployment-environment@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: github-pages | ||
onlyRemoveDeployments: true | ||
|
||
- name: Delete pypi deployments | ||
if: ${{ github.event.inputs.environment == 'pypi' || github.event.inputs.environment == 'all' }} | ||
uses: strumwolf/delete-deployment-environment@v3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: pypi | ||
onlyRemoveDeployments: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
name: Publish AeroViz | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build-and-test: | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11", "3.12" ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel build | ||
pip install -e . | ||
pip install -e ".[test]" | ||
- name: Run tests | ||
run: | | ||
pytest tests/ -m "not requires_data" | ||
- name: Verify package version matches tag | ||
run: | | ||
TAG_VERSION=${GITHUB_REF#refs/tags/v} | ||
PACKAGE_VERSION=$(python setup.py --version) | ||
if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then | ||
echo "Version mismatch:" | ||
echo " - Tag version: $TAG_VERSION" | ||
echo " - Package version: $PACKAGE_VERSION" | ||
exit 1 | ||
else | ||
echo "Version match: $TAG_VERSION" | ||
fi | ||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions-${{ matrix.python-version }} | ||
path: dist/ | ||
|
||
publish-test: | ||
needs: build-and-test | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: test-pypi | ||
url: https://test.pypi.org/p/AeroViz | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
# Download artifacts from Python 3.12 build only | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions-3.12 | ||
path: dist/ | ||
|
||
- name: Publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
publish-prod: | ||
needs: publish-test | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/AeroViz | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions-3.12 | ||
path: dist/ | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
github-release: | ||
name: Create GitHub Release | ||
needs: publish-prod | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions-3.12 | ||
path: dist/ | ||
|
||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "Release ${{ github.ref_name }}" | ||
- name: Upload artifacts to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Python Tests | ||
|
||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11", "3.12" ] | ||
os: [ ubuntu-latest ] | ||
|
||
fail-fast: false | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.XX | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'pip' # 啟用 pip 緩存加速安裝 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e . | ||
pip install -e ".[test]" | ||
- name: Run tests with coverage | ||
run: | | ||
pytest tests/ -m "not requires_data" \ | ||
--cov=AeroViz \ | ||
--cov-report=term-missing \ | ||
--cov-report=xml \ | ||
-v | ||
- name: Upload coverage reports | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-report-${{ matrix.python-version }}-${{ github.sha }} | ||
path: coverage.xml | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
# This file is used to import all the modules in the AeroViz package | ||
from AeroViz import plot | ||
from AeroViz.dataProcess import Optical, SizeDistr, Chemistry, VOC | ||
from AeroViz.dataProcess import DataProcess | ||
from AeroViz.rawDataReader import RawDataReader | ||
from AeroViz.tools import DataBase, DataReader, DataClassifier | ||
from AeroViz.tools import DataBase, DataClassifier | ||
|
||
__all__ = [ | ||
'plot', | ||
'RawDataReader', | ||
'Optical', 'SizeDistr', 'Chemistry', 'VOC', | ||
'DataBase', 'DataReader', 'DataClassifier' | ||
'plot', | ||
'RawDataReader', | ||
'DataProcess', | ||
'DataBase', | ||
'DataClassifier' | ||
] |
2 changes: 1 addition & 1 deletion
2
AeroViz/config/DEFAULT_DATA.csv → AeroViz/data/DEFAULT_DATA.csv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.