Open mattagape opened 6 years ago
coeff
parameter is neither explained nor used again in the solution__init__.py
file and .model
syntax in a future lesson (packaging)if density.ndim != 1:
: extra "an"test_energy_fails_on_negative_density
: fix formatting (energy
should be under with ...
)test_derivative
: I don't see what the d.../dn
expression contributes, or where it comes fromtest_derivative
(again): The 2 * [...] if [...] > 0 else 0
isn't needed, since the numbers will be non-negative and the result for 0 will be the same either way
likelyhood should be likelihood
The text says "Given a vector n of positive integers, and of arbitrary length" <-- what do these integers represent? Number of particles at each position (vector index)? (we have to look at the code to see what he means)
The starting point is given as: def energy(density, coeff=1.0): But I don't think coefficient is used anywhere. It isn't defined properly either. It made me look ahead to the solution to see what it was used for (it wasn't).
Not sure what the point of def test_derivative(): is. I understand d(n^2-1)/dn = 2n but why are we doing this at all?
Test coverage. When I ran it I got:
test_model.py ...... [100%]
---------- coverage: platform darwin, python 3.6.5-final-0 ----------- Name Stmts Miss Cover
init.py 0 0 100% model.py 10 0 100% test_model.py 32 0 100%
TOTAL 42 0 100%
============================================== 6 passed in 0.03 seconds ===============================================