Skip to content

Minor changes in response to 2026-02-25 course run#42

Merged
JostMigenda merged 4 commits intocarpentries-incubator:mainfrom
JostMigenda:JostMigenda/20260225_feedback
Mar 17, 2026
Merged

Minor changes in response to 2026-02-25 course run#42
JostMigenda merged 4 commits intocarpentries-incubator:mainfrom
JostMigenda:JostMigenda/20260225_feedback

Conversation

@JostMigenda
Copy link
Collaborator

Resolves several points mentioned in #40. In particular:

Added examples of agent-based models in various disciplines, to illustrate relevance of predprey model.

  • In the pandas/vectorisation exercise:
    • We could emphasize more strongly how the solution is basically just taking the existing pythagoras function and replacing df['f_vertical'] with vertical. Maybe switch from np.sqrt() to **0.5 to make this even more explicit?

Done; and explained why np.sqrt() is preferable.

  • Talking about “the vertical column” and “the horizontal column” is slightly awkward. 😅 Time to bikeshed column names? (My first thought was latitude/longitude, but that implies a spherical geometry, so Pythagoras is no longer valid; maybe length/width would work?)

Done.

  • Doing a live demo of the parallelised downloads example is scary; I’ve had a brief network glitch the first time I tried it, so I got a bunch of error messages. It worked a few seconds later when I tried a second time; but oof … That probably deserves an instructor note.

Improved exception handling so network glitches don’t lead to printing a full stack trace any more. Should now cause much less of an adrenaline spike if the demo fails; so I think this is okay.

* rename columns (b/c talking about “the horizontal column” is awkward)
* add explanation to solution (and highlight similarity to pythagoras function)
* minor import cleanup
* explicit exception handling to avoid printing full stacktrace in case of network issues
* use with statement instead of manual thread pool cleansup
@github-actions
Copy link

github-actions bot commented Mar 16, 2026

Thank you!

Thank you for your pull request 😃

🤖 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:

  • 🎯 correct output
  • 🖼️ correct figures
  • ❓ new warnings
  • ‼️ new errors

Rendered Changes

🔍 Inspect the changes: https://github.com/carpentries-incubator/pando-python/compare/md-outputs..md-outputs-PR-42

The following changes were observed in the rendered markdown documents:

 md5sum.txt              |  6 +++---
 optimisation-latency.md | 44 +++++++++++++++++++++++---------------------
 optimisation-numpy.md   | 47 +++++++++++++++++++++++++++--------------------
 profiling-functions.md  |  5 +++--
 4 files changed, 56 insertions(+), 46 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.

⏱️ Updated at 2026-03-17 12:58:13 +0000

github-actions bot pushed a commit that referenced this pull request Mar 16, 2026
Copy link
Collaborator

@Robadob Robadob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this in principle.

Do let me know if you would like me to write a longer summary of the model (and ABM), it wouldn't be too difficult to draft, though it will probably end up being several hundred words.

github-actions bot pushed a commit that referenced this pull request Mar 17, 2026
@JostMigenda
Copy link
Collaborator Author

I think several hundred words of explanation in the main text would be too much. But a slightly longer summary of the model, to help people looking at the code get an overview over the structure, could be good as a module-level docstring in predprey.py itself.

That’s independent of this PR, though; so I’ll merge this one now. Thanks for the review!

@JostMigenda JostMigenda merged commit a66b678 into carpentries-incubator:main Mar 17, 2026
5 checks passed
@JostMigenda JostMigenda deleted the JostMigenda/20260225_feedback branch March 17, 2026 13:03
github-actions bot pushed a commit that referenced this pull request Mar 17, 2026
Auto-generated via `{sandpaper}`
Source  : a66b678
Branch  : main
Author  : Jost Migenda <jost.migenda@kcl.ac.uk>
Time    : 2026-03-17 13:02:51 +0000
Message : Merge pull request #42 from JostMigenda/JostMigenda/20260225_feedback

Minor changes in response to 2026-02-25 course run
github-actions bot pushed a commit that referenced this pull request Mar 17, 2026
Auto-generated via `{sandpaper}`
Source  : 27dd896
Branch  : md-outputs
Author  : GitHub Actions <actions@github.com>
Time    : 2026-03-17 13:04:59 +0000
Message : markdown source builds

Auto-generated via `{sandpaper}`
Source  : a66b678
Branch  : main
Author  : Jost Migenda <jost.migenda@kcl.ac.uk>
Time    : 2026-03-17 13:02:51 +0000
Message : Merge pull request #42 from JostMigenda/JostMigenda/20260225_feedback

Minor changes in response to 2026-02-25 course run
@Robadob
Copy link
Collaborator

Robadob commented Mar 17, 2026

I think several hundred words of explanation in the main text would be too much. But a slightly longer summary of the model, to help people looking at the code get an overview over the structure, could be good as a module-level docstring in predprey.py itself.

That’s independent of this PR, though; so I’ll merge this one now. Thanks for the review!

Thanks, I'll add it to my private todo list and hopefully find time before next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants