@@ -2894,29 +2894,24 @@ def quick_poly():
28942894 assert ctx1 .infer_generator_mapping (ctx ) == {0 : 0 , 1 : 1 }
28952895 assert ctx1 .drop_gens (ctx .names ()).infer_generator_mapping (ctx ) == {}
28962896
2897- # FIXME: Remove this guard when https://github.com/flintlib/flint/pull/2068 is
2898- # resolved
2899- if P is not flint .fmpz_mod_mpoly :
2900- assert quick_poly ().project_to_context (ctx1 ) == \
2901- ctx1 .from_dict (
2902- {(0 , 0 , 0 , 0 ): 1 , (0 , 1 , 0 , 0 ): 2 , (1 , 0 , 0 , 0 ): 3 , (2 , 2 , 0 , 0 ): 4 }
2903- )
2904- new_poly = quick_poly ().project_to_context (ctx1 )
2905- assert ctx1 .drop_gens (new_poly .unused_gens ()) == ctx
2906- assert new_poly .project_to_context (ctx ) == quick_poly ()
2907-
2908- new_poly = quick_poly ().project_to_context (ctx2 )
2909- new_ctx = ctx2 .drop_gens (new_poly .unused_gens ())
2910- assert new_ctx != ctx
2911- assert new_poly != quick_poly ()
2912-
2913- new_ctx = new_ctx .from_context (new_ctx , ordering = ctx .ordering ())
2914- assert new_ctx == ctx
2915- assert new_poly .project_to_context (new_ctx ) == quick_poly ()
2916-
2917- assert ctx .append_gens (* ctx1 .names ()[- 2 :]) == ctx1
2918- else :
2919- assert raises (lambda : quick_poly ().project_to_context (ctx1 ), NotImplementedError )
2897+ assert quick_poly ().project_to_context (ctx1 ) == \
2898+ ctx1 .from_dict (
2899+ {(0 , 0 , 0 , 0 ): 1 , (0 , 1 , 0 , 0 ): 2 , (1 , 0 , 0 , 0 ): 3 , (2 , 2 , 0 , 0 ): 4 }
2900+ )
2901+ new_poly = quick_poly ().project_to_context (ctx1 )
2902+ assert ctx1 .drop_gens (new_poly .unused_gens ()) == ctx
2903+ assert new_poly .project_to_context (ctx ) == quick_poly ()
2904+
2905+ new_poly = quick_poly ().project_to_context (ctx2 )
2906+ new_ctx = ctx2 .drop_gens (new_poly .unused_gens ())
2907+ assert new_ctx != ctx
2908+ assert new_poly != quick_poly ()
2909+
2910+ new_ctx = new_ctx .from_context (new_ctx , ordering = ctx .ordering ())
2911+ assert new_ctx == ctx
2912+ assert new_poly .project_to_context (new_ctx ) == quick_poly ()
2913+
2914+ assert ctx .append_gens (* ctx1 .names ()[- 2 :]) == ctx1
29202915
29212916 assert P (val = {(0 , 0 ): 1 }, ctx = ctx ) == ctx .from_dict ({(0 , 0 ): 1 })
29222917 assert P (ctx = ctx ).context () == ctx
0 commit comments