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

Question 2.11 in lecture 2 #62

Closed gems-rk23 closed 1 year ago

gems-rk23 commented 1 year ago

Can I know my mistake for my code, I could not figure it out.

gems-rk23 commented 1 year ago

IMG_0004

marijanbeg commented 1 year ago

Hi @gems-68239853, thank you for raising this issue. PyBryt reference solution we use for this exercise expects the for loop to be used inside f_cubic function. In other words, f_cubic function takes a metric as an input and returns matrix. I hope this clarifies the requirements of this exercise. Please feel free to reopen this issue or comment if we can provide further information.

gems-rk23 commented 1 year ago

I tried to understand your comment and I updates the code as shown below:

IMG_0007

it only solved the second comment:

REFERENCE: exercise-2_11 SATISFIED: False MESSAGES:

marijanbeg commented 1 year ago

Hi @gems-68239853, do the assert statements in the cell below pass?

acse-bg1223 commented 1 year ago

I am having similar problems with the exercise

Screenshot 2023-09-06 at 19 15 45

The pybryt solution doesn't seem to accept my solution. Not getting any issues with assert tests though

gems-rk23 commented 1 year ago

The assert statements shows nothing when I press (shift+enter) to run it, assuming it passed successfuly.

marijanbeg commented 1 year ago

If your assert statements do not raise any errors, then your implementation is probably correct. Here is the explanation why PyBryt is not happy:

Although PyBryt provides much more detailed feedback, it is possible it complains about your code even though assert statement confirms your code is correct. This is because PyBryt testing is based on comparing your solution to reference solutions. Since there is virtually an infinite number of alternative solutions, it is possible that your solution is not in our references. On the other hand, assert statements check the final result of your code and if they do not raise an error, your code is correct and you do not have to address PyBryt's error messages (if any).