New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement differential protocols for all Clojure collection types (autodiff #5) #222
Conversation
Codecov Report
@@ Coverage Diff @@
## sritchie/diff_four #222 +/- ##
======================================================
- Coverage 83.96% 83.80% -0.16%
======================================================
Files 80 81 +1
Lines 8470 8523 +53
Branches 456 459 +3
======================================================
+ Hits 7112 7143 +31
- Misses 902 921 +19
- Partials 456 459 +3
Continue to review full report at Codecov.
|
@@ -105,7 +105,6 @@ | |||
`g/sin` has arity [:exactly 1].")))) | |||
|
|||
(deftest arity-tests | |||
(arity-check identity "vector") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had mistakenly implemented arity
for vectors to go check the arity of its contained functions. But this is wrong, because if you try to apply a vector (vs an up
), Clojure has already provided an IFn
implementation that simply looks up entries!
86f55e4
to
711ad43
Compare
@@ -2,6 +2,13 @@ | |||
|
|||
## [Unreleased] | |||
|
|||
- #222 adds `v/Value` implementations for Clojure sequences and maps. Maps and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider whether we could just get away with fmap
?
From the CHANGELOG entry:
Implement differential protocols for all Clojure collection types (autodiff #5) #222 adds
v/Value
implementations for Clojure sequences and maps. Maps andvectors implement
f/Arity
and return[:between 1 2].
zero?and
zero-likework on sequence entries and map values. Maps can specify their
v/kindreturn value with a
:typekey, and some of the calculus implementations do already make use of this feature.
g/partial-derivative` ona Clojure Map passes through to its values.
Implement differential protocols for all Clojure collection types (autodiff #5) #222 implements
d/IPerturbed
for Clojure maps, vectors and sequences;all are now valid return types for functions you pass to
D
.Implement differential protocols for all Clojure collection types (autodiff #5) #222 also implements
d/IPerturbed
for SICMUtilsMatrix
,Structure
,Series
,PowerSeries
andOperator
.