Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support deep_planning_clone class decorator #1271

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

luxaritas
Copy link

This brings parity with the Java version (I also found that DeepPlanningClone did not work on a planning solution ProblemFactCollectionProperty, whereas marking the entire class to deep clone does)

@luxaritas luxaritas changed the title Support deep_planning_clone class decorator feat: Support deep_planning_clone class decorator Dec 11, 2024
@triceo
Copy link
Contributor

triceo commented Dec 11, 2024

Thank you for your contribution, @luxaritas!

We are a bit short-handed at the moment, with many people already taking their year-end holidays. I'm going to leave this one open until my colleague, who owns the Python part of the codebase, comes back in early January and does a code review.

Please be patient - we have every intention to merge this PR.

@triceo triceo added this to the v1.18.0 milestone Dec 11, 2024
@triceo
Copy link
Contributor

triceo commented Dec 11, 2024

On a general note though:

  • Please make sure the existing test coverage passes. At the moment, it does not:

    py310: commands[0]> pytest --import-mode=importlib python/python-core/tests
    ImportError while loading conftest '/Users/runner/work/timefold-solver/timefold-solver/python/python-core/tests/conftest.py'.
    python/python-core/tests/conftest.py:1: in
    import timefold.solver
    .tox/py310/lib/python3.10/site-packages/timefold/solver/init.py:50: in
    import timefold.solver.domain as domain
    .tox/py310/lib/python3.10/site-packages/timefold/solver/domain/init.py:28: in
    from ._annotations import *
    .tox/py310/lib/python3.10/site-packages/timefold/solver/domain/_annotations.py:876: in
    def deep_planning_clone(entity_class: Type[A] = None) -> Type[A]: E NameError: name 'A' is not defined
    py310: exit 4 (0.21 seconds) /Users/runner/work/timefold-solver/timefold-solver> pytest --import-mode=importlib python/python-core/tests pid=3876

This issue also happens on Python 3.11 and 3.12. (We do not yet support 3.13.)

  • Please introduce extra coverage for your change. There ought to be a test to check whether the deep-cloning works when declared.

@luxaritas
Copy link
Author

Completely understand folks being out - I have my own local adjustments for my PRs so no big deal for me anyways!

I caught the CI failure after I'd already stepped away - copy-paste error. Will look into tests as well.

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