Macaulay2 / Macaulay2/M2

Add assertLevel and automatic timer

Open
#3,211 4 comments 0 reactions 0 assignees View on GitHub
Interpreter
Dominant language
Macaulay2
Stars
435
Forks
297
Avg merge
4d 20h
Merged PRs (30d)
11

Description

We should add a global function like `assertLevel` and promote a practice of adding things like this whenever possible:
```m2
if assertLevel > 0 then assert isWellDefined X;
if assertLevel > 1 then assert verifyResult X;
if assertLevel > 2 then ...
```
In particular, deeper methods in Core should have a higher threshold than methods in packages. This should also replace `Verify` option of `inducedMap,lift,extend`.

Tangentially related: is there something I could add in my `init.m2` file so that every command I enter in the interpreter automatically gets called with `elapsedTime`? e.g. sometimes I want to see elapsedTime for everything without typing it every time. Perhaps there could be a global boolean flag like `notify`, say `benchmarkMode` or `timingMode`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining the interpreter's handling of commands and the init.m2 configuration path, then inspect elapsedTime and the Verify option for inducedMap, lift, and extend. The issue proposes both an assertLevel mechanism and automatic timing, so first determine whether these are separate changes and where Core versus package behavior is defined. Done means the intended thresholds and timing behavior are specified and covered by tests.

Written by the indexing model from the issue text.

Assessment

Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.