Hua work miscs#29
Merged
Merged
Conversation
- Add class, method, and function docstrings to TcshQsub and BashQsub - Fix bug in bashqsub.py: check '$' in cwd (was incorrectly checking 's') - Fix comment typos: 'fnction', 'readparameters', 'excecute' - Fix header URL typo in bashqsub.py (rda-pythn-miscs) - Update both .usg files: -m n, -q gdex@casper-pbs, select=1:ncpus=1:mem=1gb - Fix 'tash script' typo in tcshqsub.usg Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add class, method, and function docstrings to GdexLs
- Fix comment typos: 'functio', 'excecute', 'display one file info'
- Replace 'dfNr'.find(option) > -1 with idiomatic 'option in dfNr'
- Fix inconsistent 'return None' to bare 'return' in display_line
- Rewrite gdexls.usg: clearer column descriptions, fixed grammar
('is check' -> 'is checked'), restructured examples with explicit
command blocks, and clarified trailing '/' vs wildcard vs bare path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pgwget / pg_wget:
- Add docstrings; create pgwget.usg and switch to show_usage()
- Fix 'No newer file found on' log message (missing {} for URL)
- Fix all 'dowloaded'/'dowload' typos; improve inline usage text
rdacp:
- Add docstrings; fix 'copiled' typo in log message
- Replace 'FD'.find() with idiomatic 'option in FD'
- Rewrite rdacp.usg: remove stale -hf/-fl, add -fb/-tb/-fp/-tp
rdakill:
- Add docstrings; fix 'idendified' typo
- Bug fix: remove stray 't' from option regex and int-cast check
- Bug fix: bare PID condition inverted (and -> and not)
- Change default -q from 'rda' to 'gdex'
- Rewrite rdakill.usg: fix typos, add -r, expand examples
rdamod:
- Add docstrings; fix header/comment typos
- Bug fix: file branch checked RDAMOD['d'] instead of RDAMOD['f']
- Bug fix: directory pluralisation used dcnt instead of dcnt > 1
- Replace find() checks with idiomatic 'option in'
- Rewrite rdamod.usg: fix -h (help not hostname), fix wrong defaults
(755->775, 644->664), add examples
rdaown:
- Add docstrings; fix header/comment typos
- Replace 'dfhr'.find() with idiomatic 'option in'
- Rewrite rdaown.usg: fix 'in font of', clarify skip conditions
rdaps:
- Add docstrings
- Bug fix: remove stray 't' from option regex and int-cast check
- Rewrite rdaps.usg: fix typos, clarify ps vs qstat, add examples
rdasub:
- Add docstrings; fix header date and 'bachground' typo
- Bug fix: cwd.find('$') always truthy -> use '$' in cwd
- Bug fix: self.PgLOG -> self.PGLOG (AttributeError on job found)
- Rewrite rdasub.usg: add -b, fix -cwd wording, add examples
rdazip:
- Add docstrings; fix 'excecute' typo
- Rewrite rdazip.usg: fix 'umcompress', add -b, list all formats,
expand examples
pyproject.toml:
- Add gdex-prefixed aliases: gdexsub, gdexps, gdexzip, gdexown,
gdexcp, gdexkill, gdexmod
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes and clarifies several rda_python_miscs CLI utilities by improving help/usage text, adding/expanding docstrings, updating PBS qsub examples for current Casper settings, and introducing a class-based pgwget entry point plus additional console-script aliases.
Changes:
- Refreshed multiple
*.usghelp documents (clearer option docs, examples, updated paths/queues/resources). - Added/expanded docstrings and fixed several small parsing/typo issues across the CLI modules.
- Added new
pgwgetimplementation (PgWgetclass +pgwget.usg) and expandedpyproject.tomlscripts withgdex*aliases.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/rda_python_miscs/tcshqsub.usg |
Updates qsub examples (queue/resource syntax, paths, mail settings). |
src/rda_python_miscs/tcshqsub.py |
Adds docstrings and minor comment/typo fixes in tcsh qsub wrapper. |
src/rda_python_miscs/rdazip.usg |
Rewrites usage text with clearer modes/options/examples. |
src/rda_python_miscs/rdazip.py |
Adds docstrings and clarifying inline comments. |
src/rda_python_miscs/rdasub.usg |
Expands nohup background submission documentation and examples. |
src/rda_python_miscs/rdasub.py |
Adds docstrings and fixes $ detection in cwd expansion. |
src/rda_python_miscs/rdaps.usg |
Clarifies local vs PBS behavior and options/examples. |
src/rda_python_miscs/rdaps.py |
Adds docstrings and tightens option parsing. |
src/rda_python_miscs/rdaown.usg |
Clarifies ownership-change behavior, options, and examples. |
src/rda_python_miscs/rdaown.py |
Adds docstrings and improves option parsing readability. |
src/rda_python_miscs/rdamod.usg |
Clarifies mode-change behavior, defaults, and examples. |
src/rda_python_miscs/rdamod.py |
Adds docstrings and fixes logic (file-mode flag check + pluralization). |
src/rda_python_miscs/rdakill.usg |
Clarifies local/PBS kill semantics, queue/status flags, examples. |
src/rda_python_miscs/rdakill.py |
Adds docstrings and fixes parsing/behavior; PBS status-kill default queue updated. |
src/rda_python_miscs/rdacp.usg |
Modernizes copy help text and documents buckets/Globus endpoints. |
src/rda_python_miscs/rdacp.py |
Adds docstrings and small typo fix (“copied”). |
src/rda_python_miscs/pgwget.usg |
Adds new help doc for pgwget wrapper behavior/options/examples. |
src/rda_python_miscs/pgwget.py |
Introduces class-based PgWget CLI implementation and logging/doc improvements. |
src/rda_python_miscs/pg_wget.py |
Updates legacy script comments/docstrings and some log message text. |
src/rda_python_miscs/gdexls.usg |
Rewrites usage docs with clearer output semantics and recursion options. |
src/rda_python_miscs/gdexls.py |
Adds docstrings and small flow/clarity tweaks. |
src/rda_python_miscs/bashqsub.usg |
Updates qsub examples (queue/resource syntax, paths, mail settings). |
src/rda_python_miscs/bashqsub.py |
Adds docstrings, fixes env var expansion check for cwd, and header URL typo. |
pyproject.toml |
Adds gdex* console-script aliases and registers pgwget entry point. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+148
to
152
| self.pglog("{}: Newer file downloaded from {}".format(rfile, self.OPTIONS['UL']), self.LOGWRN) | ||
| build = 1 | ||
| else: | ||
| self.pglog("{}: No newer file found on ".format(rfile, self.OPTIONS['UL']), self.LOGWRN) | ||
| self.pglog("{}: No newer file found on {}".format(rfile, self.OPTIONS['UL']), self.LOGWRN) | ||
| if skip == ncnt: return 0 |
Comment on lines
+161
to
165
| PgLOG.pglog("{}: Newer file downloaded from {}".format(rfile, OPTIONS['UL']), PgLOG.LOGWRN) | ||
| build = 1 | ||
| else: | ||
| PgLOG.pglog("{}: No newer file found on ".format(rfile, OPTIONS['UL']), PgLOG.LOGWRN) | ||
| PgLOG.pglog("{}: No newer file found on {}".format(rfile, OPTIONS['UL']), PgLOG.LOGWRN) | ||
|
|
Comment on lines
+209
to
+218
| """Cancel all PBS batch jobs in a queue that match the given status. | ||
|
|
||
| Queries qstat for the specified queue (defaulting to 'rda') and optional | ||
| user filter, then calls rdakill_pbs_batch for each job whose State field | ||
| matches stat. Logs a summary of how many jobs were found and killed. | ||
|
|
||
| Args: | ||
| stat (str): PBS job state to match (e.g. 'PEND', 'RUN'). | ||
| queue (str|None): PBS queue name; defaults to 'gdex' if None. | ||
| uname (str|None): Limit to jobs owned by this user; None means all users. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.