@@ -98,14 +98,13 @@ def update_log_level() -> None:
98
98
PythonLoggingToLogbackAdapter .setLevel (logger .getEffectiveLevel ())
99
99
100
100
101
- def register_python_java_type_mappings ():
101
+ def register_score_python_java_type_mappings ():
102
102
global _scores_registered , _java_score_mapping_dict , _python_score_mapping_dict
103
103
if _scores_registered :
104
104
return
105
105
106
106
_scores_registered = True
107
107
108
- # score types
109
108
from .score ._score import SimpleScore , HardSoftScore , HardMediumSoftScore , BendableScore
110
109
from ai .timefold .solver .core .api .score .buildin .simplelong import SimpleLongScore as _SimpleScore
111
110
from ai .timefold .solver .core .api .score .buildin .hardsoftlong import HardSoftLongScore as _HardSoftScore
@@ -138,20 +137,6 @@ def register_python_java_type_mappings():
138
137
add_python_java_type_mapping (HardMediumSoftScorePythonJavaTypeMapping (HardMediumSoftScoreType ))
139
138
add_python_java_type_mapping (BendableScorePythonJavaTypeMapping (BendableScoreType ))
140
139
141
- # score analysis types
142
- from .score ._score_analysis import ConstraintRef
143
- from ai .timefold .solver .core .api .score .constraint import ConstraintRef as _ConstraintRef
144
-
145
- from ai .timefold .solver .python .score .constraint import ConstraintRefPythonJavaTypeMapping
146
-
147
- _python_score_mapping_dict ['ConstraintRef' ] = ConstraintRef
148
-
149
- _java_score_mapping_dict ['ConstraintRef' ] = _ConstraintRef
150
-
151
- ConstraintRefType = translate_python_class_to_java_class (ConstraintRef )
152
-
153
- add_python_java_type_mapping (ConstraintRefPythonJavaTypeMapping (ConstraintRefType ))
154
-
155
140
156
141
def forward_logging_events (event : 'PythonLoggingEvent' ) -> None :
157
142
logger .log (event .level ().getPythonLevelNumber (),
@@ -316,7 +301,7 @@ def _add_to_compilation_queue(python_class: type | PythonSupplier) -> None:
316
301
def _process_compilation_queue () -> None :
317
302
global _compilation_queue
318
303
319
- register_python_java_type_mappings ()
304
+ register_score_python_java_type_mappings ()
320
305
while len (_compilation_queue ) > 0 :
321
306
python_class = _compilation_queue .pop (0 )
322
307
@@ -339,7 +324,7 @@ def _generate_constraint_provider_class(original_function: Callable[['_Constrain
339
324
wrapped_constraint_provider : Callable [['_ConstraintFactory' ],
340
325
list ['_Constraint' ]]) -> JClass :
341
326
ensure_init ()
342
- register_python_java_type_mappings ()
327
+ register_score_python_java_type_mappings ()
343
328
from ai .timefold .solver .python import PythonWrapperGenerator # noqa
344
329
from ai .timefold .solver .core .api .score .stream import ConstraintProvider
345
330
class_identifier = _get_class_identifier_for_object (original_function )
0 commit comments