feat(18): adopt the shared CLI helpers in the rdkit Jobs - #24
Merged
Conversation
Replaces the hand-typed "Input/output options" block in seven scripts with rdkit_utils.add_common_molecule_io_args(), and the interval reporting idiom with dm_job_utilities' add_reporting_args() / ProgressReporter. No manifest changes: --input and --output are retained as aliases by the helper, so every existing command block keeps working. screen.py is deliberately left alone. It uses -d for --descriptor, which collides with the helper's -d for --delimiter: argparse.ArgumentError: argument -d/--delimiter: conflicting option string: -d Resolving that means either dropping a public short flag from --descriptor or giving the helper a way to omit -d, and neither should be decided inside this change. cluster_butina.py takes the I/O group but not add_reporting_args(): it has no progress loop and never had --interval, so adding one would be noise. --mol-column now defaults to None so SmilesReader infers it. With --id-column 0 the old hardcoded 0 pointed the molecule and ID columns at the same field; no manifest passes --mol-column, so the default path is unchanged. utils.py is untouched here. Removing it needs round_to_significant_number (5 uses in dmpk/pk_tmax_cmax_sim.py) replaced with sigfig.round, which changes numeric output, and get_path_from_digest (1 use in assemble_conformers.py) resolved. That follows separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 11, 2026
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.
Sixth consumer migration for InformaticsMatters/squonk2-jobs#18, and the first
of two PRs for this repo.
Summary
Replaces the hand-typed "Input/output options" block in seven scripts with
rdkit_utils.add_common_molecule_io_args(), and the interval reporting idiomwith
dm_job_utilities'add_reporting_args()/ProgressReporter:rdkit_props.py,rdkit_dedup.py,sa_score.py,cluster_butina.py,enumerate.py,le_conformers.py,im_mordred/descriptor_generator.pyNet −109/+45 lines. Dockerfile-prep and Dockerfile-mordred bumped to
im-data-manager-job-utilities>=1.4.0/im-rdkit-utilities>=1.1.2.No manifest changes.
--inputand--outputare retained as aliases by thehelper, so every existing command block keeps working — this is exactly what the
alias design in
squonk2-jobs#17
was for. The sweep to canonical
--infile/--outfileis deferred to before therelease that drops the aliases.
screen.pyis excluded — a real collisionIt uses
-dfor--descriptor, which collides with the helper's-dfor--delimiter:screen.pyis otherwise a strong adopter (9/11 options), so this is a genuineloss. Resolving it needs a decision:
-dfrom--descriptor. The manifest passes--descriptorlong-form, so no manifest change — but it removes a public short flag.
-d, e.g. ashort_flagsknob. Costs anim-rdkit-utilitiesrelease and adds API surface for one caller.Left out rather than decided unilaterally.
Other judgement calls
cluster_butina.pytakes the I/O group but notadd_reporting_args()—it has no progress loop and never had
--interval, so adding one would benoise.
sa_score.py,le_conformers.pyandenumerate.pygain--omit-fieldsand/or
--write-headerthey did not previously have, as members of theshared group. Unused and optional; the accepted cost of a common group.
--mol-columnnow defaults toNonesoSmilesReaderinfers it. With--id-column 0the old hardcoded0pointed the molecule and ID columns atthe same field. No manifest passes
--mol-column, so the default path isunchanged.
Verification
Output parity against
main, same inputs and arguments:rdkit_props.pyrdkit_dedup.pysa_score.pycluster_butina.pyenumerate.pyle_conformers.pyim_mordred/descriptor_generator.pycould not be run locally (mordrednotinstalled — it fails identically on
main). Its parsed namespace isidentical old vs new, and the same file lineage was validated end-to-end
with
joteinsquonk2-desc-mordred#3.
Parsed-namespace comparison, old vs new, for all seven. The only differences
are the four intended ones:
id_column:'1'→1(thestr_or_inttype)mol_column:0→None(reader inference, above)outfile→output(dest rename; call sites updated)omit_fields/write_headerkeys where the group adds themBuilding every parser also proves there are no other short-flag collisions —
screen.pywas the only one.jotewas not run — these Jobs need theinformaticsmatters/vs-prepimagerebuilt. Worth a CI run before merge.
Follow-up PR
utils.pyis untouched here. Removing it needs the two functions #18 flags asblockers resolved, and this repo is the only consumer that actually hits them:
round_to_significant_number— 5 uses, all indmpk/pk_tmax_cmax_sim.py.Replacing it with
sigfig.roundchanges numeric output, so it needs itsown validation and shouldn't ride along with a CLI refactor.
get_path_from_digest— 1 use inassemble_conformers.py.🤖 Generated with Claude Code