Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
343 stars 230 forks source link

Move OptionalComponentsPresent from newPackage to beginDocumentation #3369

Open mahrud opened 2 months ago

mahrud commented 2 months ago

I generally don't appreciate packages that run an external program upon being loaded (which also ends up happening when Macaulay2Doc is being installed, c.f. #3292).

Perhaps OptionalComponentsPresent should be set after newPackage in the call to beginDocumentation, so that loading could stop there if the optional component is not present.

(Originally from https://github.com/Macaulay2/M2/pull/3366#discussion_r1685557557)

mahrud commented 2 months ago

Packages that do this: https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/CoincidentRootLoci.m2#L14 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/RInterface.m2#L10 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/PHCpack.m2#L1 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/Bertini.m2#L1 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/NCAlgebra.m2#L19 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/MonomialIntegerPrograms.m2#L33 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/NumericalSchubertCalculus.m2#L1

Slightly better, but still: https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/StatePolytope.m2#L2 https://github.com/Macaulay2/M2/blob/ec9e9ac60ed4a8e791448942202f077a88a87e15/M2/Macaulay2/packages/Python.m2#L5

mahrud commented 1 month ago

Relevant: #1854 And #1415, but that's one specific instance.