Skip to content

Commit

Permalink
added better error messages for pushForward
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed May 12, 2024
1 parent 5162039 commit 1995bd4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion M2/Macaulay2/m2/pushforward.m2
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,11 @@ updateComputation(PushforwardComputation, Module) := Module => options pushForwa

pushForward(RingMap, Module) := Module => opts -> (f, M) -> (
R := ring M;
assert( target f === R );
strategy := opts.Strategy;

-- error checking
if target f =!= R then error "expected module over the target of the ring map";

-- this logic runs the strategies in order, or the specified strategy
computation := (opts, container) -> (
runHooks((pushForward, RingMap, Module), (opts, f, M), Strategy => strategy));
Expand Down

0 comments on commit 1995bd4

Please sign in to comment.