Skip to content

Commit 25512e7

Browse files
committed
Website build
1 parent 6338662 commit 25512e7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

0_preface.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ <h2>Changes in the second and third editions<a class="headerlink" href="#changes
236236
workspaces in <a class="reference internal" href="2_programs_in_files.html#workspaces"><span class="std std-numref">Section 2.2.1</span></a>, and the Flake8 extension in
237237
<a class="reference internal" href="4_style.html#flake8-extension"><span class="std std-numref">Section 4.2.2</span></a>. Together, these provide correctly integrated code
238238
linting. It also consistently uses <code class="xref py py-obj docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span></code> to invoke tools such as <code class="xref py py-obj docutils literal notranslate"><span class="pre">pip</span></code>,
239-
<a class="reference external" href="https://docs.pytest.org/en/latest/index.html#module-pytest" title="(in pytest v8.4.0.dev128)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pytest</span></code></a> and <code class="xref py py-obj docutils literal notranslate"><span class="pre">flake8</span></code>. This is less error-prone for students. The description
239+
<a class="reference external" href="https://docs.pytest.org/en/latest/index.html#module-pytest" title="(in pytest v8.4.0.dev200)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pytest</span></code></a> and <code class="xref py py-obj docutils literal notranslate"><span class="pre">flake8</span></code>. This is less error-prone for students. The description
240240
of <a class="reference external" href="https://docs.python.org/3/reference/compound_stmts.html#finally" title="(in Python v3.13)"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">finally</span></code></a> in <a class="reference internal" href="6_exceptions.html#else-finally"><span class="std std-numref">Section 6.5.2</span></a> has been also improved.</p>
241241
</section>
242242
</section>

2_programs_in_files.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ <h2><span class="section-number">2.5. </span>Testing frameworks<a class="headerl
716716
including tests in your code here.</p>
717717
<p>There are a number of Python packages which support code testing. The concepts
718718
are largely similar so rather than get bogged down in the details of multiple
719-
frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v8.4.0.dev128)"><span class="xref std std-doc">Pytest</span></a>, which is one of the
719+
frameworks, we will introduce <a class="reference external" href="https://docs.pytest.org/en/latest/index.html" title="(in pytest v8.4.0.dev200)"><span class="xref std std-doc">Pytest</span></a>, which is one of the
720720
most widely used. Pytest is simply a Python package, so you can install it into
721721
your current environment using:</p>
722722
<div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp gp-VirtualEnv">(PoP_venv)</span> <span class="gp">$ </span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pytest

7_inheritance.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,11 @@ <h3><span class="section-number">7.1.2. </span>General linear groups<a class="he
334334
<span class="linenos"> 5</span>
335335
<span class="linenos"> 6</span> <span class="k">def</span> <span class="nf">_validate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
336336
<span class="linenos"> 7</span><span class="w"> </span><span class="sd">&quot;&quot;&quot;Ensure that value is an allowed element value in this group.&quot;&quot;&quot;</span>
337-
<span class="linenos"> 8</span> <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="nb">isinstance</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">),</span>
338-
<span class="linenos"> 9</span> <span class="n">value</span><span class="o">.</span><span class="n">shape</span> <span class="o">==</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">degree</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">degree</span><span class="p">)):</span>
337+
<span class="linenos"> 8</span> <span class="n">value</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">value</span><span class="p">)</span>
338+
<span class="linenos"> 9</span> <span class="k">if</span> <span class="ow">not</span> <span class="p">(</span><span class="n">value</span><span class="o">.</span><span class="n">shape</span> <span class="o">==</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">n</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">n</span><span class="p">)):</span>
339339
<span class="linenos">10</span> <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Element value must be a &quot;</span>
340-
<span class="linenos">11</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">degree</span><span class="si">}</span><span class="s2"> x </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">degree</span><span class="si">}</span><span class="s2">&quot;</span>
341-
<span class="linenos">12</span> <span class="s2">&quot;square array.&quot;</span><span class="p">)</span>
340+
<span class="linenos">11</span> <span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">n</span><span class="si">}</span><span class="s2"> x </span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">n</span><span class="si">}</span><span class="s2">&quot;</span>
341+
<span class="linenos">12</span> <span class="s2">&quot;square array.&quot;</span><span class="p">)</span>
342342
<span class="linenos">13</span>
343343
<span class="linenos">14</span> <span class="k">def</span> <span class="nf">operation</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">):</span>
344344
<span class="linenos">15</span><span class="w"> </span><span class="sd">&quot;&quot;&quot;Perform the group operation on two values.</span>

_sources/7_inheritance.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ follows:
329329
330330
def _validate(self, value):
331331
"""Ensure that value is an allowed element value in this group."""
332-
if not (isinstance(value, np.ndarray),
333-
value.shape == (self.degree, self.degree)):
332+
value = np.asarray(value)
333+
if not (value.shape == (self.n, self.n)):
334334
raise ValueError("Element value must be a "
335-
f"{self.degree} x {self.degree}"
336-
"square array.")
335+
f"{self.n} x {self.n}"
336+
"square array.")
337337
338338
def operation(self, a, b):
339339
"""Perform the group operation on two values.

0 commit comments

Comments
 (0)