ins-pricing 0.2.8__py3-none-any.whl → 0.3.0__py3-none-any.whl

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 (27) hide show
  1. ins_pricing/CHANGELOG.md +93 -0
  2. ins_pricing/README.md +11 -0
  3. ins_pricing/cli/bayesopt_entry_runner.py +626 -499
  4. ins_pricing/cli/utils/evaluation_context.py +320 -0
  5. ins_pricing/cli/utils/import_resolver.py +350 -0
  6. ins_pricing/modelling/core/bayesopt/PHASE2_REFACTORING_SUMMARY.md +449 -0
  7. ins_pricing/modelling/core/bayesopt/PHASE3_REFACTORING_SUMMARY.md +406 -0
  8. ins_pricing/modelling/core/bayesopt/REFACTORING_SUMMARY.md +247 -0
  9. ins_pricing/modelling/core/bayesopt/config_components.py +351 -0
  10. ins_pricing/modelling/core/bayesopt/config_preprocess.py +3 -4
  11. ins_pricing/modelling/core/bayesopt/core.py +153 -94
  12. ins_pricing/modelling/core/bayesopt/models/model_ft_trainer.py +118 -31
  13. ins_pricing/modelling/core/bayesopt/trainers/trainer_base.py +294 -139
  14. ins_pricing/modelling/core/bayesopt/utils/__init__.py +86 -0
  15. ins_pricing/modelling/core/bayesopt/utils/constants.py +183 -0
  16. ins_pricing/modelling/core/bayesopt/utils/distributed_utils.py +186 -0
  17. ins_pricing/modelling/core/bayesopt/utils/io_utils.py +126 -0
  18. ins_pricing/modelling/core/bayesopt/utils/metrics_and_devices.py +540 -0
  19. ins_pricing/modelling/core/bayesopt/utils/torch_trainer_mixin.py +587 -0
  20. ins_pricing/modelling/core/bayesopt/utils.py +98 -1495
  21. ins_pricing/modelling/core/bayesopt/utils_backup.py +1503 -0
  22. ins_pricing/setup.py +1 -1
  23. ins_pricing-0.3.0.dist-info/METADATA +162 -0
  24. {ins_pricing-0.2.8.dist-info → ins_pricing-0.3.0.dist-info}/RECORD +26 -13
  25. ins_pricing-0.2.8.dist-info/METADATA +0 -51
  26. {ins_pricing-0.2.8.dist-info → ins_pricing-0.3.0.dist-info}/WHEEL +0 -0
  27. {ins_pricing-0.2.8.dist-info → ins_pricing-0.3.0.dist-info}/top_level.txt +0 -0
ins_pricing/CHANGELOG.md CHANGED
@@ -5,6 +5,99 @@ All notable changes to the ins_pricing project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.11] - 2026-01-15
9
+
10
+ ### Changed
11
+
12
+ #### Refactoring Phase 3: Utils Module Consolidation
13
+ - **Eliminated code duplication** - Consolidated duplicated utility classes:
14
+ - `DeviceManager` and `GPUMemoryManager` now imported from `ins_pricing.utils`
15
+ - Removed 181 lines of duplicate code from `bayesopt/utils/metrics_and_devices.py`
16
+ - File size reduced from 721 to 540 lines (25% reduction)
17
+ - **Benefit**: Single source of truth for device management utilities
18
+ - **Impact**: Bug fixes now propagate automatically, no risk of code drift
19
+ - **Compatibility**: 100% backward compatible - all import patterns continue working
20
+
21
+ **Technical Details**:
22
+ - Package-level `ins_pricing/utils/device.py` is now the canonical implementation
23
+ - BayesOpt utils automatically re-export these classes for backward compatibility
24
+ - No breaking changes required in existing code
25
+
26
+ ## [0.2.10] - 2026-01-15
27
+
28
+ ### Added
29
+
30
+ #### Refactoring Phase 2: Simplified BayesOptModel API
31
+ - **BayesOptModel config-based initialization** - New recommended API using configuration objects:
32
+ - Added `config` parameter accepting `BayesOptConfig` instances
33
+ - **Before**: 56 individual parameters required
34
+ - **After**: Single config object parameter
35
+ - **Benefits**: Improved code clarity, reusability, type safety, and testability
36
+
37
+ ### Changed
38
+
39
+ #### API Improvements
40
+ - **BayesOptModel initialization** - Enhanced parameter handling:
41
+ - New API: `BayesOptModel(train_df, test_df, config=BayesOptConfig(...))`
42
+ - Old API still supported with deprecation warning
43
+ - Made `model_nme`, `resp_nme`, `weight_nme` optional (validated when config=None)
44
+ - Added type validation for config parameter
45
+ - Added helpful error messages for missing required parameters
46
+
47
+ ### Deprecated
48
+
49
+ - **BayesOptModel individual parameters** - Passing 56 individual parameters to `__init__`:
50
+ - Use `config=BayesOptConfig(...)` instead
51
+ - Old API will be removed in v0.4.0
52
+ - Migration guide: See `modelling/core/bayesopt/PHASE2_REFACTORING_SUMMARY.md`
53
+
54
+ ### Fixed
55
+
56
+ - **Type hints** - Improved type safety in BayesOptModel initialization
57
+ - **Documentation** - Added comprehensive examples of both old and new APIs
58
+
59
+ ## [0.2.9] - 2026-01-15
60
+
61
+ ### Added
62
+
63
+ #### Refactoring Phase 1: Utils Module Split
64
+ - **Modular utils package** - Split monolithic 1,503-line utils.py into focused modules:
65
+ - `utils/constants.py` (183 lines) - Core constants and simple helpers
66
+ - `utils/io_utils.py` (110 lines) - File I/O and parameter loading
67
+ - `utils/distributed_utils.py` (163 lines) - DDP and CUDA management
68
+ - `utils/torch_trainer_mixin.py` (587 lines) - PyTorch training infrastructure
69
+ - `utils/metrics_and_devices.py` (721 lines) - Metrics, GPU, device, CV, plotting
70
+ - `utils/__init__.py` (86 lines) - Backward compatibility re-exports
71
+
72
+ - **Upload automation** - Cross-platform PyPI upload scripts:
73
+ - `upload_to_pypi.sh` - Shell script for Linux/macOS with auto-version extraction
74
+ - `upload_to_pypi.bat` - Updated Windows batch script with auto-version extraction
75
+ - `Makefile` - Cross-platform build automation (build, check, upload, clean)
76
+ - `README_UPLOAD.md` - Comprehensive upload documentation in English
77
+ - `UPLOAD_QUICK_START.md` - Quick start guide for package publishing
78
+
79
+ ### Changed
80
+
81
+ #### Code Organization
82
+ - **utils module structure** - Improved maintainability and testability:
83
+ - Average file size reduced from 1,503 to 351 lines per module
84
+ - Each module has single responsibility
85
+ - Independent testing now possible for each component
86
+ - **Impact**: 100% backward compatibility maintained via re-exports
87
+
88
+ ### Deprecated
89
+
90
+ - **utils.py single file import** - Direct import from `bayesopt/utils.py`:
91
+ - Use `from .utils import ...` instead (package import)
92
+ - Old single-file import shows deprecation warning
93
+ - File will be removed in v0.4.0
94
+ - **Note**: All imports continue to work identically
95
+
96
+ ### Removed
97
+
98
+ - **verify_core_decoupling.py** - Obsolete test script for unimplemented refactoring
99
+ - Cleanup logged in `.cleanup_log.md`
100
+
8
101
  ## [0.2.8] - 2026-01-14
9
102
 
10
103
  ### Added
ins_pricing/README.md CHANGED
@@ -52,6 +52,17 @@ between modelling, production, governance, and reporting.
52
52
  - Geo plotting on basemap: `contextily`.
53
53
  - Plotting: `matplotlib`.
54
54
 
55
+ ## Multi-platform & GPU installation notes
56
+
57
+ - **Install PyTorch first**: Use the correct PyTorch build for your platform/GPU (CUDA/ROCm/MPS)
58
+ before installing the `bayesopt`, `explain`, or `gnn` extras. This avoids incompatible wheels.
59
+ - **GNN dependencies**: `torch-geometric` and its companion packages are platform-specific. Follow
60
+ the official PyG install guide for your CUDA/ROCm/CPU environment, then install
61
+ `ins_pricing[gnn]`.
62
+ - **Multi-GPU**: Training utilities will select CUDA/MPS/CPU automatically. Multi-GPU uses DDP or
63
+ DataParallel when supported; on Windows, CUDA DDP is disabled and will fall back to single-GPU or
64
+ DataParallel where available.
65
+
55
66
  ## Backward-compatible imports
56
67
 
57
68
  Legacy import paths continue to work: