rda-python-dsarch 3.0.14__tar.gz → 3.0.16__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 (21) hide show
  1. {rda_python_dsarch-3.0.14/src/rda_python_dsarch.egg-info → rda_python_dsarch-3.0.16}/PKG-INFO +1 -1
  2. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/pyproject.toml +1 -1
  3. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/dsarch.py +31 -5
  4. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/dsarch.usg +8 -0
  5. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/pg_arch.py +2 -0
  6. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/pg_meta.py +3 -0
  7. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16/src/rda_python_dsarch.egg-info}/PKG-INFO +1 -1
  8. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/LICENSE +0 -0
  9. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/MANIFEST.in +0 -0
  10. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/README.md +0 -0
  11. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/setup.cfg +0 -0
  12. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/PgArch.py +0 -0
  13. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/PgMeta.py +0 -0
  14. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/__init__.py +0 -0
  15. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch/ds_arch.py +0 -0
  16. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch.egg-info/SOURCES.txt +0 -0
  17. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch.egg-info/dependency_links.txt +0 -0
  18. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch.egg-info/entry_points.txt +0 -0
  19. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch.egg-info/requires.txt +0 -0
  20. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/src/rda_python_dsarch.egg-info/top_level.txt +0 -0
  21. {rda_python_dsarch-3.0.14 → rda_python_dsarch-3.0.16}/tests/test_dsarch.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsarch
3
- Version: 3.0.14
3
+ Version: 3.0.16
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rda_python_dsarch"
7
- version = "3.0.14"
7
+ version = "3.0.16"
8
8
  authors = [
9
9
  { name="Zaihua Ji", email="zji@ucar.edu" },
10
10
  ]
@@ -534,7 +534,7 @@ class DsArch(PgArch, PgMeta):
534
534
  if self.PGSIG['BPROC'] < 2:
535
535
  if not fnames: fnames = self.get_field_keys(tname, None, "G") # get setting fields if not yet
536
536
  info = None
537
- if warch:
537
+ if afile: # also when already in place, so a directory gets its real total size
538
538
  info = self.check_local_file(afile, 1, self.PGOPT['emerol']|self.PFSIZE)
539
539
  elif oarch:
540
540
  info = self.check_object_file(ofile, bucket, 1, self.PGOPT['emerol'])
@@ -926,10 +926,8 @@ class DsArch(PgArch, PgMeta):
926
926
  bgcnt += 1
927
927
  if self.PGSIG['BPROC'] < 2:
928
928
  if not fnames: fnames = self.get_field_keys(tname, None, "G") # get setting fields if not yet
929
- info = None
930
- if sarch:
931
- info = self.check_local_file(afile, 1, self.PGOPT['emerol']|self.PFSIZE)
932
- elif pgrec:
929
+ info = self.check_local_file(afile, 1, self.PGOPT['emerol']|self.PFSIZE) # also when already in place
930
+ if not info and pgrec:
933
931
  info = self.get_file_origin_info(sfile, pgrec)
934
932
  sid = self.set_one_savedfile(i, pgrec, sfile, fnames, type, info)
935
933
  if not sid:
@@ -2049,9 +2047,37 @@ class DsArch(PgArch, PgMeta):
2049
2047
  self.print_row_format(pgrec, fnames, hash)
2050
2048
  self.view_keyvalues(dsid, kvalues, getkeys)
2051
2049
  if fnames and 'PE' in self.params: self.get_period_info()
2050
+ if 'SO' in self.params: self.get_owner_info(dsid)
2052
2051
  if 'WN' in self.params or 'WS' in self.params: self.view_filenumber(dsid, 0)
2053
2052
  return 1 # get one dataset record
2054
2053
 
2054
+ def get_owner_info(self, dsid):
2055
+ """
2056
+ Display the specialists who own a dataset.
2057
+
2058
+ Joins dsowner with dssgrp to list each owner's login name, priority
2059
+ (1 = primary specialist) and name, ordered by priority. Lines are
2060
+ written as comments so the output can still be fed back via -IF.
2061
+
2062
+ Args:
2063
+ dsid -- dataset ID string
2064
+ """
2065
+ tjoin = "dsowner LEFT JOIN dssgrp ON specialist = logname"
2066
+ pgrecs = self.pgmget(tjoin, "specialist, priority, fstname, lstname",
2067
+ "dsid = '{}' ORDER BY priority, specialist".format(dsid), self.LGEREX)
2068
+ cnt = len(pgrecs['specialist']) if pgrecs else 0
2069
+ if not cnt:
2070
+ self.OUTPUT.write("#Owner{}NONE\n".format(self.params['ES']))
2071
+ return self.pglog("No owner found for {} in dsowner".format(dsid), self.LOGWRN)
2072
+ dv = self.params['DV']
2073
+ self.OUTPUT.write("#Owner{0}Priority{0}Name{0}\n".format(dv))
2074
+ for i in range(cnt):
2075
+ name = ' '.join(n for n in (pgrecs['fstname'][i], pgrecs['lstname'][i]) if n)
2076
+ if not name: name = 'Not in dssgrp'
2077
+ self.OUTPUT.write("#{1}{0}{2}{0}{3}{0}\n".format(dv, pgrecs['specialist'][i], pgrecs['priority'][i], name))
2078
+ s = 's' if cnt > 1 else ''
2079
+ self.pglog("{} owner record{} retrieved for {}".format(cnt, s, dsid), self.LOGWRN)
2080
+
2055
2081
  def get_period_info(self):
2056
2082
  """
2057
2083
  Retrieve and display dataset time-period records from RDADB.
@@ -301,6 +301,8 @@ handle:
301
301
  -(FO|FormatOutput) - formats each column to a uniform fixed width
302
302
  -(PE|ShowPeriod) - includes associated period information for the
303
303
  dataset and any groups
304
+ -(SO|ShowOwner) - includes the dataset owners (specialists) and
305
+ their priorities, 1 for the primary specialist
304
306
  -(WN|WithFileNumber) - gathers and displays Saved/Web file counts
305
307
 
306
308
  Use -FN (-FieldNames) to select which dataset fields to include.
@@ -1889,6 +1891,12 @@ behavior.
1889
1891
  the GDEX Server and stores them in GDEXDB for integrity
1890
1892
  verification.
1891
1893
 
1894
+ -SO or -ShowOwner (Alias: -ShowOwners|-ShowSpecialist|-ShowSpecialists),
1895
+ adds the dataset owners from dsowner to the output of -GD
1896
+ (-GetDataset): login name, priority (1 = primary specialist) and
1897
+ name. The lines are written as comments starting with '#', so the
1898
+ output can still be read back with -IF.
1899
+
1892
1900
  -TO or -TarOnly, builds the Quasar tar file locally without
1893
1901
  uploading it to the Globus Quasar Server. Useful for testing. Used
1894
1902
  with -AQ.
@@ -121,6 +121,7 @@ class PgArch(PgOPT, PgCMD, PgSplit):
121
121
  'RS' : [0, 'GXRSOptions', 3],
122
122
  'RT' : [0, 'ResetTIndex', 3],
123
123
  'SC' : [0, 'SetChecksum', 2],
124
+ 'SO' : [0, 'ShowOwner', 0],
124
125
  'TO' : [0, 'TarOnly', 1],
125
126
  'TS' : [0, 'ToSaved', 2],
126
127
  'TT' : [0, 'TotalSummary', 0],
@@ -265,6 +266,7 @@ class PgArch(PgOPT, PgCMD, PgSplit):
265
266
  'RQ' : ['RestoreQuasar', 'RestoreBackupFile', 'RestoreBackup'],
266
267
  'RT' : ['ResetTopGroup'],
267
268
  'SH' : ['SetHelp'],
269
+ 'SO' : ['ShowOwners', 'ShowSpecialist', 'ShowSpecialists'],
268
270
  'SQ' : ['SetQuasar', 'SetBackupFile', 'SetBackup'],
269
271
  'SS' : ['SetSaved'],
270
272
  'ST' : ['SavedType', 'SavedArchiveType'],
@@ -639,6 +639,9 @@ class PgMeta(PgCMD, PgSplit):
639
639
  d = self.metadata_dataset_id(dsid)
640
640
  if d not in self.META[c]: self.META[c][d] = []
641
641
  f = fmt.lower()
642
+ if f == "zarr": # gatherxml has no reader for Zarr stores
643
+ self.pglog("{}-{}: Skip 'gatherxml' for Data Format '{}'".format(dsid, file, fmt), self.LOGWRN)
644
+ return 0
642
645
  if f == "netcdf": f = "cf" + f
643
646
  if not lfile: lfile = op.basename(file)
644
647
  self.META[c][d].append([file, f, lfile, mfile])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_dsarch
3
- Version: 3.0.14
3
+ Version: 3.0.16
4
4
  Summary: RDA Python package for utility program dsarch archive RDA data
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-dsarch