raain-model 2.6.7 → 2.6.10
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.
- package/.cursorignore +10 -0
- package/.github/workflows/ci.yml +29 -0
- package/CHANGELOG.md +166 -0
- package/LICENSE +21 -0
- package/README.md +90 -9
- package/RELEASE_PROCESS.md +111 -0
- package/package.json +10 -8
- package/specs/REQUIREMENTS.md +42 -0
- package/specs/TECHNICAL.md +57 -0
- package/specs/cartesian/Cartesian.spec.ts +82 -0
- package/specs/cartesian/CartesianTools.spec.ts +121 -0
- package/specs/gauge/Gauge.spec.ts +39 -0
- package/specs/organization/Organization.spec.ts +38 -0
- package/specs/polar/Polar.spec.ts +267 -0
- package/specs/quality/Position.spec.ts +18 -0
- package/specs/quality/QualityPointEdgeCases.spec.ts +215 -0
- package/specs/quality/QualityTools.spec.ts +67 -0
- package/specs/quality/SpeedMatrix.spec.ts +214 -0
- package/specs/radar/Radar.spec.ts +129 -0
- package/specs/rain/Rain.spec.ts +334 -0
- package/specs/tsconfig.json +12 -0
- package/{cartesian/CartesianMeasureValue.js → src/cartesian/CartesianMeasureValue.ts} +73 -41
- package/{cartesian/CartesianTools.js → src/cartesian/CartesianTools.ts} +130 -69
- package/src/cartesian/CartesianValue.ts +26 -0
- package/src/cartesian/EarthMap.ts +5 -0
- package/src/cartesian/ICartesianMeasureValue.ts +22 -0
- package/src/cartesian/LatLng.ts +43 -0
- package/src/cartesian/RadarCartesianMeasureValue.ts +32 -0
- package/src/cartesian/RainCartesianMeasureValue.ts +32 -0
- package/src/gauge/GaugeMeasure.ts +42 -0
- package/src/gauge/GaugeNode.ts +133 -0
- package/src/gauge/GaugeNodeMap.ts +55 -0
- package/src/organization/EventNode.ts +43 -0
- package/{organization/Link.js → src/organization/Link.ts} +17 -14
- package/src/organization/Measure.ts +61 -0
- package/{organization/PeopleNode.js → src/organization/PeopleNode.ts} +20 -10
- package/src/organization/RaainNode.ts +205 -0
- package/src/organization/TeamNode.ts +91 -0
- package/{polar/AbstractPolarMeasureValue.js → src/polar/AbstractPolarMeasureValue.ts} +58 -32
- package/src/polar/IPolarMeasureValue.ts +21 -0
- package/{polar/MeasureValuePolarContainer.js → src/polar/MeasureValuePolarContainer.ts} +29 -13
- package/src/polar/PolarFilter.ts +46 -0
- package/{polar/PolarMeasureValue.js → src/polar/PolarMeasureValue.ts} +125 -62
- package/{polar/PolarMeasureValueMap.js → src/polar/PolarMeasureValueMap.ts} +165 -88
- package/src/polar/PolarValue.ts +16 -0
- package/{polar/RadarPolarMeasureValue.js → src/polar/RadarPolarMeasureValue.ts} +34 -21
- package/src/polar/RainPolarMeasureValue.ts +57 -0
- package/{quality/QualityPoint.js → src/quality/QualityPoint.ts} +62 -34
- package/{quality/SpeedMatrix.js → src/quality/SpeedMatrix.ts} +117 -76
- package/{quality/SpeedMatrixContainer.js → src/quality/SpeedMatrixContainer.ts} +210 -103
- package/src/quality/history/CartesianGaugeHistory.ts +23 -0
- package/src/quality/history/CartesianRainHistory.ts +15 -0
- package/src/quality/history/PositionHistory.ts +31 -0
- package/{quality/index.d.ts → src/quality/index.ts} +3 -0
- package/src/quality/position/Position.ts +59 -0
- package/src/quality/position/PositionValue.ts +15 -0
- package/{quality/tools/QualityTools.js → src/quality/tools/QualityTools.ts} +18 -17
- package/src/radar/RadarMeasure.ts +41 -0
- package/{radar/RadarNode.js → src/radar/RadarNode.ts} +41 -19
- package/src/radar/RadarNodeMap.ts +61 -0
- package/src/rain/MergeStrategy.ts +15 -0
- package/src/rain/RainComputation.ts +96 -0
- package/{rain/RainComputationAbstract.js → src/rain/RainComputationAbstract.ts} +135 -69
- package/src/rain/RainComputationMap.ts +139 -0
- package/{rain/RainComputationQuality.js → src/rain/RainComputationQuality.ts} +82 -44
- package/src/rain/RainMeasure.ts +25 -0
- package/{rain/RainNode.js → src/rain/RainNode.ts} +117 -72
- package/tsconfig.json +17 -0
- package/tslint.json +79 -0
- package/typedoc.json +31 -0
- package/cartesian/CartesianMeasureValue.d.ts +0 -40
- package/cartesian/CartesianMeasureValue.js.map +0 -1
- package/cartesian/CartesianTools.d.ts +0 -32
- package/cartesian/CartesianTools.js.map +0 -1
- package/cartesian/CartesianValue.d.ts +0 -14
- package/cartesian/CartesianValue.js +0 -17
- package/cartesian/CartesianValue.js.map +0 -1
- package/cartesian/EarthMap.d.ts +0 -5
- package/cartesian/EarthMap.js +0 -3
- package/cartesian/EarthMap.js.map +0 -1
- package/cartesian/ICartesianMeasureValue.d.ts +0 -23
- package/cartesian/ICartesianMeasureValue.js +0 -3
- package/cartesian/ICartesianMeasureValue.js.map +0 -1
- package/cartesian/LatLng.d.ts +0 -16
- package/cartesian/LatLng.js +0 -34
- package/cartesian/LatLng.js.map +0 -1
- package/cartesian/RadarCartesianMeasureValue.d.ts +0 -17
- package/cartesian/RadarCartesianMeasureValue.js +0 -22
- package/cartesian/RadarCartesianMeasureValue.js.map +0 -1
- package/cartesian/RainCartesianMeasureValue.d.ts +0 -17
- package/cartesian/RainCartesianMeasureValue.js +0 -23
- package/cartesian/RainCartesianMeasureValue.js.map +0 -1
- package/cartesian/index.js +0 -25
- package/cartesian/index.js.map +0 -1
- package/gauge/GaugeMeasure.d.ts +0 -20
- package/gauge/GaugeMeasure.js +0 -30
- package/gauge/GaugeMeasure.js.map +0 -1
- package/gauge/GaugeNode.d.ts +0 -28
- package/gauge/GaugeNode.js +0 -54
- package/gauge/GaugeNode.js.map +0 -1
- package/gauge/GaugeNodeMap.d.ts +0 -24
- package/gauge/GaugeNodeMap.js +0 -40
- package/gauge/GaugeNodeMap.js.map +0 -1
- package/gauge/index.js +0 -20
- package/gauge/index.js.map +0 -1
- package/index.js +0 -24
- package/index.js.map +0 -1
- package/organization/EventNode.d.ts +0 -22
- package/organization/EventNode.js +0 -30
- package/organization/EventNode.js.map +0 -1
- package/organization/IVersion.js +0 -3
- package/organization/IVersion.js.map +0 -1
- package/organization/Link.d.ts +0 -16
- package/organization/Link.js.map +0 -1
- package/organization/Measure.d.ts +0 -22
- package/organization/Measure.js +0 -45
- package/organization/Measure.js.map +0 -1
- package/organization/PeopleNode.d.ts +0 -18
- package/organization/PeopleNode.js.map +0 -1
- package/organization/RaainNode.d.ts +0 -24
- package/organization/RaainNode.js +0 -109
- package/organization/RaainNode.js.map +0 -1
- package/organization/TeamNode.d.ts +0 -22
- package/organization/TeamNode.js +0 -32
- package/organization/TeamNode.js.map +0 -1
- package/organization/index.js +0 -24
- package/organization/index.js.map +0 -1
- package/polar/AbstractPolarMeasureValue.d.ts +0 -29
- package/polar/AbstractPolarMeasureValue.js.map +0 -1
- package/polar/IPolarMeasureValue.d.ts +0 -19
- package/polar/IPolarMeasureValue.js +0 -3
- package/polar/IPolarMeasureValue.js.map +0 -1
- package/polar/MeasureValuePolarContainer.d.ts +0 -19
- package/polar/MeasureValuePolarContainer.js.map +0 -1
- package/polar/PolarFilter.d.ts +0 -16
- package/polar/PolarFilter.js +0 -45
- package/polar/PolarFilter.js.map +0 -1
- package/polar/PolarMeasureValue.d.ts +0 -51
- package/polar/PolarMeasureValue.js.map +0 -1
- package/polar/PolarMeasureValueMap.d.ts +0 -45
- package/polar/PolarMeasureValueMap.js.map +0 -1
- package/polar/PolarValue.d.ts +0 -10
- package/polar/PolarValue.js +0 -12
- package/polar/PolarValue.js.map +0 -1
- package/polar/RadarPolarMeasureValue.d.ts +0 -27
- package/polar/RadarPolarMeasureValue.js.map +0 -1
- package/polar/RainPolarMeasureValue.d.ts +0 -20
- package/polar/RainPolarMeasureValue.js +0 -42
- package/polar/RainPolarMeasureValue.js.map +0 -1
- package/polar/index.js +0 -25
- package/polar/index.js.map +0 -1
- package/quality/QualityPoint.d.ts +0 -37
- package/quality/QualityPoint.js.map +0 -1
- package/quality/SpeedMatrix.d.ts +0 -83
- package/quality/SpeedMatrix.js.map +0 -1
- package/quality/SpeedMatrixContainer.d.ts +0 -102
- package/quality/SpeedMatrixContainer.js.map +0 -1
- package/quality/history/CartesianGaugeHistory.d.ts +0 -15
- package/quality/history/CartesianGaugeHistory.js +0 -14
- package/quality/history/CartesianGaugeHistory.js.map +0 -1
- package/quality/history/CartesianRainHistory.d.ts +0 -9
- package/quality/history/CartesianRainHistory.js +0 -11
- package/quality/history/CartesianRainHistory.js.map +0 -1
- package/quality/history/PositionHistory.d.ts +0 -20
- package/quality/history/PositionHistory.js +0 -17
- package/quality/history/PositionHistory.js.map +0 -1
- package/quality/index.js +0 -26
- package/quality/index.js.map +0 -1
- package/quality/position/Position.d.ts +0 -22
- package/quality/position/Position.js +0 -50
- package/quality/position/Position.js.map +0 -1
- package/quality/position/PositionValue.d.ts +0 -9
- package/quality/position/PositionValue.js +0 -12
- package/quality/position/PositionValue.js.map +0 -1
- package/quality/tools/QualityTools.d.ts +0 -9
- package/quality/tools/QualityTools.js.map +0 -1
- package/radar/RadarMeasure.d.ts +0 -19
- package/radar/RadarMeasure.js +0 -30
- package/radar/RadarMeasure.js.map +0 -1
- package/radar/RadarNode.d.ts +0 -30
- package/radar/RadarNode.js.map +0 -1
- package/radar/RadarNodeMap.d.ts +0 -26
- package/radar/RadarNodeMap.js +0 -44
- package/radar/RadarNodeMap.js.map +0 -1
- package/radar/index.js +0 -20
- package/radar/index.js.map +0 -1
- package/rain/MergeStrategy.d.ts +0 -13
- package/rain/MergeStrategy.js +0 -11
- package/rain/MergeStrategy.js.map +0 -1
- package/rain/RainComputation.d.ts +0 -42
- package/rain/RainComputation.js +0 -65
- package/rain/RainComputation.js.map +0 -1
- package/rain/RainComputationAbstract.d.ts +0 -73
- package/rain/RainComputationAbstract.js.map +0 -1
- package/rain/RainComputationMap.d.ts +0 -37
- package/rain/RainComputationMap.js +0 -58
- package/rain/RainComputationMap.js.map +0 -1
- package/rain/RainComputationQuality.d.ts +0 -40
- package/rain/RainComputationQuality.js.map +0 -1
- package/rain/RainMeasure.d.ts +0 -17
- package/rain/RainMeasure.js +0 -18
- package/rain/RainMeasure.js.map +0 -1
- package/rain/RainNode.d.ts +0 -46
- package/rain/RainNode.js.map +0 -1
- package/rain/index.js +0 -23
- package/rain/index.js.map +0 -1
- /package/{cartesian/index.d.ts → src/cartesian/index.ts} +0 -0
- /package/{gauge/index.d.ts → src/gauge/index.ts} +0 -0
- /package/{index.d.ts → src/index.ts} +0 -0
- /package/{organization/IVersion.d.ts → src/organization/IVersion.ts} +0 -0
- /package/{organization/index.d.ts → src/organization/index.ts} +0 -0
- /package/{polar/index.d.ts → src/polar/index.ts} +0 -0
- /package/{radar/index.d.ts → src/radar/index.ts} +0 -0
- /package/{rain/index.d.ts → src/rain/index.ts} +0 -0
package/.cursorignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ master ]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-node@v4
|
|
14
|
+
with:
|
|
15
|
+
node-version: '18'
|
|
16
|
+
registry-url: 'https://registry.npmjs.org'
|
|
17
|
+
- run: npm install
|
|
18
|
+
- run: npm test
|
|
19
|
+
- run: npm run build
|
|
20
|
+
- run: npm run docs
|
|
21
|
+
- name: Deploy documentation to GitHub Pages
|
|
22
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
23
|
+
with:
|
|
24
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
25
|
+
publish_dir: ./docs
|
|
26
|
+
- run: npm publish
|
|
27
|
+
working-directory: ./dist
|
|
28
|
+
env:
|
|
29
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [2.6.10] - 2025-03-22
|
|
11
|
+
### Added
|
|
12
|
+
- Planning new feature implementations
|
|
13
|
+
- Considering additional testing frameworks
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Ongoing documentation improvements
|
|
17
|
+
- Code structure refinements
|
|
18
|
+
|
|
19
|
+
### Dependencies
|
|
20
|
+
- Planning to update TypeScript dependencies
|
|
21
|
+
- Considering new quality measurement tools integration
|
|
22
|
+
|
|
23
|
+
### Technical Details
|
|
24
|
+
- Investigating performance optimizations
|
|
25
|
+
- Exploring new quality metric algorithms
|
|
26
|
+
|
|
27
|
+
## [2.6.9] - 2025-03-21
|
|
28
|
+
### Added
|
|
29
|
+
- MIT license file
|
|
30
|
+
- TypeDoc configuration for API documentation
|
|
31
|
+
- Enhanced documentation for core components
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- Updated CI workflow configuration
|
|
35
|
+
- Improved core components:
|
|
36
|
+
- Enhanced RainNode computation capabilities
|
|
37
|
+
- Updated GaugeNode station management
|
|
38
|
+
- Refined organization structure (RaainNode, TeamNode)
|
|
39
|
+
|
|
40
|
+
### Dependencies
|
|
41
|
+
- Updated dependencies to latest versions
|
|
42
|
+
- Upgraded TypeScript to ^5.0.4
|
|
43
|
+
- Updated testing frameworks
|
|
44
|
+
|
|
45
|
+
### Technical Details
|
|
46
|
+
- Improved polar measurement value filtering
|
|
47
|
+
- Enhanced speed matrix container comparison calculations
|
|
48
|
+
- Refined quality control mechanisms
|
|
49
|
+
|
|
50
|
+
## [2.6.8] - 2025-03-16
|
|
51
|
+
### Fixed
|
|
52
|
+
- PolarMeasureValue getFiltered functionality
|
|
53
|
+
|
|
54
|
+
### Technical Details
|
|
55
|
+
- Optimized filtering algorithms
|
|
56
|
+
- Improved error handling in measurement processing
|
|
57
|
+
|
|
58
|
+
## [2.6.7] - 2025-02-24
|
|
59
|
+
### Fixed
|
|
60
|
+
- SpeedMatrixContainer BuildCompares calculations
|
|
61
|
+
- Quality point calculations and metrics
|
|
62
|
+
- CartesianRainHistory tracking improvements
|
|
63
|
+
- QualityTools refinements
|
|
64
|
+
|
|
65
|
+
### Dependencies
|
|
66
|
+
- Updated dependencies to patch security vulnerabilities
|
|
67
|
+
|
|
68
|
+
### Technical Details
|
|
69
|
+
- Improved matrix comparison algorithms
|
|
70
|
+
- Enhanced quality metric calculations
|
|
71
|
+
- Optimized history tracking mechanisms
|
|
72
|
+
|
|
73
|
+
## [2.6.0] - 2024
|
|
74
|
+
### Added
|
|
75
|
+
- Unified Cartesian map tools
|
|
76
|
+
- Improved map manipulation utilities
|
|
77
|
+
|
|
78
|
+
## [2.5.0] - 2024
|
|
79
|
+
### Added
|
|
80
|
+
- Polar and Cartesian limits (count + offsets)
|
|
81
|
+
- PolarMap for index manipulation
|
|
82
|
+
|
|
83
|
+
## [2.4.0] - 2024
|
|
84
|
+
### Changed
|
|
85
|
+
- Moved role to roles in PeopleNode
|
|
86
|
+
- Improved role management system
|
|
87
|
+
|
|
88
|
+
## [2.3.0] - 2024
|
|
89
|
+
### Changed
|
|
90
|
+
- Refactored Angle/Axis system
|
|
91
|
+
- Improved angular calculations
|
|
92
|
+
|
|
93
|
+
## [2.2.0] - 2024
|
|
94
|
+
### Changed
|
|
95
|
+
- Refactored BuildCompares functionality
|
|
96
|
+
- Enhanced comparison algorithms
|
|
97
|
+
|
|
98
|
+
## [2.1.0] - 2023
|
|
99
|
+
### Added
|
|
100
|
+
- Extended RainComputationQuality with rainComputation's link
|
|
101
|
+
- Added getQualityPointsByHistoricalPosition method
|
|
102
|
+
|
|
103
|
+
## [2.0.0] - 2023
|
|
104
|
+
### Changed
|
|
105
|
+
- More flexible configuration system for rain, radar, and gauge
|
|
106
|
+
- Restructured Rain zone to use LatLng rects
|
|
107
|
+
- Removed period usage in favor of date
|
|
108
|
+
|
|
109
|
+
## [1.11.0] - 2023
|
|
110
|
+
### Changed
|
|
111
|
+
- Modified SpeedMatrixContainer's QualityPoints relation (1:N)
|
|
112
|
+
- Added SpeedMatrix name property
|
|
113
|
+
|
|
114
|
+
## [1.10.0] - 2023
|
|
115
|
+
### Added
|
|
116
|
+
- Object constructor based on JSON only
|
|
117
|
+
- Added specifications
|
|
118
|
+
|
|
119
|
+
## [1.9.0] - 2023
|
|
120
|
+
### Added
|
|
121
|
+
- Cartesian improvements
|
|
122
|
+
- Enhanced coordinate system
|
|
123
|
+
|
|
124
|
+
## [0.4.0] - 2022
|
|
125
|
+
### Changed
|
|
126
|
+
- Implemented Cartesian values
|
|
127
|
+
- Reorganized folders
|
|
128
|
+
- Renamed Polar objects (XX-MeasureValue to XX-PolarMeasureValue)
|
|
129
|
+
|
|
130
|
+
## [0.3.0] - 2022
|
|
131
|
+
### Added
|
|
132
|
+
- Added IVersion interface
|
|
133
|
+
- Implemented CI/CD pipeline
|
|
134
|
+
|
|
135
|
+
### Changed
|
|
136
|
+
- Reformatted Links structure
|
|
137
|
+
|
|
138
|
+
## [0.2.0] - 2022
|
|
139
|
+
### Added
|
|
140
|
+
- Customer teams functionality
|
|
141
|
+
- Radar implementation
|
|
142
|
+
|
|
143
|
+
## [0.0.1] - 2022
|
|
144
|
+
### Added
|
|
145
|
+
- Initial release
|
|
146
|
+
- First extracts from RAAIN services
|
|
147
|
+
|
|
148
|
+
[Unreleased]: https://github.com/raainio/raain-model/compare/v2.6.10...HEAD
|
|
149
|
+
[2.6.10]: https://github.com/raainio/raain-model/compare/v2.6.9...v2.6.10
|
|
150
|
+
[2.6.9]: https://github.com/raainio/raain-model/compare/v2.6.8...v2.6.9
|
|
151
|
+
[2.6.8]: https://github.com/raainio/raain-model/compare/v2.6.7...v2.6.8
|
|
152
|
+
[2.6.7]: https://github.com/raainio/raain-model/compare/v2.6.6...v2.6.7
|
|
153
|
+
[2.6.0]: https://github.com/raainio/raain-model/compare/v2.5.0...v2.6.0
|
|
154
|
+
[2.5.0]: https://github.com/raainio/raain-model/compare/v2.4.0...v2.5.0
|
|
155
|
+
[2.4.0]: https://github.com/raainio/raain-model/compare/v2.3.0...v2.4.0
|
|
156
|
+
[2.3.0]: https://github.com/raainio/raain-model/compare/v2.2.0...v2.3.0
|
|
157
|
+
[2.2.0]: https://github.com/raainio/raain-model/compare/v2.1.0...v2.2.0
|
|
158
|
+
[2.1.0]: https://github.com/raainio/raain-model/compare/v2.0.0...v2.1.0
|
|
159
|
+
[2.0.0]: https://github.com/raainio/raain-model/compare/v1.11.0...v2.0.0
|
|
160
|
+
[1.11.0]: https://github.com/raainio/raain-model/compare/v1.10.0...v1.11.0
|
|
161
|
+
[1.10.0]: https://github.com/raainio/raain-model/compare/v1.9.0...v1.10.0
|
|
162
|
+
[1.9.0]: https://github.com/raainio/raain-model/compare/v0.4.0...v1.9.0
|
|
163
|
+
[0.4.0]: https://github.com/raainio/raain-model/compare/v0.3.0...v0.4.0
|
|
164
|
+
[0.3.0]: https://github.com/raainio/raain-model/compare/v0.2.0...v0.3.0
|
|
165
|
+
[0.2.0]: https://github.com/raainio/raain-model/compare/v0.0.1...v0.2.0
|
|
166
|
+
[0.0.1]: https://github.com/raainio/raain-model/releases/tag/v0.0.1
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 radartorain.com
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,17 +1,98 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🌧️ RAAIN Model
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://badge.fury.io/js/raain-model)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.typescriptlang.org/)
|
|
6
|
+
[](https://github.com/raainio/raain-model/actions)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
> A TypeScript library for radar-based rain measurement and analysis, used in [radartorain.com](https://radartorain.com)
|
|
9
|
+
> services.
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
## 🌟 Features
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
- **Radar Data Processing**: Efficient processing of radar data for rain measurement
|
|
14
|
+
- **Cartesian & Polar Coordinates**: Support for both coordinate systems
|
|
15
|
+
- **Advanced Merging**: Sophisticated merging strategies for rain data
|
|
16
|
+
- **Quality Assessment**: Built-in quality metrics for measurements
|
|
17
|
+
- **TypeScript Support**: Full type safety and modern TypeScript features
|
|
18
|
+
- **Performance Optimized**: Efficient data structures and algorithms
|
|
10
19
|
|
|
11
|
-
##
|
|
20
|
+
## 🚀 Installation
|
|
12
21
|
|
|
13
|
-
|
|
22
|
+
```bash
|
|
23
|
+
npm install raain-model
|
|
24
|
+
# or
|
|
25
|
+
yarn add raain-model
|
|
26
|
+
```
|
|
14
27
|
|
|
15
|
-
##
|
|
28
|
+
## 📖 Quick Start
|
|
16
29
|
|
|
17
|
-
|
|
30
|
+
```typescript
|
|
31
|
+
import {RainComputationMap, RainNode, RadarNode} from 'raain-model';
|
|
32
|
+
|
|
33
|
+
// Create a radar node
|
|
34
|
+
const radarNode = new RadarNode({
|
|
35
|
+
id: 'radar1',
|
|
36
|
+
latitude: 48.8566,
|
|
37
|
+
longitude: 2.3522,
|
|
38
|
+
name: 'Paris Radar',
|
|
39
|
+
team: null
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Create a rain node
|
|
43
|
+
const rainNode = new RainNode({
|
|
44
|
+
id: 'rain1',
|
|
45
|
+
name: 'Paris Rain',
|
|
46
|
+
team: null,
|
|
47
|
+
radars: [radarNode]
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Process rain data
|
|
51
|
+
const computation = new RainComputationMap({
|
|
52
|
+
id: 'comp1',
|
|
53
|
+
date: new Date(),
|
|
54
|
+
isReady: true,
|
|
55
|
+
map: [] // Your rain measurement data here
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 📚 Documentation
|
|
60
|
+
|
|
61
|
+
Visit [documentation](https://raainio.github.io/raain-model)
|
|
62
|
+
and [swagger](https://api.sandbox.radartorain.com/v2/docs).
|
|
63
|
+
|
|
64
|
+
### Key Components
|
|
65
|
+
|
|
66
|
+
- `RainNode`: Core class for rain measurement nodes
|
|
67
|
+
- `RadarNode`: Radar station representation
|
|
68
|
+
- `RainComputationMap`: Advanced rain data processing
|
|
69
|
+
- `CartesianTools`: Utilities for coordinate transformations
|
|
70
|
+
- `SpeedMatrix`: Matrix operations for rain data
|
|
71
|
+
|
|
72
|
+
## 🧪 Testing
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# Run all tests
|
|
76
|
+
npm test
|
|
77
|
+
|
|
78
|
+
# Run tests with coverage
|
|
79
|
+
npm run test:coverage
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 🤝 Contributing
|
|
83
|
+
|
|
84
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
85
|
+
|
|
86
|
+
## 📝 License
|
|
87
|
+
|
|
88
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
89
|
+
|
|
90
|
+
## 📅 Release Notes
|
|
91
|
+
|
|
92
|
+
See [Release notes](./RELEASE.md) for version history and changes.
|
|
93
|
+
|
|
94
|
+
## 🔗 Links
|
|
95
|
+
|
|
96
|
+
- [Website](https://radartorain.com)
|
|
97
|
+
- [API Documentation](https://api.sandbox.radartorain.com/docs)
|
|
98
|
+
- [GitHub Issues](https://github.com/raainio/raain-model/issues)
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Release Process Documentation
|
|
2
|
+
|
|
3
|
+
## Patch Version Release Steps
|
|
4
|
+
|
|
5
|
+
### Prerequisites
|
|
6
|
+
|
|
7
|
+
- Make sure you have all dependencies installed
|
|
8
|
+
- Ensure you're starting from an up-to-date master branch
|
|
9
|
+
|
|
10
|
+
### Step-by-Step Process
|
|
11
|
+
|
|
12
|
+
⚠️ If any task fails, you must:
|
|
13
|
+
|
|
14
|
+
- NOT proceed with any further steps
|
|
15
|
+
- NOT try to fix or set the environment manually
|
|
16
|
+
- Alert the team and request guidance
|
|
17
|
+
|
|
18
|
+
1. **Initial Verification**
|
|
19
|
+
```bash
|
|
20
|
+
npm test
|
|
21
|
+
```
|
|
22
|
+
This command runs the test suite. Do not proceed if any tests fail.
|
|
23
|
+
|
|
24
|
+
2. **Documentation Sync**
|
|
25
|
+
Ensure all documentation is up-to-date with recent changes:
|
|
26
|
+
- README.md
|
|
27
|
+
- specs/*.md files
|
|
28
|
+
- CHANGELOG.md
|
|
29
|
+
|
|
30
|
+
5. **Version Control**
|
|
31
|
+
```bash
|
|
32
|
+
git add .
|
|
33
|
+
git commit -m "release: patch version X.Y.Z with [explanation of changes]"
|
|
34
|
+
git tag -a vX.Y.Z -m "Version X.Y.Z"
|
|
35
|
+
git push
|
|
36
|
+
git push --tags
|
|
37
|
+
```
|
|
38
|
+
Replace X.Y.Z with the actual version number and provide a clear explanation of changes.
|
|
39
|
+
|
|
40
|
+
## For all Version Release Steps (Patch or Release)
|
|
41
|
+
|
|
42
|
+
### Important Notes
|
|
43
|
+
|
|
44
|
+
- Always run and verify tests before pushing
|
|
45
|
+
- Document all significant changes in the commit message
|
|
46
|
+
- Monitor the merge process for any conflicts
|
|
47
|
+
|
|
48
|
+
### Post-Release Verification
|
|
49
|
+
|
|
50
|
+
- Verify the release is properly tagged
|
|
51
|
+
|
|
52
|
+
### Version Management Best Practices
|
|
53
|
+
|
|
54
|
+
- Always check the current version in package.json before starting the release process
|
|
55
|
+
- Use `npm run build-version` to increment the version number automatically
|
|
56
|
+
- Ensure version numbers are consistent across:
|
|
57
|
+
- package.json
|
|
58
|
+
- git tags
|
|
59
|
+
- CHANGELOG.md entries
|
|
60
|
+
- Never manually edit version numbers
|
|
61
|
+
|
|
62
|
+
### CHANGELOG Management
|
|
63
|
+
|
|
64
|
+
- Keep the [Unreleased] section at the top of CHANGELOG.md
|
|
65
|
+
- Move unreleased changes to a new version section during release
|
|
66
|
+
- Include the current date in ISO format (YYYY-MM-DD)
|
|
67
|
+
- Organize changes under appropriate categories:
|
|
68
|
+
- Added
|
|
69
|
+
- Changed
|
|
70
|
+
- Fixed
|
|
71
|
+
- Dependencies
|
|
72
|
+
- Technical Details
|
|
73
|
+
|
|
74
|
+
### Common Pitfalls to Avoid
|
|
75
|
+
|
|
76
|
+
- Don't create tags with placeholder version numbers (X.Y.Z)
|
|
77
|
+
- Don't forget to push both commits and tags
|
|
78
|
+
|
|
79
|
+
### Recovery Procedures
|
|
80
|
+
|
|
81
|
+
If incorrect version numbers are used:
|
|
82
|
+
|
|
83
|
+
1. Delete the incorrect tag locally and remotely:
|
|
84
|
+
```bash
|
|
85
|
+
git tag -d <incorrect_tag>
|
|
86
|
+
git push origin :<incorrect_tag>
|
|
87
|
+
```
|
|
88
|
+
2. Update version numbers in all relevant files
|
|
89
|
+
3. Create new tag with correct version
|
|
90
|
+
4. Push changes and new tag
|
|
91
|
+
|
|
92
|
+
If merge conflicts occur:
|
|
93
|
+
|
|
94
|
+
1. Document the conflicting files
|
|
95
|
+
2. Resolve conflicts locally
|
|
96
|
+
3. Commit the resolution with a clear message
|
|
97
|
+
4. Push the changes
|
|
98
|
+
5. Verify the merge was successful
|
|
99
|
+
|
|
100
|
+
### Directory Navigation
|
|
101
|
+
|
|
102
|
+
- Return to the root directory for git operations
|
|
103
|
+
- Use absolute paths when necessary to avoid confusion
|
|
104
|
+
|
|
105
|
+
### Future Improvements
|
|
106
|
+
|
|
107
|
+
- Consider automating version consistency checks
|
|
108
|
+
- Add pre-commit hooks for version validation
|
|
109
|
+
- Implement automated changelog updates
|
|
110
|
+
- Add automated testing of the release process
|
|
111
|
+
- Consider implementing a release automation script
|
package/package.json
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "raain-model",
|
|
3
|
-
"version": "2.6.
|
|
4
|
-
"author": "contact@
|
|
3
|
+
"version": "2.6.10",
|
|
4
|
+
"author": "contact@radartorain.com",
|
|
5
5
|
"homepage": "https://github.com/raainio/raain-model",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "radartorain.com api model",
|
|
7
7
|
"keywords": [
|
|
8
|
-
"
|
|
8
|
+
"radartorain.com",
|
|
9
9
|
"api"
|
|
10
10
|
],
|
|
11
11
|
"private": false,
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"main": "./index.js",
|
|
14
14
|
"types": "./index.d.ts",
|
|
15
|
-
"dependencies": {},
|
|
16
15
|
"devDependencies": {
|
|
17
|
-
"
|
|
16
|
+
"@testdeck/mocha": "^0.3.3",
|
|
18
17
|
"@types/chai": "^4.3.10",
|
|
19
18
|
"@types/mocha": "^10.0.1",
|
|
20
19
|
"@types/node": "^20.8.8",
|
|
21
20
|
"chai": "^4.3.10",
|
|
22
21
|
"chai-as-promised": "^7.1.1",
|
|
23
22
|
"chai-spies": "^1.1.0",
|
|
23
|
+
"hash-it": "^6.0.0",
|
|
24
24
|
"mocha": "^10.2.0",
|
|
25
|
-
"mocha-typescript": "^1.1.17",
|
|
26
25
|
"ts-node": "^8.10.2",
|
|
27
26
|
"tslint": "^6.1.3",
|
|
27
|
+
"typedoc": "^0.25.12",
|
|
28
28
|
"typescript": "^5.0.4"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "npm run build-dist",
|
|
32
32
|
"build-version": "VERSION=\"$(npm version patch --no-git-tag-version)\"",
|
|
33
33
|
"build-dist": "rm -rf dist/ && npx tsc && cp package.json dist/ && cp *.md dist/",
|
|
34
|
-
"test": "mocha --require ts-node/register 'specs/**/**.spec.ts'"
|
|
34
|
+
"test": "mocha --require ts-node/register 'specs/**/**.spec.ts'",
|
|
35
|
+
"docs": "typedoc --out docs src/",
|
|
36
|
+
"docs:serve": "npx serve docs"
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Project Requirements
|
|
2
|
+
|
|
3
|
+
This document serves as the foundation for development and should be updated as requirements evolve or new providers are added to the system.
|
|
4
|
+
|
|
5
|
+
## Core Requirements
|
|
6
|
+
|
|
7
|
+
### Rain Data Processing
|
|
8
|
+
1. Must support multiple radar data sources
|
|
9
|
+
2. Must integrate with physical rain gauge stations
|
|
10
|
+
3. Must provide accurate geographic coverage information
|
|
11
|
+
4. Must maintain computation history
|
|
12
|
+
5. Must implement quality control measures
|
|
13
|
+
|
|
14
|
+
### Gauge Integration
|
|
15
|
+
1. Must support physical rain gauge station management
|
|
16
|
+
2. Must store precise geographic coordinates
|
|
17
|
+
3. Must allow custom configuration per station
|
|
18
|
+
4. Must integrate with team management system
|
|
19
|
+
|
|
20
|
+
### Quality Control
|
|
21
|
+
1. Must implement speed matrix comparisons
|
|
22
|
+
2. Must calculate and track quality metrics
|
|
23
|
+
3. Must support historical data analysis
|
|
24
|
+
4. Must provide tools for quality assessment
|
|
25
|
+
|
|
26
|
+
### Organization
|
|
27
|
+
1. Must support team-based access control
|
|
28
|
+
2. Must maintain relationships between different nodes
|
|
29
|
+
3. Must track version information
|
|
30
|
+
4. Must support flexible configuration options
|
|
31
|
+
|
|
32
|
+
### API Requirements
|
|
33
|
+
1. Must provide RESTful endpoints for all operations
|
|
34
|
+
2. Must implement proper error handling
|
|
35
|
+
3. Must support JSON data format
|
|
36
|
+
4. Must maintain backward compatibility
|
|
37
|
+
|
|
38
|
+
### Technical Requirements
|
|
39
|
+
1. Must use TypeScript for type safety
|
|
40
|
+
2. Must maintain comprehensive documentation
|
|
41
|
+
3. Must include automated tests
|
|
42
|
+
4. Must follow MIT license requirements
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Technical Documentation
|
|
2
|
+
|
|
3
|
+
This document serves as the technical reminder for development and should be updated as implementation evolves.
|
|
4
|
+
|
|
5
|
+
## Core Components
|
|
6
|
+
|
|
7
|
+
### RainNode
|
|
8
|
+
- Extends `RaainNode`
|
|
9
|
+
- Manages rain data computation and configuration
|
|
10
|
+
- Properties:
|
|
11
|
+
- `name`: Station name
|
|
12
|
+
- `description`: Optional description
|
|
13
|
+
- `team`: Associated TeamNode
|
|
14
|
+
- `status`: Current status number
|
|
15
|
+
- `quality`: Quality metric
|
|
16
|
+
- `latLngRectsAsJSON`: Geographic coverage as JSON
|
|
17
|
+
- `configurationAsJSON`: Private configuration data
|
|
18
|
+
- Key Features:
|
|
19
|
+
- Radar link management
|
|
20
|
+
- Gauge integration
|
|
21
|
+
- Geographic calculations (center, limits)
|
|
22
|
+
- Computation history tracking
|
|
23
|
+
|
|
24
|
+
### GaugeNode
|
|
25
|
+
- Extends `RaainNode`
|
|
26
|
+
- Represents physical rain gauge stations
|
|
27
|
+
- Properties:
|
|
28
|
+
- `name`: Station name
|
|
29
|
+
- `description`: Station description
|
|
30
|
+
- `latitude`: Geographic latitude
|
|
31
|
+
- `longitude`: Geographic longitude
|
|
32
|
+
- `team`: Associated TeamNode
|
|
33
|
+
- `configurationAsJSON`: Private configuration data
|
|
34
|
+
- Features:
|
|
35
|
+
- Configuration management
|
|
36
|
+
- Location-based services
|
|
37
|
+
- Team association
|
|
38
|
+
|
|
39
|
+
### Organization Structure
|
|
40
|
+
- `RaainNode`: Base class for all nodes
|
|
41
|
+
- `TeamNode`: Team management and permissions
|
|
42
|
+
- `Link`: Relationship management between nodes
|
|
43
|
+
|
|
44
|
+
### Quality Management
|
|
45
|
+
- Enhanced speed matrix comparisons
|
|
46
|
+
- Improved quality point calculations
|
|
47
|
+
- Updated Cartesian rain history tracking
|
|
48
|
+
- Refined quality measurement tools
|
|
49
|
+
|
|
50
|
+
## API Endpoints
|
|
51
|
+
- `/api/rains/:id`: Rain node management
|
|
52
|
+
- `/api/gauges/:id`: Gauge station management
|
|
53
|
+
|
|
54
|
+
## Data Processing
|
|
55
|
+
- Polar measurement filtering
|
|
56
|
+
- Cartesian coordinate transformations
|
|
57
|
+
- Quality metric calculations
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import {expect} from 'chai';
|
|
2
|
+
import {
|
|
3
|
+
CartesianMeasureValue,
|
|
4
|
+
CartesianValue,
|
|
5
|
+
GaugeMeasure,
|
|
6
|
+
GaugeNode,
|
|
7
|
+
ICartesianMeasureValue,
|
|
8
|
+
LatLng,
|
|
9
|
+
RadarCartesianMeasureValue,
|
|
10
|
+
RainCartesianMeasureValue,
|
|
11
|
+
TeamNode
|
|
12
|
+
} from '../../src';
|
|
13
|
+
|
|
14
|
+
describe('Cartesian', () => {
|
|
15
|
+
|
|
16
|
+
it('should create ones', () => {
|
|
17
|
+
|
|
18
|
+
const team1 = new TeamNode({
|
|
19
|
+
id: 'tid1',
|
|
20
|
+
name: 'team1',
|
|
21
|
+
description: 'team...',
|
|
22
|
+
contracts: ['basic'],
|
|
23
|
+
contacts: []
|
|
24
|
+
});
|
|
25
|
+
const cartesianValue1 = new CartesianValue({
|
|
26
|
+
value: 123,
|
|
27
|
+
lat: 10,
|
|
28
|
+
lng: 20
|
|
29
|
+
});
|
|
30
|
+
const cartesianValue2 = new CartesianValue({
|
|
31
|
+
value: 321,
|
|
32
|
+
lat: 10.002,
|
|
33
|
+
lng: 19.9998
|
|
34
|
+
});
|
|
35
|
+
const cartesianMeasureValue = new CartesianMeasureValue({
|
|
36
|
+
cartesianValues: [cartesianValue1, cartesianValue2],
|
|
37
|
+
});
|
|
38
|
+
const radarCartesianMeasureValue = new RadarCartesianMeasureValue({
|
|
39
|
+
cartesianValues: [cartesianValue1, cartesianValue2],
|
|
40
|
+
angle: 4,
|
|
41
|
+
axis: 0,
|
|
42
|
+
limitPoints: undefined
|
|
43
|
+
});
|
|
44
|
+
expect(radarCartesianMeasureValue.angle).eq(4);
|
|
45
|
+
expect(radarCartesianMeasureValue.getCartesianValues().length).eq(2);
|
|
46
|
+
expect(radarCartesianMeasureValue.getLimitPoints({forceCompute: true})[0].lat).eq(10);
|
|
47
|
+
expect(radarCartesianMeasureValue.getLimitPoints()[0].lng).eq(19.9998);
|
|
48
|
+
expect(radarCartesianMeasureValue.getLimitPoints()[1].lat).eq(10.002);
|
|
49
|
+
expect(radarCartesianMeasureValue.getLimitPoints()[1].lng).eq(20);
|
|
50
|
+
|
|
51
|
+
const gaugeNode = new GaugeNode({
|
|
52
|
+
id: 'GaugeNode looks OK.',
|
|
53
|
+
name: 'name',
|
|
54
|
+
links: [],
|
|
55
|
+
latitude: 1,
|
|
56
|
+
longitude: 1,
|
|
57
|
+
team: team1,
|
|
58
|
+
});
|
|
59
|
+
expect(gaugeNode.id).eq('GaugeNode looks OK.');
|
|
60
|
+
|
|
61
|
+
const gaugeMeasure = new GaugeMeasure({
|
|
62
|
+
id: 'gaugeMeasure',
|
|
63
|
+
date: new Date(),
|
|
64
|
+
values: [cartesianMeasureValue],
|
|
65
|
+
validity: 1
|
|
66
|
+
});
|
|
67
|
+
expect((gaugeMeasure.values[0] as ICartesianMeasureValue).getCartesianValue({lat: 10, lng: 20}).value).eq(123);
|
|
68
|
+
expect((gaugeMeasure.values[0] as ICartesianMeasureValue).getCartesianValue({lat: 10.0001, lng: 20.00001})).eq(null);
|
|
69
|
+
|
|
70
|
+
const rainCartesianMeasureValue = new RainCartesianMeasureValue({
|
|
71
|
+
cartesianValues: [cartesianValue1, cartesianValue2],
|
|
72
|
+
version: '',
|
|
73
|
+
limitPoints: [new LatLng({lat: 0, lng: 1}), new LatLng({lat: 12, lng: 20})]
|
|
74
|
+
});
|
|
75
|
+
expect(rainCartesianMeasureValue.getCartesianValues().length).eq(2);
|
|
76
|
+
expect(rainCartesianMeasureValue.getLimitPoints()[0].lat).eq(0);
|
|
77
|
+
expect(rainCartesianMeasureValue.getLimitPoints()[0].lng).eq(1);
|
|
78
|
+
expect(rainCartesianMeasureValue.getLimitPoints()[1].lat).eq(12);
|
|
79
|
+
expect(rainCartesianMeasureValue.getLimitPoints()[1].lng).eq(20);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
});
|