From 6ef78dbbec63d9d2cadb70f1d6e98da904219dc7 Mon Sep 17 00:00:00 2001 From: anacmontoya <142039433+anacmontoya@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:15:33 -0600 Subject: [PATCH 1/2] Git Branches section edits (#476) * added note about touch command which does not work on windows and fixed typo * rewrote Complete Workflow section in Git Branches for clarity * section explaining how to set upstream branch changed the name of branch unexpectedly from branchA to newbranch. fixed this * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * changed note about touch command to match the style of other admonitions * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update `touch` note Co-authored-by: Brian Rose * Update foundations/github/git-branches.md Co-authored-by: Brian Rose * Update foundations/github/git-branches.md Co-authored-by: Brian Rose --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Brian Rose --- foundations/github/git-branches.md | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/foundations/github/git-branches.md b/foundations/github/git-branches.md index 5ee0bd1bc..832cef99a 100644 --- a/foundations/github/git-branches.md +++ b/foundations/github/git-branches.md @@ -146,6 +146,11 @@ Before we push this branch upstream, let's make some sample changes (like C3 or touch hello.py ``` +```{admonition} Note +:class: info +`touch` is not a Windows native command. You can use `type nul > hello.py` to create an empty file instead. +``` + ![Git Status](../../images/6-samplechange.png) You can check that this file has been created by comparing an `ls` before and after this command, and also with a `git status` that will show your new untracked file. @@ -182,7 +187,7 @@ Thankfully, Git provided this command in the previous error message. If you clon We can see that this worked by doing a `git branch -a` -Notice the new branch called `remotes/origin/newbranch`. And when you do a `git status` you'll see that we are up to date with this new remote branch. +Notice the new branch called `remotes/origin/branchA`. And when you do a `git status` you'll see that we are up to date with this new remote branch. ![Git Commit Status](../../images/7-github-branchandstatus.png) @@ -269,22 +274,23 @@ git pull `git pull` is a combination of `git fetch` and `git merge`. That is it updates the remote tracking branches (`git fetch`) AND updates your current branch with any new commits on the remote tracking branch (`git merge`). -This same concept appplies to work in a team setting. Multiple authors will have their own feature branches that merge into the same Upstream Main repository via Pull Requests. It is important for each author to do regular `git pulls` to stay up to date with each other's contributions. +This same concept applies to work in a team setting. Multiple authors will have their own feature branches that merge into the same Upstream Main repository via Pull Requests. It is important for each author to do regular `git pulls` to stay up to date with each other's contributions. ## Complete Workflow All in all your Git Branching workflow should resemble this flow: ![gitworkflow](../../images/gitworkflow.gif) -1. Forking the upstream repository -1. Creating a local clone of your upstream fork -1. Creating a new branch -1. Switching branches -1. Making a commit -1. Setting up a remote branch -1. Merging branches via a PR -1. Deleting branches -1. Pulling from upstream +1. Fork the upstream repository +1. Create a local clone of your upstream fork +1. Create and switch to a new branch in local copy +1. Make changes +1. Add and commit changes in branch +1. Push commits to fork (Set an upstream branch only for first push) +1. Repeat last three steps as necessary +1. Merge into upstream main branch via Pull Request +1. Delete branch from clone and fork +1. Pull upstream changes to main branch of fork and clone --- From 444fee971e6e22bcc5623e29672369511b6ac63a Mon Sep 17 00:00:00 2001 From: Chuck Daniels Date: Sun, 9 Jun 2024 11:10:23 -0400 Subject: [PATCH 2/2] Order code terms to match order of equation terms (#477) Reverse the order of the 2nd and 3rd terms in the code corresponding to the finite difference estimate of the 2nd derivative of a function to match the order of the terms in the equation. --- core/numpy/numpy-broadcasting.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/numpy/numpy-broadcasting.ipynb b/core/numpy/numpy-broadcasting.ipynb index ee6bee2ac..1a871acbd 100644 --- a/core/numpy/numpy-broadcasting.ipynb +++ b/core/numpy/numpy-broadcasting.ipynb @@ -587,7 +587,7 @@ "metadata": {}, "outputs": [], "source": [ - "2 * a[1:-1] - a[:-2] - a[2:]" + "2 * a[1:-1] - a[2:] - a[:-2]" ] }, {