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.
Files changed (36) hide show
  1. pyasdreader-1.2.0/.pre-commit-config.yaml +43 -0
  2. pyasdreader-1.2.0/CHANGELOG.md +133 -0
  3. pyasdreader-1.2.0/LICENSE +21 -0
  4. pyasdreader-1.2.0/MANIFEST.in +50 -0
  5. pyasdreader-1.2.0/PKG-INFO +497 -0
  6. pyasdreader-1.2.0/README.md +414 -0
  7. pyasdreader-1.2.0/VERSION_MANAGEMENT.md +303 -0
  8. pyasdreader-1.2.0/examples/README.md +38 -0
  9. pyasdreader-1.2.0/examples/basic_usage.py +63 -0
  10. pyasdreader-1.2.0/pyASDReader.egg-info/SOURCES.txt +33 -0
  11. pyasdreader-1.2.0/pyproject.toml +144 -0
  12. pyasdreader-1.2.0/scripts/publish.sh +151 -0
  13. pyasdreader-1.2.0/setup.cfg +4 -0
  14. pyasdreader-1.2.0/src/__init__.py +41 -0
  15. pyasdreader-1.2.0/src/_version.py +12 -0
  16. pyasdreader-1.2.0/src/asd_file_reader.py +940 -0
  17. pyasdreader-1.2.0/src/constant.py +138 -0
  18. pyasdreader-1.2.0/src/file_attributes.py +113 -0
  19. pyasdreader-1.2.0/src/logger_setup.py +35 -0
  20. pyasdreader-1.2.0/tests/__init__.py +0 -0
  21. pyasdreader-1.2.0/tests/sample_data/v6sample/v6sample00000.asd +0 -0
  22. pyasdreader-1.2.0/tests/sample_data/v6sample/v6sample00001.asd +0 -0
  23. pyasdreader-1.2.0/tests/sample_data/v6sample/v6sample00002.asd +0 -0
  24. pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00000.asd +0 -0
  25. pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00001.asd +0 -0
  26. pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00002.asd +0 -0
  27. pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00003.asd +0 -0
  28. pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00004.asd +0 -0
  29. pyasdreader-1.2.0/tests/sample_data/v7sample/v7sample00005.asd +0 -0
  30. pyasdreader-1.2.0/tests/sample_data/v7sample_field_spectroscopy/44231B009-1-FW300000.asd +0 -0
  31. pyasdreader-1.2.0/tests/sample_data/v7sample_field_spectroscopy/44231B009-1-FW3R00000.asd +0 -0
  32. pyasdreader-1.2.0/tests/sample_data/v7sample_field_spectroscopy/44231B174-1-FF300000.asd +0 -0
  33. pyasdreader-1.2.0/tests/sample_data/v8sample/v8sample00001.asd +0 -0
  34. pyasdreader-1.2.0/tests/sample_data/v8sample/v8sample00002.asd +0 -0
  35. pyasdreader-1.2.0/tests/test_asd_file_reader.py +1302 -0
  36. 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
+ [![PyPI version](https://img.shields.io/pypi/v/pyASDReader.svg)](https://pypi.org/project/pyASDReader/)
4
+ [![Version](https://img.shields.io/badge/version-v1.1.0-blue.svg)](https://github.com/KaiTastic/pyASDReader/releases)
5
+ [![Semantic Versioning](https://img.shields.io/badge/semver-2.0.0-green.svg)](https://semver.org/spec/v2.0.0.html)
6
+ [![Keep a Changelog](https://img.shields.io/badge/changelog-Keep%20a%20Changelog-orange.svg)](https://keepachangelog.com/en/1.0.0/)
7
+ [![Latest Release](https://img.shields.io/github/v/release/KaiTastic/pyASDReader)](https://github.com/KaiTastic/pyASDReader/releases/latest)
8
+ [![Release Date](https://img.shields.io/github/release-date/KaiTastic/pyASDReader)](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