Alaea 2.7.2__tar.gz → 3.0.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 (74) hide show
  1. alaea-3.0.0/.VERSION +1 -0
  2. alaea-3.0.0/Alaea.egg-info/PKG-INFO +66 -0
  3. alaea-3.0.0/ChangeLog.md +5 -0
  4. alaea-3.0.0/PKG-INFO +66 -0
  5. alaea-3.0.0/README.md +28 -0
  6. {alaea-2.7.2 → alaea-3.0.0}/setup.py +1 -1
  7. alaea-2.7.2/.VERSION +0 -1
  8. alaea-2.7.2/Alaea.egg-info/PKG-INFO +0 -213
  9. alaea-2.7.2/ChangeLog.md +0 -158
  10. alaea-2.7.2/PKG-INFO +0 -213
  11. alaea-2.7.2/README.md +0 -175
  12. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Blogging.py +0 -0
  13. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Pyshell/RS_File.py +0 -0
  14. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Pyshell/__init__.py +0 -0
  15. {alaea-2.7.2 → alaea-3.0.0}/Alaea/S_DateTime.py +0 -0
  16. {alaea-2.7.2 → alaea-3.0.0}/Alaea/SameAsMATLAB/CoorTrans.py +0 -0
  17. {alaea-2.7.2 → alaea-3.0.0}/Alaea/SameAsMATLAB/__init__.py +0 -0
  18. {alaea-2.7.2 → alaea-3.0.0}/Alaea/SameAsMATLAB/calculatefuns.py +0 -0
  19. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/__init__.py +0 -0
  20. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/vars_name.py +0 -0
  21. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_atmos.py +0 -0
  22. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_attrs.py +0 -0
  23. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_ice.py +0 -0
  24. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_netcdf.py +0 -0
  25. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_vars.py +0 -0
  26. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_wave.py +0 -0
  27. {alaea-2.7.2 → alaea-3.0.0}/Alaea/Standard/xr_wind.py +0 -0
  28. {alaea-2.7.2 → alaea-3.0.0}/Alaea/__init__.py +0 -0
  29. {alaea-2.7.2 → alaea-3.0.0}/Alaea/baysalt/Forage/__init__.py +0 -0
  30. {alaea-2.7.2 → alaea-3.0.0}/Alaea/baysalt/Forage/erosion_data/__init__.py +0 -0
  31. {alaea-2.7.2 → alaea-3.0.0}/Alaea/baysalt/__init__.py +0 -0
  32. {alaea-2.7.2 → alaea-3.0.0}/Alaea/baysalt/erosion_coastline.py +0 -0
  33. {alaea-2.7.2 → alaea-3.0.0}/Alaea/commonCode.py +0 -0
  34. {alaea-2.7.2 → alaea-3.0.0}/Alaea/cprintfs.py +0 -0
  35. {alaea-2.7.2 → alaea-3.0.0}/Alaea/exutils/Interp/Interp_g2s.py +0 -0
  36. {alaea-2.7.2 → alaea-3.0.0}/Alaea/exutils/Interp/Interp_s2g.py +0 -0
  37. {alaea-2.7.2 → alaea-3.0.0}/Alaea/exutils/Interp/__init__.py +0 -0
  38. {alaea-2.7.2 → alaea-3.0.0}/Alaea/exutils/Interp/interpolate.py +0 -0
  39. {alaea-2.7.2 → alaea-3.0.0}/Alaea/exutils/__init__.py +0 -0
  40. {alaea-2.7.2 → alaea-3.0.0}/Alaea/netcdf_input.py +0 -0
  41. {alaea-2.7.2 → alaea-3.0.0}/Alaea/pFVCOM/__init__.py +0 -0
  42. {alaea-2.7.2 → alaea-3.0.0}/Alaea/pFVCOM/fvcom_class.py +0 -0
  43. {alaea-2.7.2 → alaea-3.0.0}/Alaea/pFVCOM/fvcom_image.py +0 -0
  44. {alaea-2.7.2 → alaea-3.0.0}/Alaea/pFVCOM/fvcom_load.py +0 -0
  45. {alaea-2.7.2 → alaea-3.0.0}/Alaea/pFVCOM/fvcom_tools.py +0 -0
  46. {alaea-2.7.2 → alaea-3.0.0}/Alaea/pFVCOM/writeFile.py +0 -0
  47. {alaea-2.7.2 → alaea-3.0.0}/Alaea/processBar.py +0 -0
  48. {alaea-2.7.2 → alaea-3.0.0}/Alaea/read_conf.py +0 -0
  49. {alaea-2.7.2 → alaea-3.0.0}/Alaea/server_info.py +0 -0
  50. {alaea-2.7.2 → alaea-3.0.0}/Alaea/storage.py +0 -0
  51. {alaea-2.7.2 → alaea-3.0.0}/Alaea/tools/P_params.py +0 -0
  52. {alaea-2.7.2 → alaea-3.0.0}/Alaea/tools/Read.py +0 -0
  53. {alaea-2.7.2 → alaea-3.0.0}/Alaea/tools/__init__.py +0 -0
  54. {alaea-2.7.2 → alaea-3.0.0}/Alaea/tools/download_check.py +0 -0
  55. {alaea-2.7.2 → alaea-3.0.0}/Alaea/tools/geo_distance.py +0 -0
  56. {alaea-2.7.2 → alaea-3.0.0}/Alaea/tools/kml2shp.py +0 -0
  57. {alaea-2.7.2 → alaea-3.0.0}/Alaea/warningTools/__init__.py +0 -0
  58. {alaea-2.7.2 → alaea-3.0.0}/Alaea.egg-info/SOURCES.txt +0 -0
  59. {alaea-2.7.2 → alaea-3.0.0}/Alaea.egg-info/dependency_links.txt +0 -0
  60. {alaea-2.7.2 → alaea-3.0.0}/Alaea.egg-info/requires.txt +0 -0
  61. {alaea-2.7.2 → alaea-3.0.0}/Alaea.egg-info/top_level.txt +0 -0
  62. {alaea-2.7.2 → alaea-3.0.0}/LICENSE +0 -0
  63. {alaea-2.7.2 → alaea-3.0.0}/MANIFEST.in +0 -0
  64. {alaea-2.7.2 → alaea-3.0.0}/pyproject.toml +0 -0
  65. {alaea-2.7.2 → alaea-3.0.0}/setup.cfg +0 -0
  66. {alaea-2.7.2 → alaea-3.0.0}/tests/test_atmos_weather.py +0 -0
  67. {alaea-2.7.2 → alaea-3.0.0}/tests/test_core.py +0 -0
  68. {alaea-2.7.2 → alaea-3.0.0}/tests/test_cumulative_maximum.py +0 -0
  69. {alaea-2.7.2 → alaea-3.0.0}/tests/test_erosion_dataarray.py +0 -0
  70. {alaea-2.7.2 → alaea-3.0.0}/tests/test_logging_background.py +0 -0
  71. {alaea-2.7.2 → alaea-3.0.0}/tests/test_logging_multiprocess.py +0 -0
  72. {alaea-2.7.2 → alaea-3.0.0}/tests/test_logging_recovery.py +0 -0
  73. {alaea-2.7.2 → alaea-3.0.0}/tests/test_logging_retention.py +0 -0
  74. {alaea-2.7.2 → alaea-3.0.0}/tests/test_netcdf_failures.py +0 -0
alaea-3.0.0/.VERSION ADDED
@@ -0,0 +1 @@
1
+ v3.0.0
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: Alaea
3
+ Version: 3.0.0
4
+ Summary: Some simple tools by Christmas
5
+ Author: Christmas
6
+ Author-email: 273519355@qq.com
7
+ License-Expression: MIT
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: numpy
14
+ Requires-Dist: netCDF4
15
+ Requires-Dist: h5netcdf
16
+ Requires-Dist: cftime
17
+ Requires-Dist: xarray
18
+ Requires-Dist: pandas
19
+ Requires-Dist: matplotlib
20
+ Requires-Dist: colorlog
21
+ Requires-Dist: requests
22
+ Requires-Dist: scipy
23
+ Provides-Extra: gdal
24
+ Requires-Dist: GDAL; extra == "gdal"
25
+ Provides-Extra: zstd
26
+ Requires-Dist: zstandard; extra == "zstd"
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: license-file
33
+ Dynamic: license-expression
34
+ Dynamic: provides-extra
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # Alaea
40
+
41
+ IOCEAN 共用的 Python 科学计算库:空间插值、NetCDF 读写与暂存、岸边缺测填补、标准大气/天气 Dataset 构造、KML→Shapefile(可选 GDAL)等。
42
+
43
+ ## Installation
44
+
45
+ ```shell
46
+ pip3 install Alaea
47
+ pip3 install 'Alaea[gdal]' # KML 转 Shapefile 可选功能
48
+ ```
49
+
50
+ ## Release
51
+
52
+ 仓库根目录 `./build.sh` 在 `dist/` 生成 sdist 与 wheel;发布前核对版本与 `.VERSION`、包内容无 `.DS_Store`/`._*`,并在干净环境 `import Alaea`。发布 PyPI 执行 `./run_twine.py`(`--repository NAME` 选仓库)。
53
+
54
+ ## 主要接口
55
+
56
+ - 空间插值:`Alaea.exutils` 的 `s2s`/`g2s`/`s2g`/`g2g`,统一参数顺序,`method` 支持 `linear`/`nearest`/`cubic`/`idw`。
57
+ - NetCDF:`xr_atmos_dataset` 等标准 Dataset 构造与打包;`write_netcdf`(zlib 默认,`compression="zstd"` 用 HDF5 filter 32015);`open_netcdf_input`/`stage_netcdf_inputs`/`run_storage_fallback` 输入暂存与回退。
58
+ - 岸边填补:`Alaea.baysalt.erosion_coastline.erosion_fill_dataarray`(`_times`/`k`/`judge_num`,`is_direction` 处理方向量);`erosion_cal_id`/`erosion_via_id` 权重式填补。
59
+ - 天气原始输入:`resample_atmos_accumulation`、`add_atmos_accumulation_precision` 等累计量处理。
60
+
61
+ ```python
62
+ from Alaea.exutils import g2s
63
+ point_value = g2s(lon, lat, value, 120.5, 30.5)
64
+ ```
65
+
66
+ 参数、返回语义与边界见各函数 docstring。
@@ -0,0 +1,5 @@
1
+ # Change Log
2
+
3
+ ## v3.0.0
4
+
5
+ - 发行版本升级到 v3.0.0,v2.7.2 功能概述并入 [DONE](docs/DONE.md)。
alaea-3.0.0/PKG-INFO ADDED
@@ -0,0 +1,66 @@
1
+ Metadata-Version: 2.4
2
+ Name: Alaea
3
+ Version: 3.0.0
4
+ Summary: Some simple tools by Christmas
5
+ Author: Christmas
6
+ Author-email: 273519355@qq.com
7
+ License-Expression: MIT
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: numpy
14
+ Requires-Dist: netCDF4
15
+ Requires-Dist: h5netcdf
16
+ Requires-Dist: cftime
17
+ Requires-Dist: xarray
18
+ Requires-Dist: pandas
19
+ Requires-Dist: matplotlib
20
+ Requires-Dist: colorlog
21
+ Requires-Dist: requests
22
+ Requires-Dist: scipy
23
+ Provides-Extra: gdal
24
+ Requires-Dist: GDAL; extra == "gdal"
25
+ Provides-Extra: zstd
26
+ Requires-Dist: zstandard; extra == "zstd"
27
+ Dynamic: author
28
+ Dynamic: author-email
29
+ Dynamic: classifier
30
+ Dynamic: description
31
+ Dynamic: description-content-type
32
+ Dynamic: license-file
33
+ Dynamic: license-expression
34
+ Dynamic: provides-extra
35
+ Dynamic: requires-dist
36
+ Dynamic: requires-python
37
+ Dynamic: summary
38
+
39
+ # Alaea
40
+
41
+ IOCEAN 共用的 Python 科学计算库:空间插值、NetCDF 读写与暂存、岸边缺测填补、标准大气/天气 Dataset 构造、KML→Shapefile(可选 GDAL)等。
42
+
43
+ ## Installation
44
+
45
+ ```shell
46
+ pip3 install Alaea
47
+ pip3 install 'Alaea[gdal]' # KML 转 Shapefile 可选功能
48
+ ```
49
+
50
+ ## Release
51
+
52
+ 仓库根目录 `./build.sh` 在 `dist/` 生成 sdist 与 wheel;发布前核对版本与 `.VERSION`、包内容无 `.DS_Store`/`._*`,并在干净环境 `import Alaea`。发布 PyPI 执行 `./run_twine.py`(`--repository NAME` 选仓库)。
53
+
54
+ ## 主要接口
55
+
56
+ - 空间插值:`Alaea.exutils` 的 `s2s`/`g2s`/`s2g`/`g2g`,统一参数顺序,`method` 支持 `linear`/`nearest`/`cubic`/`idw`。
57
+ - NetCDF:`xr_atmos_dataset` 等标准 Dataset 构造与打包;`write_netcdf`(zlib 默认,`compression="zstd"` 用 HDF5 filter 32015);`open_netcdf_input`/`stage_netcdf_inputs`/`run_storage_fallback` 输入暂存与回退。
58
+ - 岸边填补:`Alaea.baysalt.erosion_coastline.erosion_fill_dataarray`(`_times`/`k`/`judge_num`,`is_direction` 处理方向量);`erosion_cal_id`/`erosion_via_id` 权重式填补。
59
+ - 天气原始输入:`resample_atmos_accumulation`、`add_atmos_accumulation_precision` 等累计量处理。
60
+
61
+ ```python
62
+ from Alaea.exutils import g2s
63
+ point_value = g2s(lon, lat, value, 120.5, 30.5)
64
+ ```
65
+
66
+ 参数、返回语义与边界见各函数 docstring。
alaea-3.0.0/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Alaea
2
+
3
+ IOCEAN 共用的 Python 科学计算库:空间插值、NetCDF 读写与暂存、岸边缺测填补、标准大气/天气 Dataset 构造、KML→Shapefile(可选 GDAL)等。
4
+
5
+ ## Installation
6
+
7
+ ```shell
8
+ pip3 install Alaea
9
+ pip3 install 'Alaea[gdal]' # KML 转 Shapefile 可选功能
10
+ ```
11
+
12
+ ## Release
13
+
14
+ 仓库根目录 `./build.sh` 在 `dist/` 生成 sdist 与 wheel;发布前核对版本与 `.VERSION`、包内容无 `.DS_Store`/`._*`,并在干净环境 `import Alaea`。发布 PyPI 执行 `./run_twine.py`(`--repository NAME` 选仓库)。
15
+
16
+ ## 主要接口
17
+
18
+ - 空间插值:`Alaea.exutils` 的 `s2s`/`g2s`/`s2g`/`g2g`,统一参数顺序,`method` 支持 `linear`/`nearest`/`cubic`/`idw`。
19
+ - NetCDF:`xr_atmos_dataset` 等标准 Dataset 构造与打包;`write_netcdf`(zlib 默认,`compression="zstd"` 用 HDF5 filter 32015);`open_netcdf_input`/`stage_netcdf_inputs`/`run_storage_fallback` 输入暂存与回退。
20
+ - 岸边填补:`Alaea.baysalt.erosion_coastline.erosion_fill_dataarray`(`_times`/`k`/`judge_num`,`is_direction` 处理方向量);`erosion_cal_id`/`erosion_via_id` 权重式填补。
21
+ - 天气原始输入:`resample_atmos_accumulation`、`add_atmos_accumulation_precision` 等累计量处理。
22
+
23
+ ```python
24
+ from Alaea.exutils import g2s
25
+ point_value = g2s(lon, lat, value, 120.5, 30.5)
26
+ ```
27
+
28
+ 参数、返回语义与边界见各函数 docstring。
@@ -8,7 +8,7 @@ with open("README.md", "r") as fh:
8
8
 
9
9
  setuptools.setup(
10
10
  name="Alaea",
11
- version="2.7.2",
11
+ version="3.0.0",
12
12
  author="Christmas",
13
13
  author_email="273519355@qq.com",
14
14
  description="Some simple tools by Christmas",
alaea-2.7.2/.VERSION DELETED
@@ -1 +0,0 @@
1
- v2.7.2
@@ -1,213 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: Alaea
3
- Version: 2.7.2
4
- Summary: Some simple tools by Christmas
5
- Author: Christmas
6
- Author-email: 273519355@qq.com
7
- License-Expression: MIT
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.9
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
- Requires-Dist: numpy
14
- Requires-Dist: netCDF4
15
- Requires-Dist: h5netcdf
16
- Requires-Dist: cftime
17
- Requires-Dist: xarray
18
- Requires-Dist: pandas
19
- Requires-Dist: matplotlib
20
- Requires-Dist: colorlog
21
- Requires-Dist: requests
22
- Requires-Dist: scipy
23
- Provides-Extra: gdal
24
- Requires-Dist: GDAL; extra == "gdal"
25
- Provides-Extra: zstd
26
- Requires-Dist: zstandard; extra == "zstd"
27
- Dynamic: author
28
- Dynamic: author-email
29
- Dynamic: classifier
30
- Dynamic: description
31
- Dynamic: description-content-type
32
- Dynamic: license-file
33
- Dynamic: license-expression
34
- Dynamic: provides-extra
35
- Dynamic: requires-dist
36
- Dynamic: requires-python
37
- Dynamic: summary
38
-
39
- # Alaea
40
-
41
- ## Installation
42
-
43
- ```shell
44
- pip3 install Alaea
45
- ```
46
-
47
- KML 转 Shapefile 是可选功能,需要 GDAL:
48
-
49
- ```shell
50
- pip3 install 'Alaea[gdal]'
51
- ```
52
-
53
- ## Release
54
-
55
- Direct execution cleans old artifacts, builds the package, uploads it with
56
- Twine, and cleans the artifacts after a successful upload:
57
-
58
- ```shell
59
- ./run_twine.py
60
- ```
61
-
62
- Use `--repository NAME` to select a configured Twine repository. A failed build
63
- does not attempt upload; a failed upload retains the new archives for diagnosis
64
- and retry. Directly rerunning the script skips files already present on PyPI and
65
- continues uploading the remaining archives.
66
-
67
- ## Coastline boundary filling (2.6.8)
68
-
69
- `Alaea.baysalt.erosion_coastline.erosion_fill_dataarray` fills persistent
70
- missing boundaries in a floating-point xarray DataArray. The last two
71
- axes must be latitude and longitude with finite, unique 1-D coordinates;
72
- a 3-D array uses its first axis as time. Dimension names may vary.
73
-
74
- ```python
75
- from Alaea.baysalt.erosion_coastline import erosion_fill_dataarray
76
-
77
- filled = erosion_fill_dataarray(wave, _times=1, k=16, judge_num=3)
78
- direction = erosion_fill_dataarray(wave_direction, _times=1, k=16, judge_num=3, is_direction=True)
79
- ```
80
-
81
- Only cells missing throughout the supplied time series are candidates.
82
- Existing values and transient gaps are preserved, and each frame must meet
83
- `judge_num` valid neighbors. `k` includes the target itself; `_times=0`
84
- disables filling. Directions use circular averaging and remain missing
85
- when the mean direction is undefined. Distances use the existing planar
86
- longitude/latitude metric, without periodic seam wrapping; this is numerical
87
- boundary extrapolation, not a physical erosion model.
88
-
89
- Dask inputs retain time chunks and fill lazily after the 2-D validity mask
90
- is computed; each spatial grid is rechunked as a whole. Callers can share
91
- `weight_cache={}` within one batch of variables. Cache keys include the
92
- coordinates, mask and parameters, and the caller releases the cache at the
93
- end of the batch. No global cache or new dependency is added.
94
-
95
- To apply one set of significant-wave-height boundary indices to wind sea,
96
- swell, directions and periods, pass the same 2-D `reference` and batch cache:
97
-
98
- ```python
99
- import numpy as np
100
- import xarray as xr
101
-
102
- reference = xr.where(np.isfinite(swh).any("time"), 1.0, np.nan).compute()
103
- weights = {}
104
- filled_height = erosion_fill_dataarray(swh, 1, 16, 3, reference=reference, weight_cache=weights)
105
- filled_swell = erosion_fill_dataarray(swell, 1, 16, 3, reference=reference, weight_cache=weights)
106
- ```
107
-
108
- The reference must have exactly the same spatial dimensions and coordinates.
109
- Its finite cells define the existing domain; only its missing boundary cells
110
- can become targets. Component-only holes within the valid reference domain
111
- are preserved. Every field keeps existing valid values, checks its own donor
112
- count and uses its own donor values; directions still require circular means.
113
- Providing a reference does not replace missing component values with total
114
- wave-height values. Omitting it preserves the field-specific default above.
115
-
116
- For NumPy or masked arrays, `erosion_via_id(weights, values,
117
- is_direction=True, min_valid=3)` exposes the same circular mean and
118
- per-frame threshold. Omitting the new options preserves existing behavior.
119
-
120
- These APIs require Alaea 2.6.8 or newer. Earlier versions do not include
121
- `erosion_fill_dataarray` or the new optional direction/threshold arguments.
122
- Update downstream dependency constraints and lock files when upgrading.
123
-
124
- ## Standard atmosphere datasets
125
-
126
- `xr_atmos_dataset` builds any supported combination of wind, 2 metre air
127
- temperature, per-period precipitation, mean sea-level pressure, visibility,
128
- entire-atmosphere total cloud cover, hourly sunshine duration, 2 metre
129
- relative humidity, surface wind gust, 2 metre dew point temperature, and
130
- 2 metre apparent temperature. The
131
- single-element `xr_wind_dataset`, `xr_air_temperature_dataset`,
132
- `xr_precipitation_dataset`, and `xr_slp_dataset` interfaces use the same
133
- metadata and encoding path. Integer packing is enabled by default and can be
134
- disabled with `_COMPRESS=False` when a caller needs to apply it after merging.
135
- `_TIME_type="str"` writes a NetCDF string variable, while `"char"` writes a
136
- fixed character matrix with a `DateStr` dimension. `write_netcdf` uses zlib by
137
- default; `write_netcdf(ds, path, compression="zstd")` selects standard HDF5
138
- Zstd filter 32015 with byte shuffle and fails clearly when its reader/writer
139
- plugin is unavailable.
140
-
141
- `run_storage_fallback` executes an explicit storage method or an ordered
142
- `AUTO` method list. Applications provide their own operations and recoverable
143
- error boundary, so input staging and output publication can share fallback
144
- policy without sharing incompatible lifecycle code.
145
-
146
- `open_netcdf_input` adds a shared single-file NetCDF reader for direct, local
147
- SSD, memory, named-file, and Linux `O_TMPFILE` modes. For `xarray.open_mfdataset`,
148
- `stage_netcdf_inputs` preserves input order while copying through a bounded
149
- worker pool and removes only its own staged files when the context exits.
150
-
151
- ## Unified spatial interpolation
152
-
153
- `s2s`, `g2s`, `s2g`, and `g2g` use the same argument order. `s` means
154
- scattered points and `g` means a grid. Grid coordinates may be one-dimensional
155
- longitude/latitude axes or matching two-dimensional coordinate arrays.
156
-
157
- ```python
158
- import numpy as np
159
- from Alaea.exutils import g2s, s2g
160
-
161
- lon = np.array([120.0, 121.0])
162
- lat = np.array([30.0, 31.0])
163
- value = np.array([[1.0, 2.0], [3.0, 4.0]])
164
-
165
- point_value = g2s(lon, lat, value, 120.5, 30.5)
166
-
167
- station_lon = np.array([120.0, 121.0, 120.0, 121.0])
168
- station_lat = np.array([30.0, 30.0, 31.0, 31.0])
169
- station_value = np.array([1.0, 2.0, 3.0, 4.0])
170
- grid_value = s2g(station_lon, station_lat, station_value, lon, lat)
171
- ```
172
-
173
- All four functions accept `method="linear"`, `method="nearest"`,
174
- `method="cubic"`, or `method="idw"`. IDW also accepts `neighbors` (default 8)
175
- and `power` (default 2). Data may have leading dimensions such as
176
- `(time, lat, lon)` or `(time, point)`; these dimensions are preserved in the
177
- result.
178
-
179
- ## Coastline filling
180
-
181
- ```python
182
- from Alaea.baysalt.erosion_coastline import erosion_cal_id, erosion_via_id
183
-
184
- weight = erosion_cal_id(lon, lat, value, k=4, judge_num=1, method='np.nan')
185
- filled = erosion_via_id(weight, value)
186
- ```
187
-
188
- `method` may be `np.nan`, `nc.mask`, or `txt.mask`. The input used to calculate
189
- weights must be two-dimensional; applying weights supports any data whose last
190
- two dimensions are latitude and longitude.
191
-
192
- Legacy file-generation helpers remain available from their explicit modules,
193
- for example `Alaea.exutils.Interp.Interp_g2s.Grid2Sca`, but are no longer
194
- re-exported from `Alaea.exutils`; new interpolation code should use the four
195
- unified functions above.
196
-
197
-
198
- ## 天气原始输入 Dataset(2.6.7)
199
-
200
- `xr_atmos_dataset` 可组合构造冻结降水比例、对流降水、降雪水当量、地表/最不稳定气块 CAPE、LI、CIN、边界层高度、冻雨标志和降水类型;没有输入的字段不生成。水当量单位 mm 与雪厚度 cm 明确区分,两个 CAPE 的语义分开命名。
201
-
202
- `add_atmos_accumulation_precision` 复用调用方提供的 GRIB 消息核对单时效累计身份和误差界,不调用外部程序或读取数据文件。`resample_atmos_accumulation` 将起报累计水当量守恒分配到 UTC 目标区间,缺测不补零,超出误差的回退失败;`resample_atmos_category` 保持先前瞬时类别,不插值、不外推,只允许按已知源 packing 半步误差恢复整数。分类输出使用恒等整数 packing,避免压缩后产生小数类别。
203
-
204
- 以上能力只负责科学数组和元数据,不实现天气码算法,不获取在线气象数据。
205
-
206
-
207
- ### 详细变量属性
208
-
209
- 22种大气变量均附 `description`、`units_description`、`temporal_kind`、`physical_range`、`missing_value_description` 和 `time_reference`(内容全部为英文,不写入中文或 `_zh` 属性),保留原CF名称和单位。物理范围使用描述属性,不把物理值域错误写成整数packing空间的 `valid_range`。
210
-
211
- `precipitation_type` 提供ECMWF/ecCodes码表4.201中0–14的 `flag_values/flag_meanings` 和英文逐码解释 `flag_descriptions`;15–191保留、192–254本地使用、255源缺测。0在此解释为无降水;部分其他中心表页将0列为保留,换来源需重新核查。此字段不是WMO天气现象码。
212
-
213
- CIN的通用描述明确区分负浮力功与正能量幅度;来源适配器补充实际 `sign_convention`,不由通用构造器自动改变符号。LI是温差,不能按绝对温标减273.15;降雪水当量是mm,不等于新雪厚度或地面积雪深度。
alaea-2.7.2/ChangeLog.md DELETED
@@ -1,158 +0,0 @@
1
- # Change Log
2
-
3
- ## v2.7.2
4
-
5
- - 复核修复 NetCDF 写入失败会损坏或删除旧输出的问题。现在在同目录独占候选中写入、回读校验后原子发布,失败和取消清理本次候选,保留旧输出与访问权限;POSIX 下次写入同目录时复用现有孤儿回收入口,仅清理本库已退出进程的输出候选。补齐默认写入后端 h5netcdf 的安装依赖。
6
- - 批量输入暂存覆盖部分提交失败、等待中断和进度回调失败,工作线程退出后回收全部成功候选;单项清理失败仍尝试其他候选,并保留原始失败及清理原因链。复制前或复制中源路径消失、源截断造成短读均归类为输入源变化,真实目标写入错误保留原异常;入口拒绝布尔型内存字节上限。
7
- - 日志轮转进程在隔离旧日志后退出时,其他写入者重新创建正式日志,避免继续向已删除归档写入;gzip/zstd 压缩归档保留原访问权限,异常 PID 文件名跳过而不阻断后台压缩;时间转换保留本地时区名称与 UTC 偏移,修复 `%Z%z` 显示为空的问题。
8
- - 修复大整数型浮点推断 Int64 时溢出及 UInt64 转 Float64 丢精度的问题;无符号整数默认禁用填充标记,保留合法零值并避免回读时提升为 Float64。修复零长 NetCDF 变量的编码和回读校验,移除两处仅 Python 3.10 起支持的 zip 参数以符合 Python >=3.9 声明。新增失败、取消、并发清理、权限、空变量和大数值回归。
9
- - 本轮复核在 macOS/Python 3.13 下,源码与独立安装 wheel 各 99 项回归通过;独立多进程轮转、压缩未完成时 fork、写入进程直接退出后旧文件保护与下次回收均通过。隔离 build.sh 构建、wheel/源码包源码一致性、版本与依赖元数据、隐藏文件检查通过;Python 3.9 完成语法兼容检查。
10
-
11
- - 支持POSIX目录锁的环境中,时间及时间/大小组合轮转先隔离完整日志,再后台压缩,正常写日志可继续。沿用gzip/zstd和归档保留规则,压缩失败保留可读原始归档,关闭时等待压缩结束,下次轮转清理已退出进程的压缩候选。
12
- - 输入准备的最终失败摘要区分源变化与存储失败,连续源变化保留专用异常及原始原因链。
13
-
14
- - NetCDF暂存将复制期间源文件变化单独记录为输入源变化,保留现有AUTO后备顺序、显式模式错误及失败候选清理,避免误判缓存介质故障。新增源变化、后备顺序及清理回归,完整74项测试通过;FD_PATH用例明确标记当前Linux HDF5的能力限制。
15
-
16
- - 版本从 2.7.1 提升至 2.7.2;保持 Python >=3.9 和现有接口不变,仅在默认依赖中补充 NetCDF 写入后端 h5netcdf。
17
-
18
- ## v2.7.1
19
-
20
- - 修复日志切换压缩格式后旧归档不清理的问题:按时间和时间/大小组合轮转复用现有归档筛选逻辑,统一统计 `.gz`、`.zst`、未压缩及带序号的时间归档,按修改时间保留最新 `backupCount` 份;下一次轮转时清理,重启不主动删除或转码。严格限定同一日志的普通归档文件,保留临时文件、目录、符号链接及无关文件;默认保留 7 份和禁用清理的配置不变。新增跨三种压缩模式、带序号归档及文件边界回归;Python 3.12 下全套 73 项测试和独立多进程轮转检查通过。
21
-
22
- - 修正多进程日志回归测试的同步时序:所有子进程完成导入和预热后再设置共享轮转时间,避免慢启动造成误报;不改变生产程序行为。
23
-
24
- - 发布前源码及隔离安装 wheel 各 73 项回归通过,多进程轮转检查通过;wheel/源码包版本、Python >=3.9 元数据、源码一致性、隐藏文件及 Twine 检查通过。
25
-
26
- - 版本从 2.7.0 提升至 2.7.1;保持 Python >=3.9、现有接口和依赖声明不变。升级后在下一次日志轮转时应用混合格式保留规则。
27
-
28
- ## v2.7.0
29
-
30
- - 发布前源码与隔离安装 wheel 各 71 项回归通过;源码包和 wheel 的 2.7.0 版本、Python >=3.9 元数据、源码内容、隐藏文件及 Twine 检查通过。
31
-
32
- - 新增公共 `cumulative_maximum`:用 NumPy 前缀扫描和 Dask 原分块累计归约代替全长滑动窗口,保持跳过 NaN、全缺测前缀、浮点 dtype、坐标和属性,清除不适用的源 packing 编码;NumPy 使用方不新增 Dask 依赖。现有累计水当量重采样复用该函数,累计守恒、缺测和量化误差判断不变。
33
- - GFS/ECMWF 共用本接口处理总降水、累计误差下界和异常源时效定位,GFS 日照也复用;不修改科学阈值、文件字段或发布规则。本库 71 项、GFS 113 项及 ECMWF 98 项源码回归通过;额外覆盖跨块 NaN、非首轴、不规则分块、线性任务图和真实 NC packing 回读。
34
- - 版本由上个已发布的 2.6.9 升级到 2.7.0,纳入此前未发布的 2.6.10 累计量优化;按用户要求通过 `run_twine.py` 发布到 PyPI。保留 Python >=3.9 和原有接口,下游最低依赖统一升级至 2.7.0,并在发布后定向刷新锁文件。
35
-
36
- ## v2.6.9
37
-
38
- - 版本从2.6.8提升到2.6.9。源码包与wheel的版本、Python>=3.9、文件清单、隐藏元数据及Twine检查通过;隔离安装wheel后的14项岸边回归通过。
39
-
40
- - 岸边填补先筛选满足有效供点数的邻域,再计算算术/圆周均值,避免空邻域 `Mean of empty slice` 警告和无效计算;移除该路径对进程共享 warning 过滤器的修改。有效点不足仍保留原值,旧接口空邻域的 NaN/掩膜结果、方向抵消规则、类型与共享权重保持。 保留旧 float16 标量归约的舍入行为;新增空邻域、阈值、掩膜、多线程和精度回归,Alaea 64 项测试、GFS/ECMWF 各 5 项集成测试及 2,592 组新旧数值对照通过。
41
-
42
- ## v2.6.8
43
-
44
- - 发布前源码包与wheel通过版本、Python下限、文件清单、隐藏元数据和Twine检查;独立临时目录安装wheel后,共享参考接口最小验证通过。
45
-
46
- - 新增`erosion_fill_dataarray`:支持二维/三维浮点DataArray、Dask时间分块、已有值与缺测保护,以及按坐标/掩膜/参数绑定的显式共享索引缓存;不增加依赖或全局缓存。
47
- - 可传入同网格二维`reference`,让有效波高swh统一计算邻居索引后供全部波场复用;各变量只使用自己的有效邻居,保留swh有效海域内的风浪/涌浪独有缺测。GFS和ECMWF共用参数次数1/查询16点/至少3有效点。
48
- - `erosion_via_id`新增可选圆周平均及逐帧有效邻居阈值;原调用默认算术均值保持,方向抵消、邻居不足与MaskedArray掩膜受保护。
49
- - 本库60项、GFS107项、ECMWF86项源码回归全部通过(合计253项),覆盖旧接口、共享参考与索引复用、分区空洞、Dask分块、Int16写盘回读和发布状态失效。既有经纬度平面距离与不跨日期变更线绕回的限制保持。
50
-
51
- ## v2.6.7
52
-
53
- - 22种标准大气变量补齐纯英文物理定义(按用户要求不写入中文或 `_zh` 属性)、单位含义、时间语义、物理范围和缺测说明;降水类型增加ECMWF/ecCodes 0–14完整分类表及保留/本地/缺测码说明。CAPE气块定义、LI温差与CIN源符号约定明确区分,属性可经两种NetCDF引擎完整写入和读回,不修改原数组;本次本库完整50项回归通过。
54
- - 标准大气 Dataset 新增冻结降水比例、对流降水、降雪水当量、地表/最不稳定气块 CAPE、抬升指数、对流抑制、边界层高度、冻雨标志和降水类型;沿用现有构造器与元数据,不要求补齐无关变量。
55
- - 提供两个下载器共用的累计量精度核验、守恒重采样与瞬时类别保持函数:累计量只在源量化误差内修复小回退、保留缺测支撑缺口并禁止外推;分类码只在编码半步误差内恢复整数,压缩写盘仍精确保留类别。
56
- - GFS 104 项、ECMWF 83 项及本库 48 项回归通过;真实 GRIB 本地转换与抽样回读通过。本地构建和安装验证,不自动上传 PyPI;已有使用方保持原接口,下载器需安装本版本后启用新字段。
57
-
58
- ## v2.6.6
59
-
60
- - `Blog` 默认保留的历史日志归档由 5 份增加为 7 份,每个日志文件另保留 1 份当前日志;清理仍按归档数量执行,中间没有日志的日期不会触发按天过期删除,调用方显式设置的 `backupCount` 不受影响。
61
-
62
- ## v2.6.5
63
-
64
- - `Blog.setup_Blog` 不再因 `write_mode="w"` 隐式删除共享日志;新增默认关闭的 `clear_existing_logs` 显式清理开关,避免 multiprocessing spawn 子进程重新导入配置时删除主进程正在写入的日志。需要清空旧日志的程序必须在确认没有其他写入进程后,由主程序启动入口显式启用一次。
65
- - 批量 NetCDF 从 NFS 暂存到 SSD 时每 10 秒输出完成数量、复制容量、平均速度和耗时,连续 60 秒没有文件完成时给出停滞提示;完成顺序不再阻塞进度统计,返回路径仍保持调用方输入顺序。
66
-
67
- ## v2.6.4
68
-
69
- - `write_netcdf` 的 Zstd 分支现将每个数值变量指定的 `chunksizes` 传递给 NetCDF4/HDF5,避免全球时序数据被自动分为跨多个时次的大块;需要单时次访问的调用方可稳定保留 `time chunk=1`,压缩 filter 与数据内容不变。
70
-
71
- ## v2.6.3
72
-
73
- - `xr_atmos_dataset` 新增能见度、整层大气总云量、逐小时日照持续时间、2 米相对湿度、地表阵风、2 米露点温度和 2 米体感温度,并统一写入物理属性与编码;可与原有五个大气字段任意组合,不再要求调用方补字段或伪造占位变量。
74
- - 新增公共 NetCDF 输入暂存模块:单文件支持直接、具名 SSD、内存、文件描述符及 Linux `O_TMPFILE` 读取;多文件支持按原顺序有限并发暂存到 SSD,供 `xarray.open_mfdataset` 使用,并在成功、失败及上下文退出时清理本模块候选文件。孤儿清理可接收受控旧前缀用于应用迁移,但不会扫描其他 NC;MakeTiles 与下载程序可共用同一实现,不再分别维护复制、降级和孤儿文件清理逻辑。
75
-
76
- ## v2.6.2
77
-
78
- - `run_storage_fallback` 的成功线路明细由 INFO 调整为 DEBUG,减少 `Storage method succeeded` 高频常规日志;实际失败并降级仍保持 WARNING。
79
-
80
- ## v2.6.1
81
-
82
- - macOS/Linux 使用 `fcntl` 锁定日志目录,Windows 使用由日志目录确定的系统命名互斥量,让不同程序的按时间、按大小及组合日志轮转无额外锁文件地跨进程串行;多个进程在同一时刻压缩共享日志时只轮转一次,Windows 写入后会关闭日志句柄以允许其他进程重命名文件,其他 handler 会同步当前日志和下次轮转时间,避免 `.gz.tmp`/`.zst.tmp` 竞争、重复归档和轮转后日志丢失。
83
-
84
- ## v2.6.0
85
-
86
- - macOS/Linux 使用 `fcntl`、Windows 使用 `msvcrt`,让按时间、按大小及组合日志轮转通过同路径协作式文件锁跨进程串行;多个进程在同一时刻压缩共享日志时只轮转一次,Windows 写入后会关闭日志句柄以允许其他进程重命名文件,其他 handler 会同步当前日志和下次轮转时间,避免 `.gz.tmp`/`.zst.tmp` 竞争、重复归档和轮转后日志丢失。
87
- - 新增通用 `run_storage_fallback`,让下载、制瓦等调用方复用显式存储方法及有序 `AUTO` 降级,不把各业务的输入打开或输出发布细节耦合进公共库。
88
- - `TIME` 的 `str` 与 `char` 参数现分别写为 NetCDF 字符串变量和带 `DateStr` 维的固定字符矩阵;新增 `write_netcdf`,默认保持 zlib,也可显式选择标准 HDF5 Zstd filter 32015 与 byte shuffle,缺少插件时明确失败且不静默降级;Zstd 写入先执行 CF 编码并按 64 MiB 有界批块复制,支持已解码 `datetime64` 且避免全球数据逐时效写入。
89
- - 真实五字段 GFS 海浪样本中,Zstd 写入由逐时效 199.01 秒降至批块 57.03 秒;同为 level 4 与 byte shuffle 时,zlib 为 47.29 秒/490,065,289 字节,Zstd 为 57.41 秒/538,144,229 字节,因此默认继续使用 zlib,Zstd 保持显式可选。测试样本和输出已删除。
90
- - 新增可组合的大气标准 Dataset,以及风、二米气温、逐时段降水和海平面气压单要素接口;全部接口复用统一坐标、UTC 时间和属性处理,并支持 NumPy、Dask 与 xarray DataArray 输入。
91
- - 数值时间坐标按 CF 使用 `standard_name=time` 和不含时区后缀的 Unix epoch 单位,整秒写为 Int64;`TIME` 辅助变量改为以 `Z` 结尾的 ISO 8601 UTC 字符串并移除非标准 `UTC_time`。
92
- - `compress_scale_offset` 对多个 Dask 变量只执行一次批量范围归约,继续为每个变量独立写入 Int16 `scale_factor/add_offset` 与物理值 `actual_range`。
93
- - 修正二米气温、降水量和海平面气压的 CF `standard_name`;既有风场和海浪 Dataset 同步采用新的 UTC 时间合同。
94
- - `build.sh` 在系统 Python 缺少 PEP 517 `build` 且受 PEP 668 管理时改用任务级临时 venv,避免修改系统环境,构建结束自动清理。
95
- - `run_twine.py` 重跑时会跳过 PyPI 上已存在的同名归档,在 wheel 已上传而 sdist 缺失等部分成功场景下继续补传剩余文件。
96
- - 核心回归测试此前 34 项全部通过;日志轮转双进程回归测试连续通过 10 次,并成功重新构建 `alaea-2.6.0` wheel 与 sdist;当前复核环境缺少 `h5netcdf`,因此 3 项 NetCDF 测试未能执行,本版本未上传 PyPI。
97
-
98
- ## v2.5.9
99
-
100
- - 标准波浪 Dataset 公开函数签名改为单行,与项目 Python 代码格式规范及其他标准 Dataset 接口保持一致,调用契约不变。
101
-
102
- ## v2.5.8
103
-
104
- - 标准风场 Dataset 支持只提供 U 或 V 单个分量,并修复 DatetimeIndex 被误判为单个时间标量的问题;Dask 数据的 dtype 推断不再触发全量读取,scale_factor/add_offset 改为仅归约有效值范围,降低全球网格 packing 的内存峰值。
105
-
106
- ## v2.5.7
107
-
108
- - 文件日志会自动创建父目录,默认按运行环境本地时区每日零点轮转;轮转方式可配置为按时间、按大小或两者任一条件触发,时间单位支持秒、分、时、天、每日零点及指定星期。
109
- - 轮转日志压缩默认按 zstd、gzip、不压缩的顺序自动选择首个可用格式,也可通过 `compression` 显式指定;zstd 作为 `Alaea[zstd]` 可选依赖提供。
110
-
111
- ## v2.5.6
112
-
113
- - 修复 `setup_Blog` 严格参数校验导致已有日志开关调用报错的问题;现已正式应用全部控制台及文件输出开关,并通过带类型的显式关键字参数提供 IDE 补全,未知选项仍会在修改配置前被拒绝。
114
-
115
- ## v2.5.5
116
-
117
- - 修复文件与状态安全:`movefiles` 现严格遵守覆盖开关且同路径移动不会误删源文件,JSON、插值权重、预报文本和 2DM 文件改为同目录临时写入后原子替换,下载元数据不再被误判为文件状态。
118
- - 时间解析改为严格校验并默认返回 UTC 时间;控制台、进度条和日志按运行环境显示本地时区名称及 UTC 偏移,海冰数据处理历史使用带时区的 UTC 时间。
119
- - 修复重复配置键覆盖、FTP 回调默认崩溃和空文件除零、FVCOM 缺少可选深度/层变量时崩溃等问题;shell 环境文件改由 Bash 执行真实语义,不再自行解析或把变量值写入日志。
120
- - 旧版波向计算复用统一矢量方向实现,椭球距离计算修正角度/弧度混用;KML 转换增加 `Alaea[gdal]` 可选依赖提示。
121
- - `Alaea.exutils` 仅公开统一的 `s2s`、`g2s`、`s2g`、`g2g` 接口;旧文件生成和权重接口继续保留在显式模块路径下。
122
- - 发布流程改用 PEP 517 隔离构建,构建成功后再替换 `dist`;直接运行 `run_twine.py` 会依次清理、构建、上传并在成功后清理,上传失败时保留新产物,sdist 不再携带协作规则、发布脚本和仓库配置。
123
- - 补充 MIT `LICENSE` 及标准许可证元数据、公开接口契约说明和安全/运行时回归测试。
124
- - 日志配置会在修改状态前拒绝未知选项,不再把无效键静默写入默认配置。
125
- - 统一插值接口新增 cubic 和 IDW 方法;IDW 支持邻居数、距离幂配置及精确点命中,并完善非法参数校验。
126
- - 完成 `Times2Ttime`,时间工具和海冰/波浪/风场 Dataset 接口现支持标量、字符串、NumPy datetime、时区时间及 cftime;修复可变默认参数。
127
- - 配置分数范围改用安全解析,不再执行 Python 表达式;进程查询不再通过 shell 拼接调用方输入,公网 IP 查询增加超时。
128
- - 修复 pFVCOM 的公开符号、三角形方向、节点邻接表、2DM 纬度写入和 NetCDF 关闭问题;未实现网格格式改为明确报错。
129
- - Dataset 编码在源码运行和全缺测数值变量下不再因缺少安装元数据或无有限值而失败;补回风场 Dataset 的公开导出。
130
- - 新增 Alaea 仓库级 `AGENTS.md`,将 IOCEAN 的通用工程规范适配为本项目执行标准,并明确专属规则与构建边界。
131
- - Python 最低版本修正为 3.9,并补充代码直接使用的 cftime、pandas、matplotlib 依赖;`colorlog` 仍作为日志模块的必需依赖保留。
132
- - PyPI 发布包不再携带约 22 MB 的 coastline erosion 大型复核样本;样本继续保留在源码仓库,手工示例可通过 `data_path` 使用外部目录。
133
-
134
- ### 兼容性说明
135
-
136
- - `convertToTime` 不再把非法输入静默替换为当前时间,而会抛出 `ValueError`;传入列表时仍返回列表。
137
- - `movefiles(..., cover=False)` 在目标已存在时会抛出 `FileExistsError`,不再静默覆盖。
138
- - 旧 `Grid2Sca`/S2G 权重接口不再由 `Alaea.exutils` 通配导出;需要旧行为的调用方应改用其显式模块路径。
139
- - cubic/IDW 通过原有四个统一接口启用;旧 linear/nearest 调用方式不变。
140
- - Python 3.6–3.8 不再声明为受支持版本,安装本版本需要 Python 3.9 或更高版本。
141
- - wheel/sdist 安装后调用 `example_cal_weight` 时需自行提供复核样本目录;erosion 核心接口不受影响。
142
-
143
- ## v2.5.4
144
-
145
- - 新增 `s2s`、`g2s`、`s2g`、`g2g` 统一二维插值接口,支持规则/曲线网格、散点、前导维、缺测值及线性/最近邻方法。
146
- - 修复旧 G2S/S2G 的网格展开顺序、边界点数、搜索范围、经纬度轴误用、NaN 判断、IDW 精确命中除零及权重 JSON 序列化问题;旧入口继续保留。
147
- - S2G 的绘图/示例依赖改为按需导入,基础插值调用不再强制要求 Matplotlib 和 NetCDF4。
148
- - 完善 coastline erosion 的参数校验、超大邻居数、标量 mask、非 0/1 掩膜、SciPy 兼容、多前导维和多变量非原地修改行为;非法模式不再静默忽略。
149
- - 修复南/西半球 DMS 坐标符号、风/流向转换映射及控制台消息经 shell 执行的问题。
150
- - 安装依赖补充 `scipy` 并移除重复的 `colorlog` 声明;新增核心回归测试和公开调用示例。
151
- - 打包前清理并忽略 macOS Finder/AppleDouble 元数据,避免隐藏文件进入发布物。
152
- - 修正源码包清单和示例数据相对路径,安装后可直接使用 coastline erosion 的 `.nc`、`.mat`、`.txt` 数据复核算法。
153
-
154
- ### 兼容性说明
155
-
156
- - `region_define` 现在同时包含起止边界,生成的经纬度长度比旧错误结果多 1。
157
- - `erosion_cal_id` 对非法 `method`、维度、`k` 和 `judge_num` 会明确抛出 `ValueError`。
158
- - `erosion_via_id_multi_vars` 返回新字典,不再替换调用方传入字典中的数组。
alaea-2.7.2/PKG-INFO DELETED
@@ -1,213 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: Alaea
3
- Version: 2.7.2
4
- Summary: Some simple tools by Christmas
5
- Author: Christmas
6
- Author-email: 273519355@qq.com
7
- License-Expression: MIT
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Operating System :: OS Independent
10
- Requires-Python: >=3.9
11
- Description-Content-Type: text/markdown
12
- License-File: LICENSE
13
- Requires-Dist: numpy
14
- Requires-Dist: netCDF4
15
- Requires-Dist: h5netcdf
16
- Requires-Dist: cftime
17
- Requires-Dist: xarray
18
- Requires-Dist: pandas
19
- Requires-Dist: matplotlib
20
- Requires-Dist: colorlog
21
- Requires-Dist: requests
22
- Requires-Dist: scipy
23
- Provides-Extra: gdal
24
- Requires-Dist: GDAL; extra == "gdal"
25
- Provides-Extra: zstd
26
- Requires-Dist: zstandard; extra == "zstd"
27
- Dynamic: author
28
- Dynamic: author-email
29
- Dynamic: classifier
30
- Dynamic: description
31
- Dynamic: description-content-type
32
- Dynamic: license-file
33
- Dynamic: license-expression
34
- Dynamic: provides-extra
35
- Dynamic: requires-dist
36
- Dynamic: requires-python
37
- Dynamic: summary
38
-
39
- # Alaea
40
-
41
- ## Installation
42
-
43
- ```shell
44
- pip3 install Alaea
45
- ```
46
-
47
- KML 转 Shapefile 是可选功能,需要 GDAL:
48
-
49
- ```shell
50
- pip3 install 'Alaea[gdal]'
51
- ```
52
-
53
- ## Release
54
-
55
- Direct execution cleans old artifacts, builds the package, uploads it with
56
- Twine, and cleans the artifacts after a successful upload:
57
-
58
- ```shell
59
- ./run_twine.py
60
- ```
61
-
62
- Use `--repository NAME` to select a configured Twine repository. A failed build
63
- does not attempt upload; a failed upload retains the new archives for diagnosis
64
- and retry. Directly rerunning the script skips files already present on PyPI and
65
- continues uploading the remaining archives.
66
-
67
- ## Coastline boundary filling (2.6.8)
68
-
69
- `Alaea.baysalt.erosion_coastline.erosion_fill_dataarray` fills persistent
70
- missing boundaries in a floating-point xarray DataArray. The last two
71
- axes must be latitude and longitude with finite, unique 1-D coordinates;
72
- a 3-D array uses its first axis as time. Dimension names may vary.
73
-
74
- ```python
75
- from Alaea.baysalt.erosion_coastline import erosion_fill_dataarray
76
-
77
- filled = erosion_fill_dataarray(wave, _times=1, k=16, judge_num=3)
78
- direction = erosion_fill_dataarray(wave_direction, _times=1, k=16, judge_num=3, is_direction=True)
79
- ```
80
-
81
- Only cells missing throughout the supplied time series are candidates.
82
- Existing values and transient gaps are preserved, and each frame must meet
83
- `judge_num` valid neighbors. `k` includes the target itself; `_times=0`
84
- disables filling. Directions use circular averaging and remain missing
85
- when the mean direction is undefined. Distances use the existing planar
86
- longitude/latitude metric, without periodic seam wrapping; this is numerical
87
- boundary extrapolation, not a physical erosion model.
88
-
89
- Dask inputs retain time chunks and fill lazily after the 2-D validity mask
90
- is computed; each spatial grid is rechunked as a whole. Callers can share
91
- `weight_cache={}` within one batch of variables. Cache keys include the
92
- coordinates, mask and parameters, and the caller releases the cache at the
93
- end of the batch. No global cache or new dependency is added.
94
-
95
- To apply one set of significant-wave-height boundary indices to wind sea,
96
- swell, directions and periods, pass the same 2-D `reference` and batch cache:
97
-
98
- ```python
99
- import numpy as np
100
- import xarray as xr
101
-
102
- reference = xr.where(np.isfinite(swh).any("time"), 1.0, np.nan).compute()
103
- weights = {}
104
- filled_height = erosion_fill_dataarray(swh, 1, 16, 3, reference=reference, weight_cache=weights)
105
- filled_swell = erosion_fill_dataarray(swell, 1, 16, 3, reference=reference, weight_cache=weights)
106
- ```
107
-
108
- The reference must have exactly the same spatial dimensions and coordinates.
109
- Its finite cells define the existing domain; only its missing boundary cells
110
- can become targets. Component-only holes within the valid reference domain
111
- are preserved. Every field keeps existing valid values, checks its own donor
112
- count and uses its own donor values; directions still require circular means.
113
- Providing a reference does not replace missing component values with total
114
- wave-height values. Omitting it preserves the field-specific default above.
115
-
116
- For NumPy or masked arrays, `erosion_via_id(weights, values,
117
- is_direction=True, min_valid=3)` exposes the same circular mean and
118
- per-frame threshold. Omitting the new options preserves existing behavior.
119
-
120
- These APIs require Alaea 2.6.8 or newer. Earlier versions do not include
121
- `erosion_fill_dataarray` or the new optional direction/threshold arguments.
122
- Update downstream dependency constraints and lock files when upgrading.
123
-
124
- ## Standard atmosphere datasets
125
-
126
- `xr_atmos_dataset` builds any supported combination of wind, 2 metre air
127
- temperature, per-period precipitation, mean sea-level pressure, visibility,
128
- entire-atmosphere total cloud cover, hourly sunshine duration, 2 metre
129
- relative humidity, surface wind gust, 2 metre dew point temperature, and
130
- 2 metre apparent temperature. The
131
- single-element `xr_wind_dataset`, `xr_air_temperature_dataset`,
132
- `xr_precipitation_dataset`, and `xr_slp_dataset` interfaces use the same
133
- metadata and encoding path. Integer packing is enabled by default and can be
134
- disabled with `_COMPRESS=False` when a caller needs to apply it after merging.
135
- `_TIME_type="str"` writes a NetCDF string variable, while `"char"` writes a
136
- fixed character matrix with a `DateStr` dimension. `write_netcdf` uses zlib by
137
- default; `write_netcdf(ds, path, compression="zstd")` selects standard HDF5
138
- Zstd filter 32015 with byte shuffle and fails clearly when its reader/writer
139
- plugin is unavailable.
140
-
141
- `run_storage_fallback` executes an explicit storage method or an ordered
142
- `AUTO` method list. Applications provide their own operations and recoverable
143
- error boundary, so input staging and output publication can share fallback
144
- policy without sharing incompatible lifecycle code.
145
-
146
- `open_netcdf_input` adds a shared single-file NetCDF reader for direct, local
147
- SSD, memory, named-file, and Linux `O_TMPFILE` modes. For `xarray.open_mfdataset`,
148
- `stage_netcdf_inputs` preserves input order while copying through a bounded
149
- worker pool and removes only its own staged files when the context exits.
150
-
151
- ## Unified spatial interpolation
152
-
153
- `s2s`, `g2s`, `s2g`, and `g2g` use the same argument order. `s` means
154
- scattered points and `g` means a grid. Grid coordinates may be one-dimensional
155
- longitude/latitude axes or matching two-dimensional coordinate arrays.
156
-
157
- ```python
158
- import numpy as np
159
- from Alaea.exutils import g2s, s2g
160
-
161
- lon = np.array([120.0, 121.0])
162
- lat = np.array([30.0, 31.0])
163
- value = np.array([[1.0, 2.0], [3.0, 4.0]])
164
-
165
- point_value = g2s(lon, lat, value, 120.5, 30.5)
166
-
167
- station_lon = np.array([120.0, 121.0, 120.0, 121.0])
168
- station_lat = np.array([30.0, 30.0, 31.0, 31.0])
169
- station_value = np.array([1.0, 2.0, 3.0, 4.0])
170
- grid_value = s2g(station_lon, station_lat, station_value, lon, lat)
171
- ```
172
-
173
- All four functions accept `method="linear"`, `method="nearest"`,
174
- `method="cubic"`, or `method="idw"`. IDW also accepts `neighbors` (default 8)
175
- and `power` (default 2). Data may have leading dimensions such as
176
- `(time, lat, lon)` or `(time, point)`; these dimensions are preserved in the
177
- result.
178
-
179
- ## Coastline filling
180
-
181
- ```python
182
- from Alaea.baysalt.erosion_coastline import erosion_cal_id, erosion_via_id
183
-
184
- weight = erosion_cal_id(lon, lat, value, k=4, judge_num=1, method='np.nan')
185
- filled = erosion_via_id(weight, value)
186
- ```
187
-
188
- `method` may be `np.nan`, `nc.mask`, or `txt.mask`. The input used to calculate
189
- weights must be two-dimensional; applying weights supports any data whose last
190
- two dimensions are latitude and longitude.
191
-
192
- Legacy file-generation helpers remain available from their explicit modules,
193
- for example `Alaea.exutils.Interp.Interp_g2s.Grid2Sca`, but are no longer
194
- re-exported from `Alaea.exutils`; new interpolation code should use the four
195
- unified functions above.
196
-
197
-
198
- ## 天气原始输入 Dataset(2.6.7)
199
-
200
- `xr_atmos_dataset` 可组合构造冻结降水比例、对流降水、降雪水当量、地表/最不稳定气块 CAPE、LI、CIN、边界层高度、冻雨标志和降水类型;没有输入的字段不生成。水当量单位 mm 与雪厚度 cm 明确区分,两个 CAPE 的语义分开命名。
201
-
202
- `add_atmos_accumulation_precision` 复用调用方提供的 GRIB 消息核对单时效累计身份和误差界,不调用外部程序或读取数据文件。`resample_atmos_accumulation` 将起报累计水当量守恒分配到 UTC 目标区间,缺测不补零,超出误差的回退失败;`resample_atmos_category` 保持先前瞬时类别,不插值、不外推,只允许按已知源 packing 半步误差恢复整数。分类输出使用恒等整数 packing,避免压缩后产生小数类别。
203
-
204
- 以上能力只负责科学数组和元数据,不实现天气码算法,不获取在线气象数据。
205
-
206
-
207
- ### 详细变量属性
208
-
209
- 22种大气变量均附 `description`、`units_description`、`temporal_kind`、`physical_range`、`missing_value_description` 和 `time_reference`(内容全部为英文,不写入中文或 `_zh` 属性),保留原CF名称和单位。物理范围使用描述属性,不把物理值域错误写成整数packing空间的 `valid_range`。
210
-
211
- `precipitation_type` 提供ECMWF/ecCodes码表4.201中0–14的 `flag_values/flag_meanings` 和英文逐码解释 `flag_descriptions`;15–191保留、192–254本地使用、255源缺测。0在此解释为无降水;部分其他中心表页将0列为保留,换来源需重新核查。此字段不是WMO天气现象码。
212
-
213
- CIN的通用描述明确区分负浮力功与正能量幅度;来源适配器补充实际 `sign_convention`,不由通用构造器自动改变符号。LI是温差,不能按绝对温标减273.15;降雪水当量是mm,不等于新雪厚度或地面积雪深度。
alaea-2.7.2/README.md DELETED
@@ -1,175 +0,0 @@
1
- # Alaea
2
-
3
- ## Installation
4
-
5
- ```shell
6
- pip3 install Alaea
7
- ```
8
-
9
- KML 转 Shapefile 是可选功能,需要 GDAL:
10
-
11
- ```shell
12
- pip3 install 'Alaea[gdal]'
13
- ```
14
-
15
- ## Release
16
-
17
- Direct execution cleans old artifacts, builds the package, uploads it with
18
- Twine, and cleans the artifacts after a successful upload:
19
-
20
- ```shell
21
- ./run_twine.py
22
- ```
23
-
24
- Use `--repository NAME` to select a configured Twine repository. A failed build
25
- does not attempt upload; a failed upload retains the new archives for diagnosis
26
- and retry. Directly rerunning the script skips files already present on PyPI and
27
- continues uploading the remaining archives.
28
-
29
- ## Coastline boundary filling (2.6.8)
30
-
31
- `Alaea.baysalt.erosion_coastline.erosion_fill_dataarray` fills persistent
32
- missing boundaries in a floating-point xarray DataArray. The last two
33
- axes must be latitude and longitude with finite, unique 1-D coordinates;
34
- a 3-D array uses its first axis as time. Dimension names may vary.
35
-
36
- ```python
37
- from Alaea.baysalt.erosion_coastline import erosion_fill_dataarray
38
-
39
- filled = erosion_fill_dataarray(wave, _times=1, k=16, judge_num=3)
40
- direction = erosion_fill_dataarray(wave_direction, _times=1, k=16, judge_num=3, is_direction=True)
41
- ```
42
-
43
- Only cells missing throughout the supplied time series are candidates.
44
- Existing values and transient gaps are preserved, and each frame must meet
45
- `judge_num` valid neighbors. `k` includes the target itself; `_times=0`
46
- disables filling. Directions use circular averaging and remain missing
47
- when the mean direction is undefined. Distances use the existing planar
48
- longitude/latitude metric, without periodic seam wrapping; this is numerical
49
- boundary extrapolation, not a physical erosion model.
50
-
51
- Dask inputs retain time chunks and fill lazily after the 2-D validity mask
52
- is computed; each spatial grid is rechunked as a whole. Callers can share
53
- `weight_cache={}` within one batch of variables. Cache keys include the
54
- coordinates, mask and parameters, and the caller releases the cache at the
55
- end of the batch. No global cache or new dependency is added.
56
-
57
- To apply one set of significant-wave-height boundary indices to wind sea,
58
- swell, directions and periods, pass the same 2-D `reference` and batch cache:
59
-
60
- ```python
61
- import numpy as np
62
- import xarray as xr
63
-
64
- reference = xr.where(np.isfinite(swh).any("time"), 1.0, np.nan).compute()
65
- weights = {}
66
- filled_height = erosion_fill_dataarray(swh, 1, 16, 3, reference=reference, weight_cache=weights)
67
- filled_swell = erosion_fill_dataarray(swell, 1, 16, 3, reference=reference, weight_cache=weights)
68
- ```
69
-
70
- The reference must have exactly the same spatial dimensions and coordinates.
71
- Its finite cells define the existing domain; only its missing boundary cells
72
- can become targets. Component-only holes within the valid reference domain
73
- are preserved. Every field keeps existing valid values, checks its own donor
74
- count and uses its own donor values; directions still require circular means.
75
- Providing a reference does not replace missing component values with total
76
- wave-height values. Omitting it preserves the field-specific default above.
77
-
78
- For NumPy or masked arrays, `erosion_via_id(weights, values,
79
- is_direction=True, min_valid=3)` exposes the same circular mean and
80
- per-frame threshold. Omitting the new options preserves existing behavior.
81
-
82
- These APIs require Alaea 2.6.8 or newer. Earlier versions do not include
83
- `erosion_fill_dataarray` or the new optional direction/threshold arguments.
84
- Update downstream dependency constraints and lock files when upgrading.
85
-
86
- ## Standard atmosphere datasets
87
-
88
- `xr_atmos_dataset` builds any supported combination of wind, 2 metre air
89
- temperature, per-period precipitation, mean sea-level pressure, visibility,
90
- entire-atmosphere total cloud cover, hourly sunshine duration, 2 metre
91
- relative humidity, surface wind gust, 2 metre dew point temperature, and
92
- 2 metre apparent temperature. The
93
- single-element `xr_wind_dataset`, `xr_air_temperature_dataset`,
94
- `xr_precipitation_dataset`, and `xr_slp_dataset` interfaces use the same
95
- metadata and encoding path. Integer packing is enabled by default and can be
96
- disabled with `_COMPRESS=False` when a caller needs to apply it after merging.
97
- `_TIME_type="str"` writes a NetCDF string variable, while `"char"` writes a
98
- fixed character matrix with a `DateStr` dimension. `write_netcdf` uses zlib by
99
- default; `write_netcdf(ds, path, compression="zstd")` selects standard HDF5
100
- Zstd filter 32015 with byte shuffle and fails clearly when its reader/writer
101
- plugin is unavailable.
102
-
103
- `run_storage_fallback` executes an explicit storage method or an ordered
104
- `AUTO` method list. Applications provide their own operations and recoverable
105
- error boundary, so input staging and output publication can share fallback
106
- policy without sharing incompatible lifecycle code.
107
-
108
- `open_netcdf_input` adds a shared single-file NetCDF reader for direct, local
109
- SSD, memory, named-file, and Linux `O_TMPFILE` modes. For `xarray.open_mfdataset`,
110
- `stage_netcdf_inputs` preserves input order while copying through a bounded
111
- worker pool and removes only its own staged files when the context exits.
112
-
113
- ## Unified spatial interpolation
114
-
115
- `s2s`, `g2s`, `s2g`, and `g2g` use the same argument order. `s` means
116
- scattered points and `g` means a grid. Grid coordinates may be one-dimensional
117
- longitude/latitude axes or matching two-dimensional coordinate arrays.
118
-
119
- ```python
120
- import numpy as np
121
- from Alaea.exutils import g2s, s2g
122
-
123
- lon = np.array([120.0, 121.0])
124
- lat = np.array([30.0, 31.0])
125
- value = np.array([[1.0, 2.0], [3.0, 4.0]])
126
-
127
- point_value = g2s(lon, lat, value, 120.5, 30.5)
128
-
129
- station_lon = np.array([120.0, 121.0, 120.0, 121.0])
130
- station_lat = np.array([30.0, 30.0, 31.0, 31.0])
131
- station_value = np.array([1.0, 2.0, 3.0, 4.0])
132
- grid_value = s2g(station_lon, station_lat, station_value, lon, lat)
133
- ```
134
-
135
- All four functions accept `method="linear"`, `method="nearest"`,
136
- `method="cubic"`, or `method="idw"`. IDW also accepts `neighbors` (default 8)
137
- and `power` (default 2). Data may have leading dimensions such as
138
- `(time, lat, lon)` or `(time, point)`; these dimensions are preserved in the
139
- result.
140
-
141
- ## Coastline filling
142
-
143
- ```python
144
- from Alaea.baysalt.erosion_coastline import erosion_cal_id, erosion_via_id
145
-
146
- weight = erosion_cal_id(lon, lat, value, k=4, judge_num=1, method='np.nan')
147
- filled = erosion_via_id(weight, value)
148
- ```
149
-
150
- `method` may be `np.nan`, `nc.mask`, or `txt.mask`. The input used to calculate
151
- weights must be two-dimensional; applying weights supports any data whose last
152
- two dimensions are latitude and longitude.
153
-
154
- Legacy file-generation helpers remain available from their explicit modules,
155
- for example `Alaea.exutils.Interp.Interp_g2s.Grid2Sca`, but are no longer
156
- re-exported from `Alaea.exutils`; new interpolation code should use the four
157
- unified functions above.
158
-
159
-
160
- ## 天气原始输入 Dataset(2.6.7)
161
-
162
- `xr_atmos_dataset` 可组合构造冻结降水比例、对流降水、降雪水当量、地表/最不稳定气块 CAPE、LI、CIN、边界层高度、冻雨标志和降水类型;没有输入的字段不生成。水当量单位 mm 与雪厚度 cm 明确区分,两个 CAPE 的语义分开命名。
163
-
164
- `add_atmos_accumulation_precision` 复用调用方提供的 GRIB 消息核对单时效累计身份和误差界,不调用外部程序或读取数据文件。`resample_atmos_accumulation` 将起报累计水当量守恒分配到 UTC 目标区间,缺测不补零,超出误差的回退失败;`resample_atmos_category` 保持先前瞬时类别,不插值、不外推,只允许按已知源 packing 半步误差恢复整数。分类输出使用恒等整数 packing,避免压缩后产生小数类别。
165
-
166
- 以上能力只负责科学数组和元数据,不实现天气码算法,不获取在线气象数据。
167
-
168
-
169
- ### 详细变量属性
170
-
171
- 22种大气变量均附 `description`、`units_description`、`temporal_kind`、`physical_range`、`missing_value_description` 和 `time_reference`(内容全部为英文,不写入中文或 `_zh` 属性),保留原CF名称和单位。物理范围使用描述属性,不把物理值域错误写成整数packing空间的 `valid_range`。
172
-
173
- `precipitation_type` 提供ECMWF/ecCodes码表4.201中0–14的 `flag_values/flag_meanings` 和英文逐码解释 `flag_descriptions`;15–191保留、192–254本地使用、255源缺测。0在此解释为无降水;部分其他中心表页将0列为保留,换来源需重新核查。此字段不是WMO天气现象码。
174
-
175
- CIN的通用描述明确区分负浮力功与正能量幅度;来源适配器补充实际 `sign_convention`,不由通用构造器自动改变符号。LI是温差,不能按绝对温标减273.15;降雪水当量是mm,不等于新雪厚度或地面积雪深度。
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes