rda-python-dscheck 2.0.7__py3-none-any.whl → 2.0.8__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.
@@ -1 +1,27 @@
1
+ """rda_python_dscheck: dataset check (dscheck) utility package.
1
2
 
3
+ This package exposes two parallel APIs:
4
+
5
+ 1. Legacy module-based API (back-compat). Import the capitalized
6
+ submodule and call its module-level functions, e.g.::
7
+
8
+ from rda_python_dscheck import PgCheck
9
+
10
+ 2. Class-based API (preferred for new code). Import the class from the
11
+ lower-case module and either instantiate or subclass it, e.g.::
12
+
13
+ from rda_python_dscheck.pg_check import PgCheck
14
+
15
+ The legacy submodule is eagerly imported below so that
16
+ ``from rda_python_dscheck import PgCheck`` continues to return the module
17
+ object that existing callers expect.
18
+ """
19
+
20
+ from . import PgCheck
21
+
22
+ __version__ = "2.0.8"
23
+
24
+ __all__ = [
25
+ "PgCheck",
26
+ "__version__",
27
+ ]
@@ -80,7 +80,7 @@ into an action.
80
80
  Notation:
81
81
  [] - the enclosed element is optional.
82
82
  (A|B) - either A or B may be used (a short form and a long form).
83
- -OPT - an option name. Names are case-insensitive; values are not.
83
+ -<OPT> - OPT is an option name. Names are case-insensitive; values are not.
84
84
 
85
85
  Every dscheck invocation has at most one Action option, which selects the
86
86
  task to perform. Mode options change how the chosen action behaves. Info
@@ -95,26 +95,25 @@ are accepted, and aliases are noted with each option.
95
95
  2.1 Quick Start
96
96
 
97
97
  Show the full document, paged through 'more':
98
- dscheck
98
+ dscheck
99
99
 
100
100
  Show the description of a single option:
101
- dscheck -h -AC
102
- dscheck -AC -h
101
+ dscheck -h -AC
103
102
 
104
103
  List your own daemon control records:
105
- dscheck -GD
104
+ dscheck -GD
106
105
 
107
106
  List your own active check records:
108
- dscheck -GC
107
+ dscheck -GC
109
108
 
110
109
  Add a deferred run of a script on PBS:
111
- dscheck -AC -CM myscript.sh -HN PBS
110
+ dscheck -AC -CM myscript.sh -HN PBS
112
111
 
113
112
  Email yourself the status of all your active checks:
114
- dscheck -EC
113
+ dscheck -EC
115
114
 
116
115
  Start the dscheck daemon (typical for the operator):
117
- dscheck -PC -DM start
116
+ dscheck -PC -DM start
118
117
 
119
118
  2.2 Filters and Special Characters in Queries
120
119
 
@@ -135,20 +134,9 @@ Every option except -IF (-InputFile) may be supplied either on the command
135
134
  line or in an input file. -IF is itself only valid on the command line.
136
135
  A single dscheck invocation may combine command-line options with one or
137
136
  more input files. If the only options are inside a single input file, the
138
- -IF prefix may be omitted:
139
-
140
- dscheck mycheck.in
141
-
142
- See the description of -IF in Section 5.2 for the input-file format
143
- (comments, action/mode markers, single-value assignments, and tabular
144
- multi-value assignments, including delimiter overrides).
145
-
146
- 2.4 Getting Help
147
-
148
- dscheck # full document, displayed via 'more'
149
- dscheck -(h|help) # full document
150
- dscheck [Option] -(h|help) # description of [Option]
151
- dscheck -(h|help) [Option] # same as above
137
+ -IF prefix may be omitted. See the description of -IF in Section 5.2 for
138
+ the input-file format (comments, action/mode markers, single-value assignments,
139
+ and tabular multi-value assignments, including delimiter overrides).
152
140
 
153
141
  A printable copy of this document is the file dscheck.usg installed under
154
142
  the python package rda_python_dscheck.
@@ -224,16 +212,6 @@ Delete Daemon Control - remove daemon control records by index.
224
212
  CM = ALL - apply to any command not otherwise configured for this
225
213
  specialist.
226
214
 
227
- Example - configure schuster on PBS for any command, with up to 4
228
- concurrent checks at priority 1 (lower number = higher priority), driven
229
- from input file daemon.ctl:
230
-
231
- dscheck -SD -ND -IF daemon.ctl
232
-
233
- <<Content of input file daemon.ctl>>
234
- DaemonIndex<:>Specialist<:>Command<:>Hostname<:>ProcessLimit<:>Priority<:>
235
- 0<:>schuster<:>ALL<:>PBS<:>4<:>1<:>
236
-
237
215
 
238
216
  3.1.2 Get Daemon Control
239
217
  -GD or -GetDaemon, retrieves daemon control records. With no Info-option
@@ -364,7 +342,7 @@ Unlock Check - clear leftover lock information after an abnormal exit.
364
342
 
365
343
  Add the executable 'test3' for deferred execution on PBS:
366
344
 
367
- dscheck -AC -CM test3 -HN PBS
345
+ dscheck -AC -CM test3 -HN PBS
368
346
 
369
347
  The command 'test3' must be executable from the working directory on
370
348
  the PBS machine.
@@ -571,6 +549,7 @@ Available actions:
571
549
  [-(MO|Modules) ModuleList]
572
550
  [-(EV|Environments) EnvironmentPairList]
573
551
  [-(QS|QsubOptions) PBSBatchOptions]
552
+ [-(SH|SSHHostname) RemoteHostname]
574
553
  [-(DB|Debug) DebugModeInfo]
575
554
 
576
555
 
@@ -665,6 +644,11 @@ multiple values is an error.
665
644
  -ON or -OrderNames, a string of single-letter field codes that
666
645
  controls the sort order of -GC (-GetCheck) output.
667
646
 
647
+ -SH or -SSHHostname, used with -SO (-SetOptions): remote host name on
648
+ which the dynamic-option command should run. When supplied, the command
649
+ is invoked via 'ssh <hostname> ...' instead of locally. Defaults to
650
+ running locally when omitted.
651
+
668
652
  -AO or -ActOption, the token that marks Action and Mode options in
669
653
  input files. Defaults to '<!>'.
670
654
 
@@ -62,6 +62,7 @@ class PgCheck(PgOPT, PgCMD):
62
62
  'MT': [1, 'MaxrunTime', 0],
63
63
  'OF': [1, 'OutputFile', 0],
64
64
  'ON': [1, 'OrderNames', 0],
65
+ 'SH': [1, 'SSHHostname', 0],
65
66
  'AO': [1, 'ActOption', 1], # default to <!>
66
67
  'WI': [1, 'WaitInterval', 1],
67
68
  'AN': [2, 'ActionName', 0],
@@ -680,7 +681,8 @@ class PgCheck(PgOPT, PgCMD):
680
681
  if not pgrec or options != pgrec[optname]: return options
681
682
  record = {}
682
683
  errmsg = ''
683
- record[optname] = options = self.get_dynamic_options(options[1:], pgcheck['oindex'], pgcheck['otype'])
684
+ sshhost = self.params.get('SH')
685
+ record[optname] = options = self.get_dynamic_options(options[1:], pgcheck['oindex'], pgcheck['otype'], sshhost)
684
686
  if not options and self.PGLOG['SYSERR']:
685
687
  record['status'] = pgcheck['status'] = 'E'
686
688
  record['pid'] = 0
@@ -0,0 +1,93 @@
1
+ Metadata-Version: 2.4
2
+ Name: rda_python_dscheck
3
+ Version: 2.0.8
4
+ Summary: RDA python package to add and process batch jobs
5
+ Author-email: Zaihua Ji <zji@ucar.edu>
6
+ Project-URL: Homepage, https://github.com/NCAR/rda-python-dscheck
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Requires-Python: >=3.7
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: rda_python_common
15
+ Dynamic: license-file
16
+
17
+ # dscheck
18
+
19
+ Python project to add and process batch jobs for the [NSF NCAR Geoscience Data Exchange (GDEX)](https://gdex.ucar.edu).
20
+
21
+ The user guide for this utility tool can be viewed at: [User guide](https://gdex-docs-dscheck.readthedocs.io).
22
+
23
+ ## Source layout
24
+
25
+ The package lives under `src/rda_python_dscheck/`. The three files most
26
+ relevant to setup and customization are:
27
+
28
+ - **`dscheck.py`** — entry point installed as the `setuid_dscheck`
29
+ console script. Defines the `DsCheck` class which subclasses
30
+ `PgCheck`, parses command-line options via `self.parsing_input`, and
31
+ dispatches to the appropriate action handler (`add_check_info`,
32
+ `process_check`, `get_check_info`, `set_dscheck_options`, ...).
33
+ Build new actions by adding a method here and routing to it from
34
+ `start_actions()`.
35
+
36
+ - **`pg_check.py`** — defines the `PgCheck` class (inherits from
37
+ `PgCMD` in `rda_python_common`). Holds the master `OPTS` option
38
+ table, the `ALIAS` map for long/alias names, the `TBLHASH` table
39
+ field maps for `dscheck` and `dsdaemon`, and the helper methods
40
+ shared by every action (option validation, dynamic batch-option
41
+ resolution, daemon control, host/specialist resolution, etc.).
42
+ Add or change options here, then document them in `dscheck.usg`.
43
+
44
+ - **`dscheck.usg`** — single source of truth for the user-facing
45
+ documentation displayed by `dscheck -?` and rendered as the
46
+ [user guide](https://gdex-docs-dscheck.readthedocs.io). Section 3
47
+ lists Action options, Section 4 lists Mode options, and Section 5
48
+ lists Single- and Multi-Value Info options. When you add a new
49
+ option to `OPTS` in `pg_check.py`, add a matching entry to the
50
+ appropriate subsection of this file and (if relevant) to the
51
+ per-action usage block in Section 3.
52
+
53
+ ### Installing from PyPI
54
+
55
+ The package is published on [PyPI](https://pypi.org/project/rda_python_dscheck/),
56
+ so the regular install command is:
57
+
58
+ ```bash
59
+ pip install rda_python_dscheck
60
+ ```
61
+
62
+ To upgrade an existing install to the latest published release:
63
+
64
+ ```bash
65
+ pip install --upgrade rda_python_dscheck
66
+ ```
67
+
68
+ This pulls in `rda_python_common` (which provides `PgCMD`, `PgLOG`,
69
+ `PgDBI`, ...) and registers the `setuid_dscheck` console script.
70
+
71
+ ### Installing for development
72
+
73
+ For local changes, clone the repo and install in editable mode so that
74
+ edits are picked up immediately without reinstalling:
75
+
76
+ ```bash
77
+ git clone https://github.com/NCAR/rda-python-dscheck.git
78
+ cd rda-python-dscheck
79
+ pip install -e .
80
+ ```
81
+
82
+ ## Documentation sync
83
+
84
+ The user guide rendered at
85
+ [gdex-docs-dscheck.readthedocs.io](https://gdex-docs-dscheck.readthedocs.io) is
86
+ generated from `src/rda_python_dscheck/dscheck.usg` in this repository. When a
87
+ pull request that modifies `dscheck.usg` is merged here, an automated workflow
88
+ converts the updated `dscheck.usg` into the RST-format source files in the
89
+ [gdex-docs-dscheck](https://github.com/NCAR/gdex-docs-dscheck) repository and
90
+ opens a pull request there with the regenerated docs, ready for review and
91
+ merge. No manual RST editing is required — keep all user-facing content in
92
+ `dscheck.usg` and let the sync produce the docs.
93
+
@@ -0,0 +1,12 @@
1
+ rda_python_dscheck/PgCheck.py,sha256=lvh0XSWJID9J9fjqmDtpq6xW2ULC-bChAxAkm8MFzbk,64217
2
+ rda_python_dscheck/__init__.py,sha256=4Wtgj9ephcxz20cPTI4SZ_XCuCM0oqtfq9wL8kcVr3Y,734
3
+ rda_python_dscheck/ds_check.py,sha256=-js5Ex1k7V8ziE_k-ld5Z0l44QGYhvQtdYri9vsqNJA,24303
4
+ rda_python_dscheck/dscheck.py,sha256=-vv7gw4xYIa1xofWo-o3972dDnR_FQZxZz6_S_kCCuk,24805
5
+ rda_python_dscheck/dscheck.usg,sha256=zvghJK0XKXlSNopI1G8PYorRVUkpXoZLmFWQGqGAmBQ,31662
6
+ rda_python_dscheck/pg_check.py,sha256=ftmXSGXWeusQPV9FA6-3_fzhbfDCGfDIgjAK5yxi2jA,67476
7
+ rda_python_dscheck-2.0.8.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
8
+ rda_python_dscheck-2.0.8.dist-info/METADATA,sha256=WDn3PoFKAR6BkmOE16Rfhz9Hbt2kw4mAwm_GyZTZfpE,3689
9
+ rda_python_dscheck-2.0.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
10
+ rda_python_dscheck-2.0.8.dist-info/entry_points.txt,sha256=frVByX3Vp_Pd_zq93SXfItr5OMTd5tKeZzu5pbVXiGA,60
11
+ rda_python_dscheck-2.0.8.dist-info/top_level.txt,sha256=NrvWqcHMRlQZJb0w85JrDlSXTp9DF-pDRQaAEABzFts,19
12
+ rda_python_dscheck-2.0.8.dist-info/RECORD,,
@@ -1,22 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: rda_python_dscheck
3
- Version: 2.0.7
4
- Summary: RDA python package to add and process batch jobs
5
- Author-email: Zaihua Ji <zji@ucar.edu>
6
- Project-URL: Homepage, https://github.com/NCAR/rda-python-dscheck
7
- Classifier: Programming Language :: Python :: 3
8
- Classifier: License :: OSI Approved :: MIT License
9
- Classifier: Operating System :: OS Independent
10
- Classifier: Development Status :: 5 - Production/Stable
11
- Requires-Python: >=3.7
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
- Requires-Dist: rda_python_common
15
- Dynamic: license-file
16
-
17
- # dscheck
18
-
19
- Python project to add and process batch jobs for the [NSF NCAR Geoscience Data Exchange (GDEX)](https://gdex.ucar.edu).
20
-
21
- The user guide for this utility tool can be viewed at: [User guide](https://gdex-docs-dscheck.readthedocs.io).
22
-
@@ -1,12 +0,0 @@
1
- rda_python_dscheck/PgCheck.py,sha256=lvh0XSWJID9J9fjqmDtpq6xW2ULC-bChAxAkm8MFzbk,64217
2
- rda_python_dscheck/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
3
- rda_python_dscheck/ds_check.py,sha256=-js5Ex1k7V8ziE_k-ld5Z0l44QGYhvQtdYri9vsqNJA,24303
4
- rda_python_dscheck/dscheck.py,sha256=-vv7gw4xYIa1xofWo-o3972dDnR_FQZxZz6_S_kCCuk,24805
5
- rda_python_dscheck/dscheck.usg,sha256=upCHGwRcjrLoue4Z9nE3pMDZ3s09Qq1ujEH2eJhb2cg,32036
6
- rda_python_dscheck/pg_check.py,sha256=Riv1nJYocSKLDsOIIYmOmkKlWZLKDrA1uPpbUEYo1uo,67388
7
- rda_python_dscheck-2.0.7.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
8
- rda_python_dscheck-2.0.7.dist-info/METADATA,sha256=ezkK1sDQXrTcaTtHRlemEpeBOBQDmCOcHFLwuJainQk,812
9
- rda_python_dscheck-2.0.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
10
- rda_python_dscheck-2.0.7.dist-info/entry_points.txt,sha256=frVByX3Vp_Pd_zq93SXfItr5OMTd5tKeZzu5pbVXiGA,60
11
- rda_python_dscheck-2.0.7.dist-info/top_level.txt,sha256=NrvWqcHMRlQZJb0w85JrDlSXTp9DF-pDRQaAEABzFts,19
12
- rda_python_dscheck-2.0.7.dist-info/RECORD,,