Skip to content

changed package name#13

Merged
amoschoomy merged 3 commits intomainfrom
ci-test
Feb 20, 2026
Merged

changed package name#13
amoschoomy merged 3 commits intomainfrom
ci-test

Conversation

@amoschoomy
Copy link
Contributor

No description provided.

@amoschoomy amoschoomy requested a review from Copilot February 20, 2026 03:07
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR renames the Python package from tcrgnn to graffit, updates tests/docs/scripts accordingly, and introduces/rewrites several core modules (graph generation, training, evaluation, plotting, utilities) to support the new package layout and updated serialization behavior.

Changes:

  • Rename imports across tests, docs, and scripts from tcrgnn to graffit.
  • Add/port graffit implementation modules (graph/edge generation, training loop/config, evaluation utilities, plotting, posthoc adjustment).
  • Update packaging metadata and dependency constraints in pyproject.toml, plus Sphinx API docs structure.

Reviewed changes

Copilot reviewed 58 out of 83 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/utils_tests/test_data_loading.py Update imports/monkeypatch targets to graffit.utils._data_loading.
tests/utils_tests/test_common_utils.py Update module import path to graffit.utils._common_utils.
tests/training_tests/test_train_api.py Update training API/config imports and monkeypatch paths to graffit.
tests/training_tests/test_loop.py Update training loop imports to graffit.training._loop.
tests/training_tests/test_config.py Update training config import to graffit.training._config.
tests/test_import.py Update package import smoke test to graffit.
tests/posthoc_adjustment_tests/test_transform.py Update posthoc transform import path to graffit.
tests/posthoc_adjustment_tests/test_out.py Update posthoc API imports and monkeypatch paths to graffit.
tests/posthoc_adjustment_tests/test_clonal_frequency.py Update clonal frequency import path to graffit.
tests/plotting_tests/test_charts.py Update plotting import path to graffit.plotting.charts.
tests/model_tests/test_model.py Update model import path to graffit.models.gatv2.
tests/generate_graph_tests/test_io.py Update graph IO imports; switch roundtrip load to load_graphs_from_disk.
tests/generate_graph_tests/test_encoding.py Update encoding import path to graffit.graph_gen.encodings.
tests/generate_graph_tests/test_build_graph.py Update build-graph import path to graffit.graph_gen._build_graph.
tests/generate_graph_tests/test_api.py Update graph generation API import/monkeypatch paths to graffit.
tests/generate_edge_tests/test_io.py Update edge IO import path to graffit.edge_gen._io.
tests/generate_edge_tests/test_generate_edge.py Update edge generation module import path to graffit.
tests/generate_edge_tests/test_api.py Update edge API imports and patch decorators to graffit.
tests/evaluate_tests/test_utils.py Update evaluate utils import path to graffit.evaluate._utils.
tests/evaluate_tests/test_predict.py Update evaluate predict module import path to graffit.
tests/evaluate_tests/test_api.py Update evaluate API import path to graffit.evaluate.api.
src/tcrgnn/graph_gen/_io.py Remove legacy tcrgnn graph-gen IO module.
src/graffit/utils/_data_loading.py Add safer load_graphs behavior with legacy fallback; keep train/test loaders.
src/graffit/utils/_common_utils.py Add tar extraction/archive/temp/cleanup helpers.
src/graffit/utils/init.py Export common utils + data loading functions from graffit.utils.
src/graffit/training/api.py Update model import to graffit.models.gatv2.
src/graffit/training/_loop.py Add training loop implementation with early stopping and checkpointing.
src/graffit/training/_config.py Add training configuration and path container dataclasses.
src/graffit/training/init.py Export training public API (train_model, config types).
src/graffit/posthoc_adjustment/api.py Update internal imports to graffit posthoc modules.
src/graffit/posthoc_adjustment/_transform.py Add percentile + blending + distribution-aware score adjustment functions.
src/graffit/posthoc_adjustment/_clonal_frequency.py Add clonal frequency merge helper for model output tables.
src/graffit/posthoc_adjustment/init.py Export posthoc adjustment API symbols.
src/graffit/posthoc_adjustment/README.md Add conceptual + mathematical documentation for posthoc calibration.
src/graffit/plotting/charts.py Add plotting utilities for score distributions, logits summaries, ROC.
src/graffit/plotting/init.py Export plotting entry points.
src/graffit/models/gatv2.py Add GATv2 model implementation.
src/graffit/models/init.py Export GATv2 model.
src/graffit/graph_gen/encodings.py Add PCA encoding loader + amino-acid mapping.
src/graffit/graph_gen/api.py Add graph generation APIs for dirs and tar.gz sources.
src/graffit/graph_gen/_io.py Add stable graph serialization payload format + load/save helpers.
src/graffit/graph_gen/_build_graph.py Add edgelist-to-PyG graph construction pipeline.
src/graffit/graph_gen/init.py Export graph generation API entry points.
src/graffit/fold_backend/init.py Package stub for fold backend namespace.
src/graffit/fold_backend/README.md Add placeholder README for fold backend.
src/graffit/evaluate/api.py Update evaluate imports to graffit.* and model import path.
src/graffit/evaluate/_utils.py Add device selection, loader creation, model loading, and score writing helpers.
src/graffit/evaluate/_predict.py Update import path to graffit.evaluate._utils.
src/graffit/evaluate/init.py Export evaluate API entry points.
src/graffit/edge_gen/cli.py Add placeholder CLI module.
src/graffit/edge_gen/api.py Update logger name to graffit.edgegen.
src/graffit/edge_gen/_io.py Update logger name to graffit.edgegen.io.
src/graffit/edge_gen/_generate_edge.py Add PDB parsing and edge list generation helpers.
src/graffit/edge_gen/init.py Export edge generation public API.
src/graffit/init.py Provide top-level package exports for core APIs.
scripts/train.py Update script imports to graffit.
pyproject.toml Rename project to graffit, update dependencies, and switch coverage target.
docs/source/tutorial/05_train_model.ipynb Update tutorial install/import commands to graffit.
docs/source/tutorial/04_posthoc_scoring_adjustment.ipynb Update tutorial install/import commands to graffit.
docs/source/tutorial/03_evaluating_model.ipynb Update tutorial install command to graffit.
docs/source/tutorial/02_generating_graph.ipynb Update tutorial install/import commands to graffit.
docs/source/tutorial/01_generating_edge.ipynb Update tutorial install/import commands to graffit.
docs/source/index.rst Update project name and API toctree to graffit.*.
docs/source/conf.py Update Sphinx project name and apidoc settings for graffit.
docs/source/api/tcrgnn.training.rst Remove old tcrgnn API doc stub.
docs/source/api/tcrgnn.posthoc_adjustment.rst Remove old tcrgnn API doc stub.
docs/source/api/tcrgnn.plotting.rst Remove old tcrgnn API doc stub.
docs/source/api/tcrgnn.models.rst Remove old tcrgnn API doc stub.
docs/source/api/tcrgnn.graph_gen.rst Remove old tcrgnn API doc stub.
docs/source/api/tcrgnn.fold_backend.rst Remove old tcrgnn API doc stub.
docs/source/api/tcrgnn.evaluate.rst Remove old tcrgnn API doc stub.
docs/source/api/modules.rst Add graffit root modules toctree.
docs/source/api/graffit.utils.rst Point API docs at graffit.utils.
docs/source/api/graffit.training.rst Add Sphinx API docs for graffit.training.
docs/source/api/graffit.rst Add Sphinx API docs for root graffit package and subpackages.
docs/source/api/graffit.posthoc_adjustment.rst Add Sphinx API docs for graffit.posthoc_adjustment.
docs/source/api/graffit.plotting.rst Add Sphinx API docs for graffit.plotting.
docs/source/api/graffit.models.rst Add Sphinx API docs for graffit.models.
docs/source/api/graffit.graph_gen.rst Add Sphinx API docs for graffit.graph_gen.
docs/source/api/graffit.fold_backend.rst Add Sphinx API docs for graffit.fold_backend.
docs/source/api/graffit.evaluate.rst Add/update Sphinx API docs for graffit.evaluate.
docs/source/api/graffit.edge_gen.rst Add Sphinx API docs for graffit.edge_gen.
README.md Update installation instructions to pip install graffit and note torch versioning.
Comments suppressed due to low confidence (1)

src/graffit/utils/_data_loading.py:38

  • allow_unsafe_legacy defaults to True, which means a failed "safe" load will automatically fall back to weights_only=False (unsafe pickle loading). For a library function, it’s safer to default this to False and require callers to opt in explicitly when loading trusted legacy files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3 to 4
from graffit.utils.device import get_device, set_seed

Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

graffit.utils.device (and set_seed) doesn’t exist in the current package layout, so this script will fail to import. Consider importing get_device from graffit.evaluate._utils (or adding a dedicated graffit/utils/device.py module) and providing a set_seed helper if it’s still needed.

Copilot uses AI. Check for mistakes.
Comment on lines 26 to 30
sys.path.insert(0, os.path.abspath("../../")) # adjust if needed

# -- Sphinx-apidoc configuration --------------------------------------------
apidoc_module_dir = "../../tcrgnn"
apidoc_module_dir = "../../graffit"
apidoc_output_dir = "api"
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the src/ layout, apidoc_module_dir = "../../graffit" is likely incorrect (the package lives under ../../src/graffit). As written, Sphinx apidoc may fail to find modules or generate empty docs; consider pointing apidoc to the src package directory and adjusting sys.path.insert accordingly.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback


from tcrgnn import GATv2, TrainConfig, TrainPaths, train
from tcrgnn.utils._data_loading import load_train_data
from graffit import GATv2, TrainConfig, TrainPaths, train
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from graffit import ... train will fail because graffit.__init__ doesn’t export a train symbol. Either import train from graffit.training._loop here, or re-export it from graffit/training/__init__.py (and then from graffit/__init__.py) if it’s intended to be part of the public API.

Suggested change
from graffit import GATv2, TrainConfig, TrainPaths, train
from graffit import GATv2, TrainConfig, TrainPaths
from graffit.training._loop import train

Copilot uses AI. Check for mistakes.
@amoschoomy amoschoomy merged commit 18797e6 into main Feb 20, 2026
10 checks passed
@amoschoomy
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

1 similar comment
@amoschoomy
Copy link
Contributor Author

@copilot open a new pull request to apply changes based on the comments in this thread

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.

2 participants