Repository navigation
Rplibs - #50
Merged
Merged
Rplibs#50
Conversation
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>
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.