Skip to content

Commit

Permalink
Merge pull request #144 from mwtoews/codespell
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
mnfienen authored Nov 1, 2024
2 parents a476e0d + 81df7f4 commit d8a6d36
Show file tree
Hide file tree
Showing 40 changed files with 132 additions and 132 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ into the project you can [fork this repository][2] and



[1]: https://github.com/DOI-USGS/python-for-hyrology/issues
[1]: https://github.com/DOI-USGS/python-for-hydrology/issues
[2]: https://help.github.com/articles/fork-a-repo/
[3]: https://help.github.com/articles/about-pull-requests/
2 changes: 1 addition & 1 deletion SOME_HELPFUL_LINKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* [Getting started with conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html)
* [General information on conda environments](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html)
* [Managing Conda Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
* [Tutorial introduction to conda enviroments](https://towardsdatascience.com/getting-started-with-python-environments-using-conda-32e9f2779307)
* [Tutorial introduction to conda environments](https://towardsdatascience.com/getting-started-with-python-environments-using-conda-32e9f2779307)
* [Conda-pack](https://conda.github.io/conda-pack/)

### cheat sheets
Expand Down
2 changes: 1 addition & 1 deletion docs/source/SOME_HELPFUL_LINKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* [Getting started with conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html)
* [General information on conda environments](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/environments.html)
* [Managing Conda Environments](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
* [Tutorial introduction to conda enviroments](https://towardsdatascience.com/getting-started-with-python-environments-using-conda-32e9f2779307)
* [Tutorial introduction to conda environments](https://towardsdatascience.com/getting-started-with-python-environments-using-conda-32e9f2779307)
* [Conda-pack](https://conda.github.io/conda-pack/)

### cheat sheets
Expand Down
4 changes: 2 additions & 2 deletions docs/source/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ into the project you can [fork this repository][2] and
[submit a pull request][3] for review.


[1]: https://github.com/DOI-USGS/python-for-hyrology/issues
[1]: https://github.com/DOI-USGS/python-for-hydrology/issues
[2]: https://help.github.com/articles/fork-a-repo/
[3]: https://help.github.com/articles/about-pull-requests/

Expand All @@ -39,7 +39,7 @@ Adding a Notebook

8) Testing

* The `.github/workflows/test.yaml` workflow will check for successfull notebook execution.
* The `.github/workflows/test.yaml` workflow will check for successful notebook execution.
* If your notebook has intentional errors, consider just showing the error in a markdown block (wrapped in python`````` so that the syntax gets highlighted).
* Otherwise, include the notebook in the `xfail_notebooks` list in `tests/test_notebooks.py`, so that the notebook gets marked as expected to fail (and doesn't fail the test workflow).

Expand Down
2 changes: 1 addition & 1 deletion installation/test_installation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pathlib as pl

print('This may take a few minutes....note that varius package versions will be printed')
print('This may take a few minutes....note that various package versions will be printed')


# numpy
Expand Down
4 changes: 2 additions & 2 deletions notebooks/part0_python_intro/00_python_basics_review.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
"\n",
"Variable names in Python can contain alphanumerical characters `a-z`, `A-Z`, `0-9` and some special characters such as `_`. Normal variable names must start with a letter. \n",
"\n",
"By convension, variable names start with a lower-case letter, and Class names start with a capital letter. \n",
"By convention, variable names start with a lower-case letter, and Class names start with a capital letter. \n",
"\n",
"In addition, there are a number of Python keywords that cannot be used as variable names. These keywords are:\n",
"\n",
Expand Down Expand Up @@ -488,7 +488,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This did exactly what it should, but looks strange at first. We `appended` on the data we wanted to, but since we passed a list, we just taked the list `[6,7,8]` on to the end of `a`. What if we wanted to continue our sequence? Then we could use `extend`."
"This did exactly what it should, but looks strange at first. We `appended` on the data we wanted to, but since we passed a list, we just took the list `[6,7,8]` on to the end of `a`. What if we wanted to continue our sequence? Then we could use `extend`."
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions notebooks/part0_python_intro/01_functions_scripts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables cannot be directly assigned a value within a function (unless named in a global statement), although they may be referenced. In plain english, that means the varaibles that are formed and used within a function can only be used within the function, unless they are ```return```-ed - they are sent back.\n"
"The execution of a function introduces a new symbol table used for the local variables of the function. More precisely, all variable assignments in a function store the value in the local symbol table; whereas variable references first look in the local symbol table, then in the local symbol tables of enclosing functions, then in the global symbol table, and finally in the table of built-in names. Thus, global variables cannot be directly assigned a value within a function (unless named in a global statement), although they may be referenced. In plain english, that means the variables that are formed and used within a function can only be used within the function, unless they are ```return```-ed - they are sent back.\n"
]
},
{
Expand Down Expand Up @@ -224,7 +224,7 @@
"\n",
"It is also possible to define functions with a variable number of arguments. In ```python```, there are three forms function arguments which can be combined. Each of these forms get used a lot.\n",
"\n",
"The most user-friendly form of a function argument is to specify an argument which has a default value. This creates a function that can be called with fewer arguments, but that also allows greater flexility in controlling the behaviro within the function itself. \n",
"The most user-friendly form of a function argument is to specify an argument which has a default value. This creates a function that can be called with fewer arguments, but that also allows greater flexility in controlling the behavior within the function itself. \n",
"\n",
"For example:"
]
Expand Down Expand Up @@ -450,7 +450,7 @@
"source": [
"# More on functions: ```lambda``` functions\n",
"\n",
"```lambda``` functions are a special type of function known as an \"in-line\" function. They are present in virtually all modern programming langauges (not Fortran, that's not modern) and are usually high-optimized. They allow you to quickly define a simple-ish function that can only accept a single, *required* argument. The only reason to introduce them is because they appear frequently when using a python library named ```pandas``` that we will cover later."
"```lambda``` functions are a special type of function known as an \"in-line\" function. They are present in virtually all modern programming languages (not Fortran, that's not modern) and are usually high-optimized. They allow you to quickly define a simple-ish function that can only accept a single, *required* argument. The only reason to introduce them is because they appear frequently when using a python library named ```pandas``` that we will cover later."
]
},
{
Expand Down Expand Up @@ -529,7 +529,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"*Rewrite the Thiem function from above as a* ```lambda``` *function that only accepts an argument for one variable (you chose) then \"sweep\" over that varaible with a* ```range``` *of values in loop*"
"*Rewrite the Thiem function from above as a* ```lambda``` *function that only accepts an argument for one variable (you chose) then \"sweep\" over that variable with a* ```range``` *of values in loop*"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"\n",
"There are a variety of ways to import existing code into a Python script or interactive session.\n",
"\n",
"There is alot of flexibility in how this is done, but a few suggested practices will be covered here."
"There is a lot of flexibility in how this is done, but a few suggested practices will be covered here."
]
},
{
Expand Down Expand Up @@ -519,7 +519,7 @@
"source": [
"Here, we've set up a class from which we can create instances later. Note that the syntax looks like a function. There are a couple strange things that deserve an explanation.\n",
"\n",
"* The argument `object` is optional and has to do with inheritence (which will only be briefly introduced in this class). \n",
"* The argument `object` is optional and has to do with inheritance (which will only be briefly introduced in this class). \n",
"* It is common to include at least one method\n",
"* `__init__` is a special operator that initializes the class. \n",
"* The first argument of `__init__` and really any method of a class is `self`.\n",
Expand Down Expand Up @@ -1190,15 +1190,15 @@
"source": [
"## Object-oriented programming (OOP)\n",
"\n",
"In the O'Reilly book _Learning Python, 5th Edition_ is a great discussion about Object-Oriented Programming. The author makes ths distinction that much of what we are doing with Python is _object-based_ but to truly be object-oriented, we need to also use something called inheritence."
"In the O'Reilly book _Learning Python, 5th Edition_ is a great discussion about Object-Oriented Programming. The author makes this distinction that much of what we are doing with Python is _object-based_ but to truly be object-oriented, we need to also use something called inheritance."
]
},
{
"cell_type": "markdown",
"id": "842f678c",
"metadata": {},
"source": [
"## Inheritence\n",
"## Inheritance\n",
"Let's revisit our class for rectangles without the overloading of `__add__`"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
"metadata": {},
"source": [
"Note that if you try to run the above cell twice, you'll get an error that the folder already exists\n",
"``exist_ok=True`` supresses these errors."
"``exist_ok=True`` suppresses these errors."
]
},
{
Expand Down Expand Up @@ -400,7 +400,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"**gottcha:** `Path.relative_to()` only works when the first path is a subpath of the second path, or if both paths are aboslute\n",
"**gottcha:** `Path.relative_to()` only works when the first path is a subpath of the second path, or if both paths are absolute\n",
"\n",
"For example, try executing this line: \n",
"\n",
Expand Down Expand Up @@ -1192,7 +1192,7 @@
"source": [
"## Bonus Application -- Using ``os`` to find the location of an executable\n",
"\n",
"There are often times that you run an executable that is nested somewhere deep within your system path. It can often be a good idea to know exactly where that executable is located. This might help you one day from accidently using an older version of an executable, such as MODFLOW."
"There are often times that you run an executable that is nested somewhere deep within your system path. It can often be a good idea to know exactly where that executable is located. This might help you one day from accidentally using an older version of an executable, such as MODFLOW."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions notebooks/part0_python_intro/04_files_and_strings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@
"\n",
"Construction of an f string is similar to the `str.format`, however we no longer need to add a `.format()` call to the end of the string. \n",
"\n",
"The call signiture for f-strings is:\n",
"The call signature for f-strings is:\n",
"\n",
"```python\n",
"f\"{some_variable}\"\n",
Expand Down Expand Up @@ -807,7 +807,7 @@
"\n",
"If the first character of `text` is a hash mark, the flow of execution goes to the top of the loop, ready to start processing the next line. If the `text` does not start with \"#\", the code falls through to do the processing at line 9, in this example, writing the line into the new file.\n",
"\n",
"Let’s consider one more case: suppose our original file contained empty lines. At the `if len(text) == 0` line, would this program do anything with the emtpy line? Yes! Recall that a blank line always includes the newline character in the string it returns. "
"Let’s consider one more case: suppose our original file contained empty lines. At the `if len(text) == 0` line, would this program do anything with the empty line? Yes! Recall that a blank line always includes the newline character in the string it returns. "
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions notebooks/part0_python_intro/05_numpy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@
"#print values from the beginning up to but not including the 10th value\n",
"print('a[:10]: ', a[:10])\n",
"\n",
"#or print the values from postion 20 to the end\n",
"#or print the values from position 20 to the end\n",
"print('a[90:]', a[20:])"
]
},
Expand Down Expand Up @@ -1488,7 +1488,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Masked arrays provide a convient away to explicitly handle nan values in the same object"
"### Masked arrays provide a convenient way to explicitly handle nan values in the same object"
]
},
{
Expand Down Expand Up @@ -1738,7 +1738,7 @@
"source": [
"## 1D Solute Transport\n",
"\n",
"A simple 1D transport analytical solution (Zheng and Bennet page 174; orignally from Ogata and Banks, 1961):\n",
"A simple 1D transport analytical solution (Zheng and Bennet page 174; originally from Ogata and Banks, 1961):\n",
"\n",
"$\\frac{C}{C_0} = \\frac{1}{2} \\left [ erfc \\left ( \\frac{x - v t}{\\sqrt{4Dt}} \\right ) + exp \\left ( \\frac{xv}{D} \\right ) erfc \\left ( \\frac{x + v t}{\\sqrt{4Dt}} \\right ) \\right ]$\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions notebooks/part0_python_intro/06_matplotlib.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
"```\n",
"\n",
"\n",
"The method described above follows the MATLAB API. It is somewhat prone to errors and unflexible if curves are added to or removed from the figure (resulting in a wrongly labelled curve).\n",
"The method described above follows the MATLAB API. It is somewhat prone to errors and inflexible if curves are added to or removed from the figure (resulting in a wrongly labelled curve).\n",
"\n",
"A better method is to use the `label=\"label text\"` keyword argument when plots or other objects are added to the figure, and then using the `legend` method without arguments to add the legend to the figure: "
]
Expand All @@ -252,7 +252,7 @@
"source": [
"The advantage with this method is that if curves are added or removed from the figure, the legend is automatically updated accordingly.\n",
"\n",
"The `legend` function takes an optional keywork argument `loc` that can be used to specify where in the figure the legend is to be drawn. The allowed values of `loc` are numerical codes for the various places the legend can be drawn. See http://`matplotlib`.org/users/legend_guide.html#legend-location for details. Some of the most common `loc` values are:\n",
"The `legend` function takes an optional keyword argument `loc` that can be used to specify where in the figure the legend is to be drawn. The allowed values of `loc` are numerical codes for the various places the legend can be drawn. See http://`matplotlib`.org/users/legend_guide.html#legend-location for details. Some of the most common `loc` values are:\n",
"\n",
"```python\n",
"ax.legend(loc=0) # let `matplotlib` decide the optimal location\n",
Expand Down Expand Up @@ -578,7 +578,7 @@
"source": [
"## Formatting text: $\\LaTeX$, fontsize, font family\n",
"\n",
"The figure above is functional, but it does not (yet) satisfy the criteria for a figure used in a publication. First and foremost, it may be neccesary to use $\\LaTeX$ formatted text, and second, it may be necessary to adjust the font size to appear right in a publication.\n",
"The figure above is functional, but it does not (yet) satisfy the criteria for a figure used in a publication. First and foremost, it may be necessary to use $\\LaTeX$ formatted text, and second, it may be necessary to adjust the font size to appear right in a publication.\n",
"\n",
"`matplotlib` has great support for $\\LaTeX$. All that is required to incorporate $\\LaTeX$ text is to encapsulate any text (legend, title, label, etc.) in dollar signs. For example, `'$y=x^3$'`.\n",
"\n",
Expand Down Expand Up @@ -641,7 +641,7 @@
"source": [
"### Logarithmic scale\n",
"\n",
"It is also possible to set a logarithmic scale for one or both axes. This functionality is in fact only one application of a more general transformation system in `matplotlib`. Each of the axes' scales are set seperately using `set_xscale` and `set_yscale` methods which accept one parameter (with the value \"log\" in this case):"
"It is also possible to set a logarithmic scale for one or both axes. This functionality is in fact only one application of a more general transformation system in `matplotlib`. Each of the axes' scales are set separately using `set_xscale` and `set_yscale` methods which accept one parameter (with the value \"log\" in this case):"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/part0_python_intro/07a_Theis-exercise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"metadata": {},
"source": [
"### Step 6: Add additional wells\n",
"With $s$ returned as an array for a given set of x, y locations, we can now use *superposition* (adding drawdowns together) to evalute the effects of multiple pumping wells. Try calling the function from Step 4) again with a well at 500, 500. The $s$ output can be added to the results from Step 5) to get a composite map of drawdown with the two wells pumping."
"With $s$ returned as an array for a given set of x, y locations, we can now use *superposition* (adding drawdowns together) to evaluate the effects of multiple pumping wells. Try calling the function from Step 4) again with a well at 500, 500. The $s$ output can be added to the results from Step 5) to get a composite map of drawdown with the two wells pumping."
]
},
{
Expand Down
Loading

0 comments on commit d8a6d36

Please sign in to comment.