oafuncs 0.0.98.32__tar.gz → 0.0.98.34__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 (54) hide show
  1. {oafuncs-0.0.98.32/oafuncs.egg-info → oafuncs-0.0.98.34}/PKG-INFO +1 -1
  2. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/data_interp.py +0 -15
  3. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/netcdf_modify.py +0 -15
  4. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/plot_dataset.py +1 -1
  5. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/replace_file_content.py +0 -15
  6. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_cmap.py +10 -1
  7. oafuncs-0.0.98.34/oafuncs/oa_down/__init__.py +8 -0
  8. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/hycom_3hourly.py +4 -1
  9. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/hycom_3hourly_proxy.py +0 -17
  10. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/idm.py +0 -17
  11. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/literature.py +0 -15
  12. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/read_proxy.py +0 -15
  13. oafuncs-0.0.98.34/oafuncs/oa_down/user_agent.py +17 -0
  14. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_draw.py +34 -78
  15. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_help.py +0 -15
  16. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_python.py +0 -15
  17. oafuncs-0.0.98.34/oafuncs/oa_sign/__init__.py +6 -0
  18. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_sign/meteorological.py +0 -16
  19. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_sign/ocean.py +0 -16
  20. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_sign/scientific.py +0 -16
  21. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34/oafuncs.egg-info}/PKG-INFO +1 -1
  22. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/setup.py +1 -1
  23. oafuncs-0.0.98.32/oafuncs/oa_down/__init__.py +0 -22
  24. oafuncs-0.0.98.32/oafuncs/oa_down/user_agent.py +0 -31
  25. oafuncs-0.0.98.32/oafuncs/oa_sign/__init__.py +0 -21
  26. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/LICENSE.txt +0 -0
  27. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/MANIFEST.in +0 -0
  28. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/README.md +0 -0
  29. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/__init__.py +0 -0
  30. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_data/hycom.png +0 -0
  31. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_data/oafuncs.png +0 -0
  32. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/cprogressbar.py +0 -0
  33. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/email.py +0 -0
  34. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/netcdf_merge.py +0 -0
  35. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/netcdf_write.py +0 -0
  36. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/parallel.py +0 -0
  37. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/_script/parallel_test.py +0 -0
  38. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_data.py +0 -0
  39. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_date.py +0 -0
  40. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/User_Agent-list.txt +0 -0
  41. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_down/test_ua.py +0 -0
  42. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_file.py +0 -0
  43. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_model/__init__.py +0 -0
  44. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_model/roms/__init__.py +0 -0
  45. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_model/roms/test.py +0 -0
  46. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_model/wrf/__init__.py +0 -0
  47. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_model/wrf/little_r.py +0 -0
  48. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_nc.py +0 -0
  49. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs/oa_tool.py +0 -0
  50. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs.egg-info/SOURCES.txt +0 -0
  51. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs.egg-info/dependency_links.txt +0 -0
  52. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs.egg-info/requires.txt +0 -0
  53. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/oafuncs.egg-info/top_level.txt +0 -0
  54. {oafuncs-0.0.98.32 → oafuncs-0.0.98.34}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oafuncs
3
- Version: 0.0.98.32
3
+ Version: 0.0.98.34
4
4
  Summary: Oceanic and Atmospheric Functions
5
5
  Home-page: https://github.com/Industry-Pays/OAFuncs
6
6
  Author: Kun Liu
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-04-25 16:22:52
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-26 19:21:31
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\_script\\data_interp.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  from typing import List, Union
17
2
 
18
3
  import numpy as np
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-04-05 14:00:50
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-05 14:00:50
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\_script\\netcdf_modify.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  import os
17
2
 
18
3
  import netCDF4 as nc
@@ -91,7 +91,7 @@ def plot_2d(data: xr.DataArray, output_path: str, data_range: Optional[Tuple[flo
91
91
  lon_lat_ratio = np.abs(np.max(lon_range) - np.min(lon_range)) / (np.max(lat_range) - np.min(lat_range))
92
92
  figsize = (10, 10 / lon_lat_ratio)
93
93
  fig, ax = plt.subplots(figsize=figsize, subplot_kw={"projection": ccrs.PlateCarree()})
94
- oafuncs.oa_draw.add_cartopy(ax, lon_range, lat_range)
94
+ oafuncs.oa_draw.setup_map(ax, lon_range, lat_range)
95
95
  else:
96
96
  fig, ax = plt.subplots(figsize=(10, 8))
97
97
 
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-03-21 10:02:32
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-03-21 10:02:33
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\_script\\replace_file_concent.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  import datetime
17
2
  import os
18
3
  import re
@@ -3,8 +3,9 @@ from typing import List, Optional, Union
3
3
  import matplotlib as mpl
4
4
  import matplotlib.pyplot as plt
5
5
  import numpy as np
6
+ import random
6
7
 
7
- __all__ = ["show", "to_color", "create", "get"]
8
+ __all__ = ["show", "to_color", "create", "get", "random_color"]
8
9
 
9
10
 
10
11
  # ** 将cmap用填色图可视化(官网摘抄函数)
@@ -304,6 +305,14 @@ def get(colormap_name: Optional[str] = None, show_available: bool = False) -> Op
304
305
  return mpl.colormaps.get_cmap("rainbow") # 默认返回 'rainbow'
305
306
 
306
307
 
308
+ # ** 生成随机颜色
309
+ def random_color():
310
+ """Generate a random color in hexadecimal format."""
311
+ r = random.randint(0, 255)
312
+ g = random.randint(0, 255)
313
+ b = random.randint(0, 255)
314
+ return f"#{r:02x}{g:02x}{b:02x}"
315
+
307
316
  if __name__ == "__main__":
308
317
  # ** 测试自制cmap
309
318
  colors = ["#C2B7F3", "#B3BBF2", "#B0CBF1", "#ACDCF0", "#A8EEED"]
@@ -0,0 +1,8 @@
1
+
2
+ # from .love_ocean import sign as love_ocean
3
+ # from .meteorological_home import sign as meteorological_home
4
+
5
+ from .hycom_3hourly import *
6
+ from .literature import *
7
+ from .user_agent import *
8
+ from .idm import *
@@ -733,6 +733,7 @@ class _HycomDownloader:
733
733
  logging.error(f"Giving up on {file_name}")
734
734
  self.count["fail"] += 1
735
735
  count_dict["fail"] += 1
736
+ count_dict["fail_data_list"].append(file_name)
736
737
  timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S,%f")[:-3]
737
738
  # print(f"{timestamp} - ERROR - ", end="")
738
739
  # print("[bold red]Failed")
@@ -1091,7 +1092,7 @@ def download(
1091
1092
  end_time += "21"
1092
1093
 
1093
1094
  global count_dict
1094
- count_dict = {"success": 0, "fail": 0, "skip": 0, "no_data": 0, "total": 0, "no_data_list": []}
1095
+ count_dict = {"success": 0, "fail": 0, "skip": 0, "no_data": 0, "total": 0, "no_data_list": [], "fail_data_list": []}
1095
1096
 
1096
1097
  global fsize_dict
1097
1098
  fsize_dict = {}
@@ -1162,6 +1163,8 @@ def download(
1162
1163
  print("[bold #ecdbfe]=" * mark_len)
1163
1164
  if count_dict["fail"] > 0:
1164
1165
  print("[bold #be5528]Please try again to download the failed data later.")
1166
+ for fail_data in count_dict["fail_data_list"]:
1167
+ print(f"[bold #d81b60]{fail_data}")
1165
1168
  if count_dict["no_data"] > 0:
1166
1169
  print(f"[bold #f90000]{count_dict['no_data']} data entries do not exist in any dataset or version.")
1167
1170
  for no_data in count_dict["no_data_list"]:
@@ -1,20 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-04-17 15:16:02
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-17 15:16:04
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\hycom_3hourly copy.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
-
17
-
18
1
  import asyncio
19
2
  import datetime
20
3
  import logging
@@ -1,20 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-03-27 16:51:26
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-07 13:38:27
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\idm.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
-
17
-
18
1
  import datetime
19
2
  import os
20
3
  from subprocess import call
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-11-28 10:42:56
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-01-05 10:51:42
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\literature.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  import os
17
2
  import re
18
3
  import time
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-04-17 13:59:14
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-17 14:00:38
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\read_proxy.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  import threading
17
2
  from queue import Queue
18
3
  import random
@@ -0,0 +1,17 @@
1
+ import os
2
+ import random
3
+
4
+
5
+ __all__ = ["get_ua"]
6
+
7
+
8
+ def get_ua():
9
+ current_dir = os.path.dirname(os.path.abspath(__file__))
10
+ ua_file_txt = os.path.join(current_dir, "User_Agent-list.txt")
11
+
12
+ with open(ua_file_txt, "r") as f:
13
+ ua_list = f.readlines()
14
+ # 去掉换行符和空行
15
+ ua_list = [line.strip() for line in ua_list if line.strip()]
16
+
17
+ return random.choice(ua_list)
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-09-17 17:26:11
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-11-21 13:10:47
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_draw.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.11
14
- """
15
-
16
1
  import warnings
17
2
 
18
3
  import cartopy.crs as ccrs
@@ -246,58 +231,7 @@ def setup_map(
246
231
  right_labels: bool = False,
247
232
  top_labels: bool = False,
248
233
  ) -> plt.Axes:
249
- """Setup a complete cartopy map with customizable features.
250
-
251
- Args:
252
- axes (plt.Axes): The axes to setup as a map.
253
- longitude_data (np.ndarray, optional): Array of longitudes to set map extent.
254
- latitude_data (np.ndarray, optional): Array of latitudes to set map extent.
255
- map_projection (ccrs.Projection, optional): Coordinate reference system. Defaults to PlateCarree.
256
-
257
- show_land (bool, optional): Whether to show land features. Defaults to True.
258
- show_ocean (bool, optional): Whether to show ocean features. Defaults to True.
259
- show_coastline (bool, optional): Whether to show coastlines. Defaults to True.
260
- show_borders (bool, optional): Whether to show country borders. Defaults to False.
261
- land_color (str, optional): Color of land. Defaults to "lightgrey".
262
- ocean_color (str, optional): Color of oceans. Defaults to "lightblue".
263
- coastline_linewidth (float, optional): Line width for coastlines. Defaults to 0.5.
264
-
265
- show_gridlines (bool, optional): Whether to show gridlines. Defaults to False.
266
- longitude_ticks (list[float], optional): Longitude tick positions.
267
- latitude_ticks (list[float], optional): Latitude tick positions.
268
- tick_decimals (int, optional): Number of decimal places for tick labels. Defaults to 0.
269
-
270
- grid_color (str, optional): Gridline color. Defaults to "k".
271
- grid_alpha (float, optional): Gridline transparency. Defaults to 0.5.
272
- grid_style (str, optional): Gridline style. Defaults to "--".
273
- grid_width (float, optional): Gridline width. Defaults to 0.5.
274
-
275
- show_labels (bool, optional): Whether to show coordinate labels. Defaults to True.
276
- left_labels (bool, optional): Show labels on left side. Defaults to True.
277
- bottom_labels (bool, optional): Show labels on bottom. Defaults to True.
278
- right_labels (bool, optional): Show labels on right side. Defaults to False.
279
- top_labels (bool, optional): Show labels on top. Defaults to False.
280
-
281
- Returns:
282
- plt.Axes: The configured map axes.
283
-
284
- Examples:
285
- >>> # Basic map setup
286
- >>> ax = setup_map(ax)
287
-
288
- >>> # Map with gridlines and custom extent
289
- >>> ax = setup_map(ax, longitude_data=lon, latitude_data=lat, show_gridlines=True)
290
-
291
- >>> # Customized map
292
- >>> ax = setup_map(
293
- ... ax,
294
- ... show_gridlines=True,
295
- ... longitude_ticks=[0, 30, 60],
296
- ... latitude_ticks=[-30, 0, 30],
297
- ... land_color='wheat',
298
- ... ocean_color='lightcyan'
299
- ... )
300
- """
234
+ """Setup a complete cartopy map with customizable features."""
301
235
  from matplotlib import ticker as mticker
302
236
 
303
237
  # Add map features
@@ -337,11 +271,20 @@ def setup_map(
337
271
 
338
272
  elif show_labels:
339
273
  # Add tick labels without gridlines
340
- # Use current tick positions if not provided
274
+ # Generate default tick positions based on current extent if not provided
341
275
  if longitude_ticks is None:
342
- longitude_ticks = axes.get_xticks()
276
+ current_extent = axes.get_extent(crs=map_projection)
277
+ lon_range = current_extent[1] - current_extent[0]
278
+ # Generate reasonable tick spacing
279
+ tick_spacing = 1 if lon_range <= 10 else (5 if lon_range <= 30 else (10 if lon_range <= 90 else 20))
280
+ longitude_ticks = np.arange(np.ceil(current_extent[0] / tick_spacing) * tick_spacing, current_extent[1] + tick_spacing, tick_spacing)
281
+
343
282
  if latitude_ticks is None:
344
- latitude_ticks = axes.get_yticks()
283
+ current_extent = axes.get_extent(crs=map_projection)
284
+ lat_range = current_extent[3] - current_extent[2]
285
+ # Generate reasonable tick spacing
286
+ tick_spacing = 1 if lat_range <= 10 else (5 if lat_range <= 30 else (10 if lat_range <= 90 else 20))
287
+ latitude_ticks = np.arange(np.ceil(current_extent[2] / tick_spacing) * tick_spacing, current_extent[3] + tick_spacing, tick_spacing)
345
288
 
346
289
  # Set tick positions and formatters
347
290
  axes.set_xticks(longitude_ticks, crs=map_projection)
@@ -349,12 +292,25 @@ def setup_map(
349
292
  axes.xaxis.set_major_formatter(lon_formatter)
350
293
  axes.yaxis.set_major_formatter(lat_formatter)
351
294
 
352
- # Set map extent if data is provided
353
- if longitude_data is not None and latitude_data is not None:
354
- lon_min, lon_max = np.nanmin(longitude_data), np.nanmax(longitude_data)
355
- lat_min, lat_max = np.nanmin(latitude_data), np.nanmax(latitude_data)
356
- axes.set_extent([lon_min, lon_max, lat_min, lat_max], crs=map_projection)
295
+ # Control label visibility based on input parameters
296
+ axes.tick_params(axis="x", labelbottom=bottom_labels, labeltop=top_labels)
297
+ axes.tick_params(axis="y", labelleft=left_labels, labelright=right_labels)
357
298
 
299
+ # 只要传入经纬度数据就自动设置范围
300
+ # 范围必须在cartopy添加地图特征之后设置,因为添加特征可能会改变axes的范围
301
+ if longitude_data is not None and latitude_data is not None:
302
+ # 过滤掉NaN,避免极端值影响
303
+ lon_data = np.asarray(longitude_data)
304
+ lat_data = np.asarray(latitude_data)
305
+ lon_valid = lon_data[~np.isnan(lon_data)]
306
+ lat_valid = lat_data[~np.isnan(lat_data)]
307
+ if lon_valid.size > 0 and lat_valid.size > 0:
308
+ lon_min, lon_max = np.min(lon_valid), np.max(lon_valid)
309
+ lat_min, lat_max = np.min(lat_valid), np.max(lat_valid)
310
+ axes.set_extent([lon_min, lon_max, lat_min, lat_max], crs=map_projection)
311
+ else:
312
+ # 若全是NaN则不设置范围
313
+ pass
358
314
  return axes
359
315
 
360
316
 
@@ -379,14 +335,14 @@ class MidpointNormalize(mpl.colors.Normalize):
379
335
  # Use the clip parameter from initialization if not provided
380
336
  if clip is None:
381
337
  clip = self.clip
382
-
338
+
383
339
  x, y = [self.vmin, self.vcenter, self.vmax], [0, 0.5, 1.0]
384
340
  result = np.interp(value, x, y)
385
-
341
+
386
342
  # Apply clipping if requested
387
343
  if clip:
388
344
  result = np.clip(result, 0, 1)
389
-
345
+
390
346
  return np.ma.masked_array(result)
391
347
 
392
348
  def inverse(self, value: np.ndarray) -> np.ndarray:
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-10-06 19:25:29
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-01-01 21:09:58
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_help.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  import oafuncs
17
2
  import pkgutil
18
3
  import importlib
@@ -1,18 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2025-03-27 16:51:26
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-05 14:17:07
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_python.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
-
16
1
  import os
17
2
  from typing import List, Optional
18
3
 
@@ -0,0 +1,6 @@
1
+ # from .love_ocean import sign as love_ocean
2
+ # from .meteorological_home import sign as meteorological_home
3
+
4
+ from .ocean import *
5
+ from .meteorological import *
6
+ from .scientific import *
@@ -1,19 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- '''
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-10-14 16:14:50
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2025-04-04 20:37:13
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_sign\\meteorological.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.11
14
- '''
15
-
16
-
17
1
  import warnings
18
2
  from rich import print
19
3
  from bs4 import BeautifulSoup
@@ -1,19 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- '''
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-10-14 16:59:26
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-11-21 13:16:14
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_sign\\ocean.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.11
14
- '''
15
-
16
-
17
1
  import hashlib
18
2
  import time
19
3
  import warnings
@@ -1,19 +1,3 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- '''
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-10-14 18:29:52
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-10-14 18:57:39
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\OAFuncs\\oa_sign\\scientific.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.11
14
- '''
15
-
16
-
17
1
  import time
18
2
 
19
3
  import requests
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oafuncs
3
- Version: 0.0.98.32
3
+ Version: 0.0.98.34
4
4
  Summary: Oceanic and Atmospheric Functions
5
5
  Home-page: https://github.com/Industry-Pays/OAFuncs
6
6
  Author: Kun Liu
@@ -18,7 +18,7 @@ URL = "https://github.com/Industry-Pays/OAFuncs"
18
18
  EMAIL = "liukun0312@stu.ouc.edu.cn"
19
19
  AUTHOR = "Kun Liu"
20
20
  REQUIRES_PYTHON = ">=3.10.0" # 2025/03/13
21
- VERSION = "0.0.98.32"
21
+ VERSION = "0.0.98.34"
22
22
 
23
23
  # What packages are required for this module to be executed?
24
24
  REQUIRED = [
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-09-17 16:09:20
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-12-26 08:09:01
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\__init__.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.11
14
- """
15
-
16
- # from .love_ocean import sign as love_ocean
17
- # from .meteorological_home import sign as meteorological_home
18
-
19
- from .hycom_3hourly import *
20
- from .literature import *
21
- from .user_agent import *
22
- from .idm import *
@@ -1,31 +0,0 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- """
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-12-26 08:06:34
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-12-26 08:06:34
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\oafuncs\\oa_down\\user_agent.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.12
14
- """
15
- import os
16
- import random
17
-
18
-
19
- __all__ = ["get_ua"]
20
-
21
-
22
- def get_ua():
23
- current_dir = os.path.dirname(os.path.abspath(__file__))
24
- ua_file_txt = os.path.join(current_dir, "User_Agent-list.txt")
25
-
26
- with open(ua_file_txt, "r") as f:
27
- ua_list = f.readlines()
28
- # 去掉换行符和空行
29
- ua_list = [line.strip() for line in ua_list if line.strip()]
30
-
31
- return random.choice(ua_list)
@@ -1,21 +0,0 @@
1
- #!/usr/bin/env python
2
- # coding=utf-8
3
- '''
4
- Author: Liu Kun && 16031215@qq.com
5
- Date: 2024-09-17 16:09:20
6
- LastEditors: Liu Kun && 16031215@qq.com
7
- LastEditTime: 2024-10-14 18:12:12
8
- FilePath: \\Python\\My_Funcs\\OAFuncs\\OAFuncs\\oa_sign\\__init__.py
9
- Description:
10
- EditPlatform: vscode
11
- ComputerInfo: XPS 15 9510
12
- SystemInfo: Windows 11
13
- Python Version: 3.11
14
- '''
15
-
16
- # from .love_ocean import sign as love_ocean
17
- # from .meteorological_home import sign as meteorological_home
18
-
19
- from .ocean import *
20
- from .meteorological import *
21
- from .scientific import *
File without changes
File without changes
File without changes
File without changes