Skip to content

Commit bd77780

Browse files
[pre-commit.ci 🤖] Apply code format tools to PR
1 parent 927e14f commit bd77780

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

‎.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
6+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
77
hooks:
88
- id: check-added-large-files
99
- id: check-ast
@@ -19,30 +19,30 @@ repos:
1919
- id: trailing-whitespace
2020

2121
- repo: https://github.com/pre-commit/mirrors-prettier
22-
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
22+
rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8
2323
hooks:
2424
- id: prettier
2525
files: \.(css|md|yml|yaml)
2626
args: [--prose-wrap=preserve]
2727

2828
- repo: https://github.com/psf/black
29-
rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0
29+
rev: 8a737e727ac5ab2f1d4cf5876720ed276dc8dc4b # frozen: 25.1.0
3030
hooks:
3131
- id: black
3232

3333
- repo: https://github.com/asottile/blacken-docs
34-
rev: 78a9dcbecf4f755f65d1f3dec556bc249d723600 # frozen: 1.19.1
34+
rev: 78a9dcbecf4f755f65d1f3dec556bc249d723600 # frozen: 1.19.1
3535
hooks:
3636
- id: blacken-docs
3737

3838
- repo: https://github.com/asottile/pyupgrade
39-
rev: ce40a160603ab0e7d9c627ae33d7ef3906e2d2b2 # frozen: v3.19.1
39+
rev: ce40a160603ab0e7d9c627ae33d7ef3906e2d2b2 # frozen: v3.19.1
4040
hooks:
4141
- id: pyupgrade
4242
args: [--py38-plus]
4343

4444
- repo: https://github.com/codespell-project/codespell
45-
rev: "63c8f8312b7559622c0d82815639671ae42132ac" # frozen: v2.4.1
45+
rev: "63c8f8312b7559622c0d82815639671ae42132ac" # frozen: v2.4.1
4646
hooks:
4747
- id: codespell
4848
args: ["-w", "-L", "ist,cant,connexion,multline,checkin"]

‎content/posts/matplotlib/animated-polar-plot/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ ndf.head()
6767
This produces:
6868

6969
```pycon
70-
date tsurf t1000
71-
0 2009-12-31 0.0 0.0
72-
1 2010-01-07 0.0 0.0
73-
2 2010-01-14 0.0 0.0
74-
3 2010-01-21 0.0 0.0
75-
4 2010-01-28 0.0 0.0
70+
date tsurf t1000
71+
2-31 0.0 0.0
72+
1-07 0.0 0.0
73+
1-14 0.0 0.0
74+
1-21 0.0 0.0
75+
1-28 0.0 0.0
7676
```
7777

7878
Then it's time to plot, for that we first need to import what we need, and set some useful variables.

‎content/posts/networkx/aTSP/finding-all-minimum-arborescences/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Now that we are familiar with the minimum arborescence algorithm, we can discuss
110110
The changes will be primarily located in step 1.
111111
Under the normal operation of the algorithm, the consideration which happens at each vertex might look like this.
112112

113-
<center><img src="edmonds-normal.png" alt="Edmonds algrithm selecting edge without restrictions"/></center>
113+
<center><img src="edmonds-normal.png" alt="Edmonds algorithm selecting edge without restrictions"/></center>
114114

115115
Where the bolded arrow is chosen by the algorithm as it is the incoming arc with minimum weight.
116116
Now, if we were required to include a different edge, say the weight 6 arc, we would want this behavior even though it is strictly speaking not optimal.

‎content/posts/networkx/aTSP/implementing-the-iterators/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ $$
153153
$$
154154

155155
possible combinations of edges which could be arborescences.
156-
That's a lot of combintation, more than I wanted to check by hand so I wrote a short python script.
156+
That's a lot of combination, more than I wanted to check by hand so I wrote a short python script.
157157

158158
```python
159159
from itertools import combinations

‎content/posts/numpy/numpy-rng/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ I hope this blog post helped you understand the best ways to use NumPy RNGs. The
135135
- To know more about the default RNG used in NumPy, named PCG, I recommend the [PCG paper](https://www.pcg-random.org/paper.html) which also contains lots of useful information about RNGs in general. The [pcg-random.org website](https://www.pcg-random.org) is also full of interesting information about RNGs.
136136

137137
[^1]: If you only need a seed for reproducibility and do not need independence with respect to others, say for a unit test, a small seed is perfectly fine.
138+
138139
[^2]: A good RNG is expected to produce independent numbers for a given seed. However, the independence of sequences generated from two different seeds is not always guaranteed. For instance, it is possible that the sequence started with the second seed might quickly converge to an internal state also obtained by the first seed. This can result in both RNGs producing the same subsequent numbers, which would compromise the randomness expected from distinct seeds.
140+
139141
[^3]:
140142
Before knowing about `default_rng`, and before NumPy 1.17, I was using the scikit-learn function [`check_random_state`](https://scikit-learn.org/stable/modules/generated/sklearn.utils.check_random_state.html) which is of course heavily used in the scikit-learn codebase. While writing this post I discovered that this function is now available in [scipy](https://github.com/scipy/scipy/blob/62d2af2e13280d29781585aa39a3c5a5dfdfba17/scipy/_lib/_util.py#L231). A look at the docstring and/or the source code of this function will give you a good idea about what it does. The differences with `default_rng` are that `check_random_state` currently relies on `np.random.RandomState` and that when `None` is passed to `check_random_state` then the function returns the already existing global NumPy RNG. The latter can be convenient because if you fix the seed of the global RNG before in your script using `np.random.seed`, `check_random_state` returns the generator that you seeded. However, as explained above, this is not the recommended practice and you should be aware of the risks and the side effects.
141143
[^4]: Before 1.25 you need to get the `SeedSequence` from the RNG using the `_seed_seq` private attribute of the underlying bit generator: `rng.bit_generator._seed_seq`. You can then spawn from this `SeedSequence` to get child seeds that will result in independent RNGs.

0 commit comments

Comments
 (0)