pyASDReader 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyasdreader-1.2.0/.pre-commit-config.yaml +43 -0
- pyasdreader-1.2.0/CHANGELOG.md +133 -0
- pyasdreader-1.2.0/LICENSE +21 -0
- pyasdreader-1.2.0/MANIFEST.in +50 -0
- pyasdreader-1.2.0/PKG-INFO +497 -0
- pyasdreader-1.2.0/README.md +414 -0
- pyasdreader-1.2.0/VERSION_MANAGEMENT.md +303 -0
- pyasdreader-1.2.0/examples/README.md +38 -0
- pyasdreader-1.2.0/examples/basic_usage.py +63 -0
- pyasdreader-1.2.0/pyASDReader.egg-info/SOURCES.txt +33 -0
- pyasdreader-1.2.0/pyproject.toml +144 -0
- pyasdreader-1.2.0/scripts/publish.sh +151 -0
- pyasdreader-1.2.0/setup.cfg +4 -0
- pyasdreader-1.2.0/src/__init__.py +41 -0
- pyasdreader-1.2.0/src/_version.py +12 -0
- pyasdreader-1.2.0/src/asd_file_reader.py +940 -0
- pyasdreader-1.2.0/src/constant.py +138 -0
- pyasdreader-1.2.0/src/file_attributes.py +113 -0
- pyasdreader-1.2.0/src/logger_setup.py +35 -0
- pyasdreader-1.2.0/tests/__init__.py +0 -0
- pyasdreader-1.2.0/tests/sample_data/v6sample/v6sample00000.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v6sample/v6sample00001.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v6sample/v6sample00002.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00000.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00001.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00002.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00003.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00004.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00005.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample_field_spectroscopy/44231B009-1-FW300000.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample_field_spectroscopy/44231B009-1-FW3R00000.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v7sample_field_spectroscopy/44231B174-1-FF300000.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v8sample/v8sample00001.asd +0 -0
- pyasdreader-1.2.0/tests/sample_data/v8sample/v8sample00002.asd +0 -0
- pyasdreader-1.2.0/tests/test_asd_file_reader.py +1302 -0
- pyasdreader-1.2.0/tests/test_data.py +21 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Pre-commit hooks for pyASDReader project
|
|
2
|
+
# See https://pre-commit.com for more information
|
|
3
|
+
# Install: pip install pre-commit
|
|
4
|
+
# Setup: pre-commit install
|
|
5
|
+
# Run manually: pre-commit run --all-files
|
|
6
|
+
|
|
7
|
+
repos:
|
|
8
|
+
# General file checks
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v4.5.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
exclude: \.md$
|
|
14
|
+
- id: end-of-file-fixer
|
|
15
|
+
- id: check-yaml
|
|
16
|
+
- id: check-added-large-files
|
|
17
|
+
args: ['--maxkb=1000']
|
|
18
|
+
- id: check-merge-conflict
|
|
19
|
+
- id: check-toml
|
|
20
|
+
- id: mixed-line-ending
|
|
21
|
+
|
|
22
|
+
# Python code formatting
|
|
23
|
+
- repo: https://github.com/psf/black
|
|
24
|
+
rev: 23.12.1
|
|
25
|
+
hooks:
|
|
26
|
+
- id: black
|
|
27
|
+
language_version: python3
|
|
28
|
+
args: ['--line-length=120']
|
|
29
|
+
|
|
30
|
+
# Import sorting
|
|
31
|
+
- repo: https://github.com/PyCQA/isort
|
|
32
|
+
rev: 5.13.2
|
|
33
|
+
hooks:
|
|
34
|
+
- id: isort
|
|
35
|
+
args: ['--profile=black', '--line-length=120']
|
|
36
|
+
|
|
37
|
+
# Linting
|
|
38
|
+
- repo: https://github.com/PyCQA/flake8
|
|
39
|
+
rev: 7.0.0
|
|
40
|
+
hooks:
|
|
41
|
+
- id: flake8
|
|
42
|
+
args: ['--max-line-length=120', '--extend-ignore=E203,W503']
|
|
43
|
+
exclude: ^tests/
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Changelog - pyASDReader
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/pyASDReader/)
|
|
4
|
+
[](https://github.com/KaiTastic/pyASDReader/releases)
|
|
5
|
+
[](https://semver.org/spec/v2.0.0.html)
|
|
6
|
+
[](https://keepachangelog.com/en/1.0.0/)
|
|
7
|
+
[](https://github.com/KaiTastic/pyASDReader/releases/latest)
|
|
8
|
+
[](https://github.com/KaiTastic/pyASDReader/releases)
|
|
9
|
+
|
|
10
|
+
All notable changes to this project will be documented in this file.
|
|
11
|
+
|
|
12
|
+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and the format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
13
|
+
|
|
14
|
+
## [Unreleased]
|
|
15
|
+
|
|
16
|
+
## [1.1.0] - 2025-10-05
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
- ๐ด **Critical**: Removed broken root `__init__.py` that caused ModuleNotFoundError
|
|
20
|
+
- ๐ด **Critical**: Fixed pyproject.toml package configuration for proper pip installation
|
|
21
|
+
- ๐ด **Critical**: Unified version management (removed conflicting version definitions)
|
|
22
|
+
- ๐ด **Critical**: Fixed GitHub Actions branch configuration (now triggers on main branch)
|
|
23
|
+
- ๐ด **Critical**: Removed conflicting setup.py (now using only pyproject.toml)
|
|
24
|
+
- ๐ด Fixed binary flag error in SWIR2_TEC_ALARM detection (0x16 โ 0x10)
|
|
25
|
+
- ๐ Fixed read() method to properly return False on file errors
|
|
26
|
+
- โ ๏ธ Fixed logger undefined error by adding module-level logger
|
|
27
|
+
- โ ๏ธ Added Python 3.8 compatibility with `from __future__ import annotations`
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- ๐ **Repository renamed** from `ASD_File_Reader` to `pyASDReader` for consistency with PyPI package name
|
|
31
|
+
- ๐ฆ **PyPI package name**: `pyASDReader` (install: `pip install pyASDReader`)
|
|
32
|
+
- ๐ **New repository URL**: https://github.com/KaiTastic/pyASDReader
|
|
33
|
+
- โน๏ธ **Module import**: `from pyASDReader import ASDFile` (improved package exports)
|
|
34
|
+
- ๐งช GitHub Actions now tests stable Python versions only (3.8-3.12, removed 3.13 and 3.x)
|
|
35
|
+
- ๐งช Removed `continue-on-error` from CI to properly report test failures
|
|
36
|
+
- ๐ Test matrix reduced from 21 to 15 combinations for better stability
|
|
37
|
+
- Modernized dependency management: moved all dependencies to pyproject.toml optional-dependencies
|
|
38
|
+
- Updated all CI/CD workflows to use `pip install -e ".[dev]"` instead of requirements files
|
|
39
|
+
- Enhanced README with Development Installation section
|
|
40
|
+
- Standardized version number to 1.1.0 across all configuration files
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- โจ Automatic version management using setuptools-scm
|
|
44
|
+
- ๐ค Dual GitHub Actions workflows: dev branch โ TestPyPI, tag โ PyPI
|
|
45
|
+
- ๐ Comprehensive documentation for version management and publishing
|
|
46
|
+
- ๐ CLAUDE.md - Guide for Claude Code integration
|
|
47
|
+
- ๐ VERSION_MANAGEMENT.md - Complete guide for version management with Git tags and setuptools_scm
|
|
48
|
+
- ๐ SECURITY.md - Security policy and vulnerability reporting guidelines
|
|
49
|
+
- ๐ PROJECT_IMPROVEMENT_ANALYSIS.md - Detailed analysis of 26 issues
|
|
50
|
+
- ๐ FIXES_APPLIED.md - First round fix summary
|
|
51
|
+
- ๐ ADDITIONAL_IMPROVEMENTS.md - Second round analysis of 15 issues
|
|
52
|
+
- ๐ ROUND2_FIXES_APPLIED.md - Second round fix summary
|
|
53
|
+
- โ
Support for auto-loading files: `ASDFile(filepath)` constructor
|
|
54
|
+
- Added examples/ directory with basic usage examples
|
|
55
|
+
- Enhanced project URLs in pyproject.toml (Issues, Source, Changelog, PyPI)
|
|
56
|
+
- Comprehensive optional-dependencies groups: dev, docs, all
|
|
57
|
+
|
|
58
|
+
### Removed
|
|
59
|
+
- โ Deleted conflicting `setup.py`
|
|
60
|
+
- โ Deleted broken root `__init__.py`
|
|
61
|
+
- โ Deleted requirements.txt (moved to pyproject.toml)
|
|
62
|
+
- โ Deleted requirements-dev.txt (moved to pyproject.toml)
|
|
63
|
+
- โ Removed duplicate v1.0.0 git tag
|
|
64
|
+
|
|
65
|
+
### Note
|
|
66
|
+
- Old repository URLs will redirect automatically
|
|
67
|
+
- No breaking changes for existing users - all fixes are backward compatible
|
|
68
|
+
- Package is now fully functional (fixed from "broken" state)
|
|
69
|
+
- Version management now uses Git tags as single source of truth
|
|
70
|
+
|
|
71
|
+
## [1.0.1] - 2025-08-29
|
|
72
|
+
|
|
73
|
+
### Added
|
|
74
|
+
|
|
75
|
+
- Enhanced README documentation with compatibility testing details
|
|
76
|
+
- Improved GitHub Actions CI/CD workflow with multi-platform testing
|
|
77
|
+
- Extended Python version support (3.8-3.13)
|
|
78
|
+
- Code quality improvements and linting integration (flake8)
|
|
79
|
+
- Comprehensive badge system showing CI status, version, Python compatibility, and license
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
|
|
83
|
+
- Updated documentation structure and clarity
|
|
84
|
+
- Improved project organization and maintainability
|
|
85
|
+
- Enhanced cross-platform compatibility testing
|
|
86
|
+
|
|
87
|
+
### Fixed
|
|
88
|
+
|
|
89
|
+
- Minor documentation formatting issues
|
|
90
|
+
- CI/CD pipeline optimizations
|
|
91
|
+
|
|
92
|
+
## [1.0.0] - 2025-03-12
|
|
93
|
+
|
|
94
|
+
### Added
|
|
95
|
+
|
|
96
|
+
- Initial release with full ASD file format support (versions 1-8)
|
|
97
|
+
- Comprehensive parsing capabilities for all ASD file structures:
|
|
98
|
+
- Spectrum File Header and metadata
|
|
99
|
+
- Spectrum Data parsing
|
|
100
|
+
- Reference File Header and Reference Data
|
|
101
|
+
- Classifier Data support
|
|
102
|
+
- Dependent Variables handling
|
|
103
|
+
- Calibration Header and calibration series data
|
|
104
|
+
- Audit Log parsing
|
|
105
|
+
- Digital signature support
|
|
106
|
+
- Benchmark testing against ASD ViewSpecPro 6.2.0 for accuracy validation
|
|
107
|
+
- Support for multiple ASD instrument types:
|
|
108
|
+
- ASD AgriSpec, FieldSpec series, HandHeld 2, LabSpec series, TerraSpec series
|
|
109
|
+
- Spectral data processing capabilities:
|
|
110
|
+
- Digital number extraction
|
|
111
|
+
- Reflectance calculations (with derivatives)
|
|
112
|
+
- Absolute reflectance
|
|
113
|
+
- log(1/R) calculations
|
|
114
|
+
- Transmittance support
|
|
115
|
+
- Comprehensive unit test suite
|
|
116
|
+
- MIT License
|
|
117
|
+
- Python package structure with setuptools support
|
|
118
|
+
|
|
119
|
+
### Features
|
|
120
|
+
|
|
121
|
+
- **File Format Compatibility**: Complete support for ASD file format versions 1 through 8
|
|
122
|
+
- **Multi-instrument Support**: Works with all major ASD spectroradiometer models
|
|
123
|
+
- **Data Extraction**: Full access to all data blocks within ASD files
|
|
124
|
+
- **Calculation Support**: Built-in spectral calculations and transformations
|
|
125
|
+
- **Validation**: Benchmark-tested against official ASD software
|
|
126
|
+
|
|
127
|
+
## Upcoming Features
|
|
128
|
+
|
|
129
|
+
- [ ] Spectral discontinuities correction (Hueni & ASD Parabolic methods)
|
|
130
|
+
- [ ] File format converter (ASCII export functionality)
|
|
131
|
+
- [ ] Enhanced radiometric and statistical tools
|
|
132
|
+
- [ ] Extended instrument support and metadata extraction
|
|
133
|
+
- [ ] PyPI package distribution
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Kai Cao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# MANIFEST.in - Include additional files in source distribution
|
|
2
|
+
|
|
3
|
+
# Documentation
|
|
4
|
+
include README.md
|
|
5
|
+
include LICENSE
|
|
6
|
+
include CHANGELOG.md
|
|
7
|
+
include SECURITY.md
|
|
8
|
+
|
|
9
|
+
# Configuration files
|
|
10
|
+
include pyproject.toml
|
|
11
|
+
|
|
12
|
+
# Source code and data files
|
|
13
|
+
recursive-include src *.py
|
|
14
|
+
recursive-include src *.mat
|
|
15
|
+
|
|
16
|
+
# Tests (optional - include if you want tests in sdist)
|
|
17
|
+
recursive-include tests *.py
|
|
18
|
+
recursive-include tests/sample_data *.asd
|
|
19
|
+
|
|
20
|
+
# Exclude unwanted files
|
|
21
|
+
recursive-exclude * __pycache__
|
|
22
|
+
recursive-exclude * *.py[co]
|
|
23
|
+
recursive-exclude * .DS_Store
|
|
24
|
+
recursive-exclude * *.swp
|
|
25
|
+
recursive-exclude * *~
|
|
26
|
+
|
|
27
|
+
# Exclude build artifacts
|
|
28
|
+
exclude .gitignore
|
|
29
|
+
exclude .coverage
|
|
30
|
+
exclude htmlcov
|
|
31
|
+
prune build
|
|
32
|
+
prune dist
|
|
33
|
+
prune *.egg-info
|
|
34
|
+
prune .pytest_cache
|
|
35
|
+
prune .tox
|
|
36
|
+
prune .venv
|
|
37
|
+
prune venv
|
|
38
|
+
prune env
|
|
39
|
+
|
|
40
|
+
# Exclude analysis and documentation files (they're in git but not needed in package)
|
|
41
|
+
exclude PROJECT_IMPROVEMENT_ANALYSIS.md
|
|
42
|
+
exclude ADDITIONAL_IMPROVEMENTS.md
|
|
43
|
+
exclude FIXES_APPLIED.md
|
|
44
|
+
exclude ROUND2_FIXES_APPLIED.md
|
|
45
|
+
exclude CLAUDE.md
|
|
46
|
+
|
|
47
|
+
# Exclude workflow and IDE files
|
|
48
|
+
prune .github
|
|
49
|
+
prune .vscode
|
|
50
|
+
prune .idea
|