Fix logical error in scaling code
When teaching this section the result was unexpected. I believe there is a bug in the logic of the code that went undetected so far.
Inverting the scaling factor "fixed the issue" and made the code easier to understand for learners.
Thank you!
Thank you for your pull request :smiley:
:robot: This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.
If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
- :dart: correct output
- :framed_picture: correct figures
- :question: new warnings
- :bangbang: new errors
Rendered Changes
:mag: Inspect the changes: https://github.com/swcarpentry/python-novice-inflammation/compare/md-outputs..md-outputs-PR-1096
The following changes were observed in the rendered markdown documents:
10-defensive.md | 2 +-
md5sum.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
What does this mean?
If you have source files that require output and figures to be generated (e.g. R Markdown), then it is important to make sure the generated figures and output are reproducible.
This output provides a way for you to inspect the output in a diff-friendly manner so that it's easy to see the changes that occur due to new software versions or randomisation.
:stopwatch: Updated at 2025-02-27 10:03:04 +0000
This is an intended error in the code to trigger the assertion, which is explained in https://github.com/swcarpentry/python-novice-inflammation/blob/dcb33beeb1763c70507073f6fc0fa5ef1049144a/episodes/10-defensive.md?plain=1#L220. Changing this would break the rest of the lesson.