rda-python-icoads 3.0.0__py3-none-any.whl → 3.0.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -233,11 +233,15 @@ class FillItable(PgIMMA):
233
233
  else:
234
234
  self.pglog("{}({}): index counted already between {} and {}".format(var, val, pgrec['imin'], pgrec['imax']), self.LOGWRN)
235
235
 
236
- cnt = 0
236
+ cnt = ncnt = 0
237
237
  for val in records:
238
238
  pgrec = records[val]
239
+ if not pgrec:
240
+ ncnt += 1 # counted already; nothing to add
241
+ continue
239
242
  cnt += self.pgupdt(vtable, pgrec, "{} = {}".format(var, val), self.LGEREX)
240
243
 
244
+ if ncnt: self.pglog("{}: nothing to add for {} values counted already".format(vtable, ncnt), self.LOGWRN)
241
245
  self.pglog("{} of {} values recounted in table '{}'".format(cnt, vcnt, vtable), self.LOGWRN)
242
246
 
243
247
  #
@@ -24,7 +24,7 @@ class FillMonth(PgUtil):
24
24
  def __init__(self):
25
25
  super().__init__()
26
26
  self.CMDS = {
27
- 'filename' : "IMMA1_R3.0.2_",
27
+ 'filenames' : ["IMMA1_R3.0.2_", "IMMA1_R3.0.3_"], # IMMA1_R3.0.3_ since 2025-08
28
28
  'fillicoads' : "fillicoads -i ",
29
29
  'fillitable' : "fillitable -t -v dck pt sid -r ",
30
30
  'cdmsmonth' : "cdmsmonth "
@@ -64,17 +64,31 @@ class FillMonth(PgUtil):
64
64
  self.cmdlog()
65
65
  sys.exit(0)
66
66
 
67
+ #
68
+ # locate the monthly IMMA1 file, gunzip it if only the gzipped one is on file
69
+ #
70
+ def get_monthly_file(self, smonth):
71
+
72
+ files = [fname + smonth for fname in self.CMDS['filenames']]
73
+
74
+ for file in files:
75
+ if op.isfile(file): return file
76
+
77
+ for file in files:
78
+ zfile = file + ".gz"
79
+ if op.isfile(zfile):
80
+ self.pgsystem("gunzip " + zfile, self.LGEREX, 5)
81
+ return file
82
+
83
+ self.pglog("Miss monthly IMMA1 file, gzipped or not, in {}: {}".format(
84
+ op.abspath('.'), ', '.join(files)), self.LGEREX)
85
+
67
86
  #
68
87
  # fill monthly IMMA1 data to IVADDB
69
88
  #
70
89
  def fill_monthly_data(self, smonth, srange):
71
90
 
72
- file = self.CMDS['filename'] + smonth
73
-
74
- if not op.isfile(file):
75
- # unzip file
76
- cmd = "gunzip {}.gz".format(file)
77
- self.pgsystem(cmd, self.LGWNEX, 5)
91
+ file = self.get_monthly_file(smonth)
78
92
 
79
93
  # fillicoads
80
94
  cmd = self.CMDS['fillicoads'] + file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_icoads
3
- Version: 3.0.0
3
+ Version: 3.0.2
4
4
  Summary: RDA python package to manage RDA ICOADS datasets
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-icoads
@@ -11,6 +11,7 @@ Classifier: Development Status :: 5 - Production/Stable
11
11
  Requires-Python: >=3.7
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
+ Requires-Dist: numpy
14
15
  Requires-Dist: rda_python_common>=3.0.14
15
16
  Requires-Dist: rda_python_dsrqst>=2.0.4
16
17
  Dynamic: license-file
@@ -10,8 +10,8 @@ rda_python_icoads/counticoads.py,sha256=7SMu2HJBvUSmmThkNitAdvdyk7aO9dWKvdSv6VGB
10
10
  rda_python_icoads/countsst.py,sha256=3jLrZUqlrZBVt9ib7nBO6n1D6jPL0T9Esu_elntHMDg,7170
11
11
  rda_python_icoads/fillicoads.py,sha256=DzveAwULO8dDnooSMmEiGiS8k0lIa1qW9G7kTmyeH-k,6082
12
12
  rda_python_icoads/fillinventory.py,sha256=cDcfjPAF2Ir991xO9PNMiGSB9boLCUj8txKAw3D_yzI,4617
13
- rda_python_icoads/fillitable.py,sha256=LRXXF0YbSKp40Yerwt_aIsDO7fsPQDvhARWoBJ6bHPI,10957
14
- rda_python_icoads/fillmonth.py,sha256=WDP6m6rWW59mCPnQ-ruAeLFnw2U8Dlm6OOFAGEnA1h0,2912
13
+ rda_python_icoads/fillitable.py,sha256=QpatUrSbIHcs-BCL8dBfZCM4FnQWwhArWnENhmvBZUQ,11178
14
+ rda_python_icoads/fillmonth.py,sha256=jeelzcSFic29-R5JoaKr87iDygha0b9AaHSRbxxPluY,3405
15
15
  rda_python_icoads/fixiidx.py,sha256=5k6Intm4Zw5mAik-W-lnj167_YloP5THqaY96TMP4Mw,2333
16
16
  rda_python_icoads/imma1_subset.py,sha256=IX8vAdViFtcG3ai0_FQSro9038D2cRDcQdezUrNA6Kg,27566
17
17
  rda_python_icoads/maxsst.py,sha256=TroXmOKvy2VS0l6ILPJmVfVvDTynma_yoilaVDMXCZ8,9108
@@ -23,9 +23,9 @@ rda_python_icoads/msgsubset.f,sha256=KuM2WAk0ZFEH8LBhHKiGWt8zaW_0ARJXYV2kiD5w5xs
23
23
  rda_python_icoads/pg_imma.py,sha256=JBNBcCCnZCOcozi0rok149ahY2j0I7pX2lzGbmcvVe4,65727
24
24
  rda_python_icoads/rdimma1_csv.f,sha256=_hOHvA0UiTykCIsj7ZYkmooNmUq29-p7ZnyjeSyvt8U,22443
25
25
  rda_python_icoads/writeicoads.py,sha256=HQqTp4m2erTV1bOkkBJZwDH6ispJPutPM3ZA8Y_giKI,5841
26
- rda_python_icoads-3.0.0.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
27
- rda_python_icoads-3.0.0.dist-info/METADATA,sha256=0Cq8RLLvJwIRTOEE5XbxTq2XRwESV6IeIExQKTe_8S8,3011
28
- rda_python_icoads-3.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
29
- rda_python_icoads-3.0.0.dist-info/entry_points.txt,sha256=RrLvvQNiBddv_LCYU9b49Zm3fpSl53DBOUXi22SVcE0,776
30
- rda_python_icoads-3.0.0.dist-info/top_level.txt,sha256=PjJe4PwUIiNxPlNg2d8JNPY1SLSu-_GHAdXe-hUVU1U,18
31
- rda_python_icoads-3.0.0.dist-info/RECORD,,
26
+ rda_python_icoads-3.0.2.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
27
+ rda_python_icoads-3.0.2.dist-info/METADATA,sha256=YTUMsMMiw0DDhPO7NpElRNE2m_MIbBgXPLBNvCietvI,3032
28
+ rda_python_icoads-3.0.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
29
+ rda_python_icoads-3.0.2.dist-info/entry_points.txt,sha256=RrLvvQNiBddv_LCYU9b49Zm3fpSl53DBOUXi22SVcE0,776
30
+ rda_python_icoads-3.0.2.dist-info/top_level.txt,sha256=PjJe4PwUIiNxPlNg2d8JNPY1SLSu-_GHAdXe-hUVU1U,18
31
+ rda_python_icoads-3.0.2.dist-info/RECORD,,