-
-
Notifications
You must be signed in to change notification settings - Fork 69
Add ch7, covariant tests #381
Conversation
@phasetr, I will write more later, but I spoke with Sussman and you found a legit bug in the code from the book! The fix is in the definition of https://github.com/sicmutils/sicmutils/blob/master/src/sicmutils/calculus/covariant.cljc#L228 Same fix for the scheme code in the book. Here is the correct |
@phasetr ACTUALLY after another round with Sussman, and now that I understand the problem better, this PR will fix the library so that the code from the book works as is. That conceptually makes more sense. Hold tight until I get more tests ported and get this merged! |
Codecov Report
@@ Coverage Diff @@
## master #381 +/- ##
==========================================
+ Coverage 84.07% 84.61% +0.53%
==========================================
Files 97 97
Lines 12876 12886 +10
Branches 688 691 +3
==========================================
+ Hits 10826 10903 +77
+ Misses 1362 1292 -70
- Partials 688 691 +3
Continue to review full report at Codecov.
|
This PR addresses issues noticed by @phasetr in ch7 of FDG. I also noticed a number of tests in
covariant_derivative.scm
that I had missed; porting those exposed a bug in the text, which is fixed as of this PR.From the CHANGELOG:
sicmutils.calculus.coordinate/generate
moves tosicmutils.calculus.manifold/c:generate
; this supports a bugfix where1-dimensional manifolds like
R1-rect
, akathe-real-line
, return acoordinate prototype of a single element like
t
instead of a structurewith a single entry, like
(up t)
. Thanks to @phasetr for the bug reportthat led to this fix, and @gjs for finding and fixing the bug.
same.ish/Approximate
implemented forsicmutils.structure/Structure
,allowing
ish?
comparison ofup
anddown
structures with approximateentries. Require
sicmutils.generator
for this feature. (NOTE: becauseprotocols are implemented for the LEFT argument,
(ish? <vector> (down ...))
will still return true if the values are approximately equal, eventhough a
<vector>
is technically anup
and should NOT equal adown
. Doan explicit conversion to
up
usingsicmutils.structure/vector->up
ifthis distinction is important.)
same.ish/Approximate
now defers tosicmutils.value/=
for equalitybetween
Symbol
and other types. This letsish?
handle equality betweensymbols like
'x
and literal expressions that happen to wrap a singlesymbol.
Cartan->Cartan-over-map
now does NOT compose(differential map)
with itsinternal Cartan forms. This fixed a bug in a code listing in section 7.3 of
FDG.
Section 7.3 of FDG implemented as tests in
sicmutils.fdg.ch7-test
.Many new tests and explorations ported over from
covariant-derivative.scm
.These live in
sicmutils.calculus.covariant-test
.timeout exceptions resulting from full GCD are now caught in tests using
sicmutils.simplify/hermetic-simplify-fixture
. Previously, setting a lowtimeout where simplification failed would catch and move on in normal work,
but fail in tests where fixtures were applied.