Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Python/Module3_IntroducingNumpy/AdvancedIndexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ Use boolean array-indexing and NumPy's [logical functions](https://docs.scipy.or
<!-- #endregion -->

<!-- #region -->
#### Converting a Boolean Index-Array to Integer index-arrays: numpy.where
### Converting a Boolean Index-Array to Integer index-arrays: numpy.where
The function [numpy.where](https://docs.scipy.org/doc/numpy/reference/generated/numpy.where.html) can be used to take a boolean-valued array, and produce the *tuple* of index-arrays that access the `True` entries of that array, via integer array indexing (discussed at the beginning of this section).

```python
Expand Down
6 changes: 5 additions & 1 deletion Python/Module5_OddsAndEnds/WorkingWithFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jupyter:

<!-- #raw raw_mimetype="text/restructuredtext" -->
.. meta::
:description: Topic: Working with aths and files, Difficulty: Medium, Category: Section
:description: Topic: Working with paths and files, Difficulty: Medium, Category: Section
:keywords: open file, read file, pathlib, join directory, context manager, close file, rb, binary file, utf-8, encoding, pickle, numpy, load, archive, npy, npz, pkl, glob, read lines, write, save
<!-- #endraw -->

Expand Down Expand Up @@ -283,6 +283,8 @@ data/*.txt

The `pathlib` module provides convenient functionality for globbing files. Once we have a `Path` object, we can simply call `glob()` on it and pass in a glob string. This will return a [generator](http://www.pythonlikeyoumeanit.com/Module2_EssentialsOfPython/Generators_and_Comprehensions.html#Introducing-Generators) that will yield each of the globbed files.

<!-- #region -->

``` python
# glob all of the text files in the present directory
# that start with 'test' and end with '.txt'
Expand All @@ -303,6 +305,8 @@ The `pathlib` module provides convenient functionality for globbing files. Once
... pass
```

<!-- #endregion -->

For more details on globbing, see [the documentation](https://docs.python.org/3/library/pathlib.html#pathlib.Path.glob).

<div class="alert alert-info">
Expand Down
7 changes: 7 additions & 0 deletions Python/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ in reverse chronological order. All previous releases should still be available
on pip.


----------
2020-04-11
----------

Updated some of the "backend" technologies behind PLYMI: upgraded sphinx and nbsphinx.


----------
2020-04-02
----------
Expand Down
88 changes: 45 additions & 43 deletions Python/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,46 +31,46 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.intersphinx',
'nbsphinx',
'sphinx.ext.todo',
'sphinx.ext.mathjax',
'sphinx.ext.githubpages']

import jupytext
extensions = [
"sphinx.ext.intersphinx",
"nbsphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.githubpages",
]

nbsphinx_custom_formats = {
'.md': lambda s: jupytext.reads(s, '.md'),
'.md': ['jupytext.reads', {'fmt': 'md'}],
}

nbsphinx_allow_errors = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'Python Like You Mean It'
copyright = '2019, Ryan Soklaski'
author = 'Ryan Soklaski'
html_title = 'Python Like You Mean It'
project = "Python Like You Mean It"
copyright = "2019, Ryan Soklaski"
author = "Ryan Soklaski"
html_title = "Python Like You Mean It"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.4'
version = "1.4"
# The full version, including alpha/beta/rc tags.
release = '1.4.1'
release = "1.4.1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -82,10 +82,10 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '**.ipynb_checkpoints']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "**.ipynb_checkpoints"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'default'
pygments_style = "default"

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
Expand All @@ -98,10 +98,13 @@
#
html_theme = "sphinx_rtd_theme"


def setup(app):
app.add_stylesheet('my_theme.css')
app.add_javascript("https://www.googletagmanager.com/gtag/js?id=UA-115029372-1")
app.add_javascript("gtag.js")
app.add_css_file("my_theme.css")
app.add_js_file("https://www.googletagmanager.com/gtag/js?id=UA-115029372-1")
app.add_js_file("gtag.js")


# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
Expand All @@ -111,28 +114,28 @@ def setup(app):
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
"**": [
"about.html",
"navigation.html",
"relations.html", # needs 'show_related': True theme option to display
"searchbox.html",
"donate.html",
]
}


# -- Options for HTMLHelp output ------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'BPLYMI'
htmlhelp_basename = "BPLYMI"


# -- Options for LaTeX output ---------------------------------------------
Expand All @@ -141,15 +144,12 @@ def setup(app):
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -159,8 +159,7 @@ def setup(app):
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'BPLYMI.tex', 'BPython Like You Mean It',
'Ryan Soklaski', 'manual'),
(master_doc, "BPLYMI.tex", "BPython Like You Mean It", "Ryan Soklaski", "manual")
]


Expand All @@ -169,8 +168,7 @@ def setup(app):
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'bfundamentalsofpython', 'BPython Like You Mean It',
[author], 1)
(master_doc, "bfundamentalsofpython", "BPython Like You Mean It", [author], 1)
]


Expand All @@ -180,13 +178,17 @@ def setup(app):
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'BPLYMI', 'BPython Like You Mean It',
author, 'BPLYMI', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"BPLYMI",
"BPython Like You Mean It",
author,
"BPLYMI",
"One line description of project.",
"Miscellaneous",
)
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}
Loading