Skip to content

Development#24

Merged
gjbex merged 3 commits intomasterfrom
development
Jul 10, 2025
Merged

Development#24
gjbex merged 3 commits intomasterfrom
development

Conversation

@gjbex
Copy link
Copy Markdown
Owner

@gjbex gjbex commented Jul 10, 2025

Summary by Sourcery

Revise the training documentation to extend the total duration and adjust session timings, add a breakdown of difficulty levels, and include a new microbenchmarking notebook in the profiling materials.

Enhancements:

  • Add a microbenchmarking Jupyter notebook to the profiling documentation illustrating Python benchmarking pitfalls

Documentation:

  • Update the training schedule to 8 hours by extending session durations and removing the coffee break
  • Add a 'Level' section showing the introductory, intermediate, and advanced proportions

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Jul 10, 2025

Reviewer's Guide

This PR updates the training documentation by extending and rebalancing the schedule (now 8 hours), adds a breakdown of proficiency levels, and augments the profiling examples with a new microbenchmarking notebook.

File-Level Changes

Change Details Files
Revised training schedule and durations
  • Updated total duration to 8 hours
  • Increased session times for Cython (60→90), interfacing (30→60), multi-threaded programming (10→60), MPI (45→120), dask (15→30)
  • Removed the coffee break entry from the schedule
  • Realigned table formatting for uniform spacing
docs/README.md
Added proficiency level section
  • Created a new "Level" header
  • Defined percentages for Introductory, Intermediate, and Advanced levels
docs/README.md
Enhanced profiling documentation
  • Listed a new microbenchmarking.ipynb for Python microbenchmark pitfalls
source-code/profiling/README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@gjbex gjbex merged commit 5771679 into master Jul 10, 2025
Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @gjbex - I've reviewed your changes - here's some feedback:

  • The new schedule table sums to 430 minutes (~7 h10) but you’ve set the total duration to 8 h—either adjust the total or reinstate a break to match the sum.
  • There’s a typo in the Level section: “Intermeidate” should be “Intermediate.”
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new schedule table sums to 430 minutes (~7 h10) but you’ve set the total duration to 8 h—either adjust the total or reinstate a break to match the sum.
- There’s a typo in the Level section: “Intermeidate” should be “Intermediate.”

## Individual Comments

### Comment 1
<location> `source-code/profiling/microbenchmarking.ipynb:151` </location>
<code_context>
+   "source": [
+    "In fact, you can use similar functionality to time your code in Python scripts, so the use of `timeit` is not restricted to notebooks.\n",
+    "\n",
+    "The function `timeit.repeat(...)` is the most similar to the magic, but it has an additional feature.  It has an optional `setup` parameter.  This is a string or a callable that will be executed before each repeat, but its execution time is not taking into account for the benchmakr."
+   ]
+  },
</code_context>

<issue_to_address>
Typo in 'benchmakr', should be 'benchmark'.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    "The function `timeit.repeat(...)` is the most similar to the magic, but it has an additional feature.  It has an optional `setup` parameter.  This is a string or a callable that will be executed before each repeat, but its execution time is not taking into account for the benchmakr."
=======
    "The function `timeit.repeat(...)` is the most similar to the magic, but it has an additional feature.  It has an optional `setup` parameter.  This is a string or a callable that will be executed before each repeat, but its execution time is not taking into account for the benchmark."
>>>>>>> REPLACE

</suggested_fix>

### Comment 2
<location> `source-code/profiling/microbenchmarking.ipynb:343` </location>
<code_context>
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "def square_matrix(A):\n",
+    "    A **= 2"
+   ]
+  },
</code_context>

<issue_to_address>
Potential ambiguity in in-place operation for square_matrix.

`A **= 2` may not perform in-place modification for all numpy dtypes, especially with integer arrays that upcast. Use `np.square(A, out=A)` for consistent in-place behavior.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
    "def square_matrix(A):\n",
    "    A **= 2"
=======
    "def square_matrix(A):\n",
    "    import numpy as np\n",
    "    np.square(A, out=A)"
>>>>>>> REPLACE

</suggested_fix>

### Comment 3
<location> `docs/README.md:71` </location>
<code_context>
+## Level
+
+* Introductory: 10 %
+* Intermeidate: 30 %
+* Advanced: 60 %
+
</code_context>

<issue_to_address>
Typo: 'Intermeidate' should be 'Intermediate'.

Update the Level section to use the correct spelling.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
* Introductory: 10 %
* Intermeidate: 30 %
* Advanced: 60 %
=======
* Introductory: 10 %
* Intermediate: 30 %
* Advanced: 60 %
>>>>>>> REPLACE

</suggested_fix>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

"source": [
"In fact, you can use similar functionality to time your code in Python scripts, so the use of `timeit` is not restricted to notebooks.\n",
"\n",
"The function `timeit.repeat(...)` is the most similar to the magic, but it has an additional feature. It has an optional `setup` parameter. This is a string or a callable that will be executed before each repeat, but its execution time is not taking into account for the benchmakr."
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (typo): Typo in 'benchmakr', should be 'benchmark'.

Suggested change
"The function `timeit.repeat(...)` is the most similar to the magic, but it has an additional feature. It has an optional `setup` parameter. This is a string or a callable that will be executed before each repeat, but its execution time is not taking into account for the benchmakr."
"The function `timeit.repeat(...)` is the most similar to the magic, but it has an additional feature. It has an optional `setup` parameter. This is a string or a callable that will be executed before each repeat, but its execution time is not taking into account for the benchmark."

Comment on lines +343 to +344
"def square_matrix(A):\n",
" A **= 2"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion (bug_risk): Potential ambiguity in in-place operation for square_matrix.

A **= 2 may not perform in-place modification for all numpy dtypes, especially with integer arrays that upcast. Use np.square(A, out=A) for consistent in-place behavior.

Suggested change
"def square_matrix(A):\n",
" A **= 2"
"def square_matrix(A):\n",
" import numpy as np\n",
" np.square(A, out=A)"

Comment thread docs/README.md
Comment on lines +70 to +72
* Introductory: 10 %
* Intermeidate: 30 %
* Advanced: 60 %
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

issue (typo): Typo: 'Intermeidate' should be 'Intermediate'.

Update the Level section to use the correct spelling.

Suggested change
* Introductory: 10 %
* Intermeidate: 30 %
* Advanced: 60 %
* Introductory: 10 %
* Intermediate: 30 %
* Advanced: 60 %

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.

1 participant