Skip to content

Rplibs - #50

Merged
breakthewall merged 9 commits into
stablefrom
rplibs
Oct 20, 2026
Merged

breakthewall merged 9 commits into
stablefrom
rplibs

Conversation

@breakthewall

Copy link
Copy Markdown
Member

No description provided.

breakthewall and others added 9 commits October 20, 2026 10:11
Pathway.__init__ calls set_target_id(None), which dispatches to
rpPathway.set_target_id and then __build_intermediate_species, both of
which read self.__species_groups. Since that attribute was assigned
after the Pathway.__init__ call, every rpPathway construction raised
AttributeError: 'rpPathway' object has no attribute
'_rpPathway__species_groups'. This broke selenzy-wrapper's planemo
tests (and any other caller building an rpPathway from an SBML file).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
RDKit's rendered SVG markup for a molecule (attributes, styling) can
change across RDKit versions even though the molecule itself is
unchanged, and rdkit is unpinned in environment.yaml. Comparing it
byte-for-byte against the golden tests/rpviz/outputs/network.json made
test_dir_input/test_tar_input fail on every RDKit upgrade despite no
actual regression. The 'svg' field is now excluded from the DeepDiff
comparison; the rest of the generated network (structure, ids, etc.)
is still verified.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Brings the codebase into compliance with ruff's default rule set and
black formatting, ahead of a new .github/workflows/lint.yml CI job
that enforces both. Highlights:

- N999: rename 17 PascalCase modules to snake_case (Args.py -> args.py
  per package, rpPathway.py -> rp_pathway.py, rpSBML.py -> rp_sbml.py,
  etc.) plus their 7 mirrored test files, and update every internal
  import. No sibling repo imports these by file path (verified), only
  via the rptools.rplibs package, so this is not a breaking change for
  downstream consumers.
- B008: move ~88 `logger: Logger = getLogger(__name__)` call-defaults
  out of signatures into `logger = logger or getLogger(__name__)` at
  the top of each function body (same effective default, no call at
  import/def time).
- LOG015, F401, TRY203, RUF012, SIM102/113/114/117, PLC0206, E722,
  PLW0602, PLR1704, EXE001/EXE005: mechanical fixes (module loggers
  instead of the root logger, explicit __all__, dead try/except
  removal, ClassVar on mutable class defaults, collapsed nested ifs,
  dict.items() iteration, bare except narrowed, unused globals/locals
  removed, executable bit set on real shebangs).
- BLE001, SIM115: narrowed the one `except BaseException` to
  `except Exception`; the remaining broad catches around network/
  third-party calls (requests, libsbml, eQuilibrator, RDKit) and two
  file handles whose lifetime must outlive the function (an h5py
  Dataset and a csv.reader returned to the caller) are intentional and
  now carry a `# noqa` plus a one-line reason instead of being
  papered over with a guessed, possibly-incomplete exception type.
- F811: rp_graph.py and rp_sbml.py each had a method defined twice
  (orderedRetroReactions; check_SBML_compartment; check_SBML_rxnid).
  Deleted the shadowed first definition in each pair and kept whatever
  Python was already executing (the second one), so this is a
  behavior-preserving dead-code removal, not a logic change.
- black: reformatted the files it flagged.

Verified: ruff check . and black --check . both pass; full test suite
gives the same 29 pre-existing failures (all tests/rplibs/test_rp_pathway.py,
tests/rpcompletion, tests/rpfba) as on a clean, unmodified checkout --
traced to the installed rr_cache 3.6.1 package, unrelated to this change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
environment-dev.yaml gains black and ruff (needed by the new lint.yml
CI job) and pytest-monitor. deepdiff moves to environment.yaml, where
it's listed under the rpviz dependency group even though it's
currently only imported by rpviz's own CLI tests (tests/rpviz/test_cli.py),
not by rptools/rpviz itself. brs_utils is pinned to <1.26.0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
deepdiff is only imported by rpviz's CLI tests (tests/rpviz/test_cli.py),
not by rptools/rpviz itself, so it belongs with the other dev/test
dependencies rather than the runtime environment.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Switches to the same ci-env + mamba setup pattern as the new lint.yml
job, adds a build matrix (ubuntu/macos/windows), and triggers on
pull_request in addition to pushes to main/master/stable.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@breakthewall
breakthewall merged commit e37043c into stable Oct 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant