rda-python-icoads 1.0.12__tar.gz → 1.0.14__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.
Potentially problematic release.
This version of rda-python-icoads might be problematic. Click here for more details.
- {rda_python_icoads-1.0.12/src/rda_python_icoads.egg-info → rda_python_icoads-1.0.14}/PKG-INFO +1 -1
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/pyproject.toml +1 -1
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/cleanicoads.py +4 -3
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/fillicoads.py +32 -20
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14/src/rda_python_icoads.egg-info}/PKG-INFO +1 -1
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/LICENSE +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/MANIFEST.in +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/README.md +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/setup.cfg +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/PgIMMA.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/R3.0-stat_doc.pdf +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/README_R3.0_Subset.html +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/__init__.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/checkicoads.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/countattm.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/countattmvar.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/counticoads.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/countsst.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/fillinventory.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/fillitable.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/fillmonth.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/fixiidx.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/imma1_subset.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/maxsst.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/msg +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/msg3.0_subset_readme.txt +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/msg3_subset.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/msg_download.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/msgsubset.f +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/rdimma1_csv.f +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/writeicoads.py +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/SOURCES.txt +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/dependency_links.txt +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/entry_points.txt +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/requires.txt +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/top_level.txt +0 -0
- {rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/tests/test_icoads.py +0 -0
|
@@ -107,9 +107,10 @@ def clean_imma_data():
|
|
|
107
107
|
else:
|
|
108
108
|
clean_imma_data_for_tidx(tidx, cnd)
|
|
109
109
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
if not PVALS['aname']:
|
|
111
|
+
cnt = PgDBI.pgdel(table, PVALS['dcnd'], PgLOG.LGEREX)
|
|
112
|
+
s = 's' if cnt > 1 else ''
|
|
113
|
+
PgLOG.pglog("{}: {} record{} deleted for {}".format(table, cnt, s, PVALS['dcnd']), PgLOG.LOGWRN)
|
|
113
114
|
|
|
114
115
|
#
|
|
115
116
|
# clean up imma data for table index
|
|
@@ -19,12 +19,15 @@ import re
|
|
|
19
19
|
from os import path as op
|
|
20
20
|
from rda_python_common import PgLOG
|
|
21
21
|
from rda_python_common import PgDBI
|
|
22
|
+
from rda_python_common import PgUtil
|
|
22
23
|
from . import PgIMMA
|
|
23
24
|
|
|
24
25
|
PVALS = {
|
|
25
26
|
'uatti' : '',
|
|
26
27
|
'names' : None,
|
|
27
|
-
'files' : []
|
|
28
|
+
'files' : [],
|
|
29
|
+
'dates' : [],
|
|
30
|
+
'dtlen' : 0
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
#
|
|
@@ -38,23 +41,29 @@ def main():
|
|
|
38
41
|
|
|
39
42
|
option = None
|
|
40
43
|
for arg in argv:
|
|
41
|
-
if arg
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
44
|
+
if re.match(r'-\w', arg):
|
|
45
|
+
option = None
|
|
46
|
+
if arg[1] == "b":
|
|
47
|
+
PgLOG.PGLOG['BCKGRND'] = 1
|
|
48
|
+
elif arg[1] == "a":
|
|
49
|
+
PVALS['uatti'] = "98"
|
|
50
|
+
elif arg[1] == "u":
|
|
51
|
+
leaduid = 1
|
|
52
|
+
elif arg[1] == "e":
|
|
53
|
+
chkexist = 1
|
|
54
|
+
elif arg[1] == "i":
|
|
55
|
+
addinventory = 1
|
|
56
|
+
elif arg[1] in "fpr":
|
|
57
|
+
option = arg[1]
|
|
58
|
+
else:
|
|
59
|
+
PgLOG.pglog(arg + ": Invalid Option", PgLOG.LGWNEX)
|
|
55
60
|
elif option == 'f':
|
|
56
61
|
get_imma_filelist(arg)
|
|
57
62
|
option = None
|
|
63
|
+
elif option == 'p':
|
|
64
|
+
PVALS['dates'].append(PgUtil.format_date(arg))
|
|
65
|
+
PVALS['dtlen'] += 1
|
|
66
|
+
if PVALS['dtlen'] == 2: option = None
|
|
58
67
|
elif option == 'r':
|
|
59
68
|
rn3 = int(arg)
|
|
60
69
|
option = None
|
|
@@ -62,11 +71,12 @@ def main():
|
|
|
62
71
|
PVALS['files'].append(arg)
|
|
63
72
|
|
|
64
73
|
if not PVALS['files']:
|
|
65
|
-
print("Usage: fillicoads [-a] [-e] [-f InputFile] [-i] [-r RN3] [-u] FileList")
|
|
74
|
+
print("Usage: fillicoads [-a] [-e] [-f InputFile] [-i] [-p BDate [EDate]] [-r RN3] [-u] FileList")
|
|
66
75
|
print(" At least one file name needs to fill icoads data into Postgres Server")
|
|
67
76
|
print(" Option -a: add all attms, including multi-line ones, such as IVAD and REANQC")
|
|
68
77
|
print(" Option -f: provide a filename holding a list of IMMA1 files")
|
|
69
78
|
print(" Option -i: add daily counting records into inventory table")
|
|
79
|
+
print(" Option -p: provide a period for filling data")
|
|
70
80
|
print(" Option -r: the Third digit of IMMA release number")
|
|
71
81
|
print(" Option -u: standalone attachment records with leading 6-character UID")
|
|
72
82
|
print(" Option -e: check existing record before adding attm")
|
|
@@ -119,10 +129,10 @@ def process_imma_file(fname, addinventory):
|
|
|
119
129
|
|
|
120
130
|
# get the first valid date and do initialization
|
|
121
131
|
line = IMMA.readline()
|
|
132
|
+
PgIMMA.identify_attm_name(line) # check and record standalone attm name
|
|
122
133
|
while line:
|
|
123
|
-
PgIMMA.identify_attm_name(line) # check and record standalone attm name
|
|
124
134
|
idate = cdate = PgIMMA.get_imma_date(line)
|
|
125
|
-
if cdate:
|
|
135
|
+
if cdate and (PVALS['dtlen'] == 0 or cdate >= PVALS['dates'][0]):
|
|
126
136
|
PgIMMA.init_indices_for_date(cdate, iname)
|
|
127
137
|
records = PgIMMA.get_imma_records(cdate, line, records)
|
|
128
138
|
break
|
|
@@ -140,14 +150,16 @@ def process_imma_file(fname, addinventory):
|
|
|
140
150
|
for i in range(PgIMMA.TABLECOUNT): acounts[i] += acnts[i]
|
|
141
151
|
records = {}
|
|
142
152
|
cdate = idate
|
|
153
|
+
if PVALS['dtlen'] == 2 and cdate > PVALS['dates'][1]: break
|
|
143
154
|
PgIMMA.init_indices_for_date(cdate, iname)
|
|
144
155
|
records = PgIMMA.get_imma_records(idate, line, records)
|
|
145
156
|
line = IMMA.readline()
|
|
146
157
|
|
|
147
158
|
IMMA.close()
|
|
148
159
|
|
|
149
|
-
|
|
150
|
-
|
|
160
|
+
if cdate and records:
|
|
161
|
+
acnts = PgIMMA.add_imma_records(cdate, records)
|
|
162
|
+
for i in range(PgIMMA.TABLECOUNT): acounts[i] += acnts[i]
|
|
151
163
|
|
|
152
164
|
PgLOG.pglog("{} ({}) filled from {}".format(' '.join(map(str, acounts)), PVALS['names'], op.basename(fname)), PgLOG.LOGWRN)
|
|
153
165
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/R3.0-stat_doc.pdf
RENAMED
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/README_R3.0_Subset.html
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/fillinventory.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads/msg3.0_subset_readme.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/requires.txt
RENAMED
|
File without changes
|
{rda_python_icoads-1.0.12 → rda_python_icoads-1.0.14}/src/rda_python_icoads.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|