Skip to content

Evaluate#48

Merged
fredshone merged 22 commits into
mainfrom
evaluate
Apr 27, 2026
Merged

Evaluate#48
fredshone merged 22 commits into
mainfrom
evaluate

Conversation

@fredshone

Copy link
Copy Markdown
Collaborator

evaluate module split into the acteval project, now external.

Copilot AI left a comment

Copy link
Copy Markdown

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 migrates Caveat’s evaluation functionality to the external acteval project, removing the in-repo caveat.evaluate implementation and updating dependencies, examples, and CI/docs workflows accordingly.

Changes:

  • Remove caveat.evaluate source + its unit tests, and add acteval as a dependency.
  • Update runtime imports (e.g., runners) and example notebooks to use acteval APIs.
  • Update CI/docs/release workflows to install the new PyPI dependency set.

Reviewed changes

Copilot reviewed 67 out of 74 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_eval/test_report.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_frequency.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_filter.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_features_utils.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_features_transitions.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_features_times.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_features_structural.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_features_participation.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_distance_scalar.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_distance_hamming.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_distance_emd.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_distance_edit_distance.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_describe_features.py Remove legacy evaluate tests (moved to acteval).
tests/test_eval/test_creativity.py Remove legacy evaluate tests (moved to acteval).
tests/bench_evaluate.py Add benchmark harness for evaluation pipeline.
requirements/pip.txt Add PyPI-only deps list (includes acteval).
pyproject.toml Include requirements/pip.txt in dynamic dependencies.
mkdocs.yml Fix MkDocs Material emoji generator reference.
examples/4_creativity.ipynb Switch creativity example to acteval imports + refreshed outputs/metadata.
examples/3_NTS_population_demo.ipynb Switch plotting imports to acteval; clear execution count.
examples/2_synthetic_population_gen.ipynb Switch plotting imports to acteval; clear execution count.
caveat/runners.py Import evaluation/reporting from external acteval.
caveat/models/seq2seq/lstm.py Docstring/type tweaks to predict_step.
caveat/models/seq2score/lstm.py Docstring/type tweaks to predict_step.
caveat/models/schedule2label/feedforward.py Update loss function docstring argument names.
caveat/models/joint_vaes/jvae_continuous_rerouted.py Docstring param rename (device).
caveat/models/joint_vaes/jvae_continuous.py Docstring param rename (device).
caveat/models/discrete/vae_discrete_xattention.py Docstring param rename (device).
caveat/models/discrete/auto_discrete_lstm.py Docstring param rename (top_sampler).
caveat/models/continuous/vqvae_lstm.py Docstring param rename (device).
caveat/models/continuous/vae_attention.py Docstring param rename (device).
caveat/models/continuous/cvqvae_lstm.py Docstring param rename + add labels doc.
caveat/models/continuous/cvae_lstm_nudger_adversarial.py Docstring clarify predict args.
caveat/models/continuous/cvae_lstm_nudger.py Docstring clarify predict args.
caveat/models/continuous/cvae_lstm_nudge_feed.py Docstring clarify predict args.
caveat/models/continuous/cvae_lstm_double_nudger.py Docstring clarify predict args.
caveat/models/continuous/cvae_lstm.py Docstring clarify decode/predict args.
caveat/models/continuous/auto_attention.py Docstring + argument naming updates in attention model.
caveat/models/cat_base.py Docstring param rename (device).
caveat/models/base.py Docstring param rename (device).
caveat/jrunners.py Add type annotation + clarify jbatch_command args.
caveat/evaluate/ops.py Remove in-repo evaluation ops (now external).
caveat/evaluate/filters.py Remove in-repo evaluation filters (now external).
caveat/evaluate/features/utils.py Remove in-repo evaluation features (now external).
caveat/evaluate/features/transitions.py Remove in-repo evaluation features (now external).
caveat/evaluate/features/times.py Remove in-repo evaluation features (now external).
caveat/evaluate/features/structural.py Remove in-repo evaluation features (now external).
caveat/evaluate/features/participation.py Remove in-repo evaluation features (now external).
caveat/evaluate/features/frequency.py Remove in-repo evaluation features (now external).
caveat/evaluate/features/creativity.py Remove in-repo evaluation features (now external).
caveat/evaluate/evaluate.py Remove in-repo evaluation driver (now external).
caveat/evaluate/distance/wasserstein.py Remove in-repo evaluation distance impl (now external).
caveat/evaluate/distance/scalar.py Remove in-repo evaluation distance impl (now external).
caveat/evaluate/distance/init.py Remove in-repo evaluation distance exports.
caveat/evaluate/describe/transitions.py Remove in-repo evaluation plotting (now external).
caveat/evaluate/describe/times.py Remove in-repo evaluation plotting (now external).
caveat/evaluate/describe/frequency.py Remove in-repo evaluation plotting (now external).
caveat/encoding/discrete.py Fix spelling + clarify decode docstrings.
caveat/data/samplers.py Add/adjust type hints for sampling utilities.
README.md Add step to install PyPI dependencies from requirements/pip.txt.
.github/workflows/release.yml Inline conda upload + docs deploy steps; install pip deps.
.github/workflows/pre-release.yml Inline conda build steps.
.github/workflows/pr-ci.yml Inline CI steps; install pip deps; upload coverage.
.github/workflows/docs.yml Inline docs build/deploy steps; install pip deps.
.github/workflows/daily-scheduled-ci.yml Inline scheduled CI steps; install pip deps.
.github/workflows/commit-ci.yml Inline commit CI steps; install pip deps.
Comments suppressed due to low confidence (3)

caveat/models/seq2score/lstm.py:110

  • This predict_step override is not compatible with PyTorch Lightning: Trainer.predict() will call predict_step(self, batch, batch_idx, ...), so the current signature (batch, device: int, ...) will raise a TypeError. Either remove this override to use Experiment.predict_step, or update the signature to accept batch_idx (and rely on Lightning for device placement). Also, the return annotation/docstring say Tensor, but the method returns a tuple.
    caveat/models/continuous/auto_attention.py:90
  • decode() is annotated to return Tuple[Tensor, Tensor], but it returns a single Tensor (log_probs). This mismatch will confuse callers and static type checkers; update the return annotation (and/or implementation) so they agree.
    caveat/models/seq2seq/lstm.py:190
  • This predict_step override is not compatible with PyTorch Lightning: Trainer.predict() will call predict_step(self, batch, batch_idx, ...), so the current signature (batch, device: int, ...) will raise a TypeError. Either remove this override to use Experiment.predict_step, or change the signature to accept batch_idx (and avoid passing an explicit device, since Lightning already moves tensors to the right device). Also, the return annotation/docstring say Tensor, but the method returns a tuple.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tests/bench_evaluate.py Outdated
Comment on lines +14 to +16
from caveat.data.synth import ActivityGen
from caveat.evaluate.evaluate import process_metrics

Comment thread tests/bench_evaluate.py Outdated
Comment on lines +1 to +6
"""Benchmark harness for caveat.evaluate.

Usage:
python tests/bench_evaluate.py --population 1000 --activities 10
python tests/bench_evaluate.py --population 5000 --activities 15
"""
Comment thread caveat/data/samplers.py
def sample_data(
sequences: DataFrame, attributes: Optional[DataFrame], config: dict
):
) -> tuple:
Comment on lines 105 to 108
def predict_sequences(
self, current_device: int, **kwargs
) -> Tuple[Tensor, Tensor]:
"""Given samples from the latent space, return the corresponding decoder space map.
@fredshone
fredshone merged commit f53c63b into main Apr 27, 2026
9 of 17 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.

2 participants