ese-msc / introduction-to-python

"Introduction to Python" course for future Imperial College London MSc students
BSD 3-Clause "New" or "Revised" License
75 stars 94 forks source link

exercise 2-11 vectorized function #72

Closed gems-aan23 closed 1 year ago

gems-aan23 commented 1 year ago

Hi, in exercise 2-11, after writing the f_cubic function, I got 2 errors from the pybryt check: ERROR: You are not populating resulting vector correctly ERROR: Hmmm... The result of your function is wrong.

I got no error at all on the assertion cell. Looking at it, it is interesting to see that the assertion cell has np.allclose(f_cubic(A33), np.power(A33, 3) + np.multiply(A33, np.exp(A33)) + 1) which means that the f_cubic function written is outputting the correct array. What exactly the result that the PyBryt expect to be return from the function so that the second ERROR goes right?

And for the first error, I have tried different forms of iteration (using i and j separately, using np.ndenumerate), is there any hints to what the PyBryt expect for the first ERROR?

Thanks!

gems-aan23 commented 1 year ago

My code for reference

image
marijanbeg commented 1 year ago

Hi @gems-a55c7bf2, if the assert tests are passing, then your solution is correct. PyBryt tests are failing because our reference solution does not cover yours.