Skip to content

Commit

Permalink
update black components
Browse files Browse the repository at this point in the history
updating nbqa-black and black-jupyter means that a new black style is propagated that removes spaces around the "**" operator
psf/black#2726
  • Loading branch information
Daniel Sparing committed Feb 24, 2022
1 parent a123059 commit 55a9276
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -24,7 +24,7 @@ repos:
- id: trailing-whitespace
- id: mixed-line-ending
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.2.2
rev: 1.2.3
hooks:
- id: nbqa-black
args: [-l80]
Expand All @@ -38,7 +38,7 @@ repos:
- id: isort
args: ["--profile", "black", "-l80"]
- repo: https://github.com/psf/black
rev: 21.12b0
rev: 22.1.0
hooks:
- id: black
args: [-l 80]
Expand Down
Expand Up @@ -148,7 +148,7 @@ def transform(inputs, numeric_cols, nbuckets):
)
ploc = fc.crossed_column([b_plat, b_plon], nbuckets * nbuckets)
dloc = fc.crossed_column([b_dlat, b_dlon], nbuckets * nbuckets)
pd_pair = fc.crossed_column([ploc, dloc], nbuckets ** 4)
pd_pair = fc.crossed_column([ploc, dloc], nbuckets**4)
feature_columns["pickup_and_dropoff"] = fc.embedding_column(pd_pair, 100)

return transformed, feature_columns
Expand Down
Expand Up @@ -148,7 +148,7 @@ def transform(inputs, numeric_cols, nbuckets):
)
ploc = fc.crossed_column([b_plat, b_plon], nbuckets * nbuckets)
dloc = fc.crossed_column([b_dlat, b_dlon], nbuckets * nbuckets)
pd_pair = fc.crossed_column([ploc, dloc], nbuckets ** 4)
pd_pair = fc.crossed_column([ploc, dloc], nbuckets**4)
feature_columns["pickup_and_dropoff"] = fc.embedding_column(pd_pair, 100)

return transformed, feature_columns
Expand Down
Expand Up @@ -508,7 +508,7 @@
" # create crossed columns\n",
" ploc = fc.crossed_column([b_plat, b_plon], nbuckets * nbuckets)\n",
" dloc = fc.crossed_column([b_dlat, b_dlon], nbuckets * nbuckets)\n",
" pd_pair = fc.crossed_column([ploc, dloc], nbuckets ** 4)\n",
" pd_pair = fc.crossed_column([ploc, dloc], nbuckets**4)\n",
"\n",
" # create embedding columns\n",
" feature_columns[\"pickup_and_dropoff\"] = fc.embedding_column(pd_pair, 100)\n",
Expand Down
Expand Up @@ -629,7 +629,7 @@
"outputs": [],
"source": [
"X = tf.constant(np.linspace(0, 2, 1000), dtype=tf.float32)\n",
"Y = X * tf.exp(-(X ** 2))"
"Y = X * tf.exp(-(X**2))"
]
},
{
Expand Down
Expand Up @@ -625,7 +625,7 @@
"outputs": [],
"source": [
"X = tf.constant(np.linspace(0, 2, 1000), dtype=tf.float32)\n",
"Y = X * tf.exp(-(X ** 2))"
"Y = X * tf.exp(-(X**2))"
]
},
{
Expand Down
Expand Up @@ -577,7 +577,7 @@
"outputs": [],
"source": [
"X = tf.constant(np.linspace(0, 2, 1000), dtype=tf.float32)\n",
"Y = X * tf.exp(-(X ** 2))"
"Y = X * tf.exp(-(X**2))"
]
},
{
Expand Down
Expand Up @@ -180,7 +180,7 @@
" hash_bucket_size=NBUCKETS * NBUCKETS,\n",
")\n",
"fc_crossed_pd_pair = fc.crossed_column(\n",
" [fc_crossed_dloc, fc_crossed_ploc], hash_bucket_size=NBUCKETS ** 4\n",
" [fc_crossed_dloc, fc_crossed_ploc], hash_bucket_size=NBUCKETS**4\n",
")\n",
"\n",
"# 3. Create embedding columns for the crossed columns\n",
Expand Down
Expand Up @@ -286,7 +286,7 @@
},
"source": [
"def f(x, y):\n",
" return 2 * x * y ** 2\n",
" return 2 * x * y**2\n",
"\n",
"\n",
"# YOUR ACTION REQUIRED:\n",
Expand Down Expand Up @@ -423,11 +423,11 @@
"\n",
"@jax.jit\n",
"def f1_jit(x):\n",
" return x ** 0.5\n",
" return x**0.5\n",
"\n",
"\n",
"def f2(x):\n",
" return x ** 0.5\n",
" return x**0.5\n",
"\n",
"\n",
"# It's really the same.\n",
Expand Down Expand Up @@ -788,7 +788,7 @@
" for value in value_flat:\n",
" if isinstance(value, jnp.ndarray):\n",
" value = value.sum()\n",
" tot += value ** 2\n",
" tot += value**2\n",
" return tot\n",
"\n",
"\n",
Expand Down
8 changes: 4 additions & 4 deletions notebooks/jax/solutions/jax_fundamentals.ipynb
Expand Up @@ -603,7 +603,7 @@
],
"source": [
"def f(x, y):\n",
" return 2 * x * y ** 2\n",
" return 2 * x * y**2\n",
"\n",
"\n",
"# YOUR ACTION REQUIRED:\n",
Expand Down Expand Up @@ -862,11 +862,11 @@
"\n",
"@jax.jit\n",
"def f1_jit(x):\n",
" return x ** 0.5\n",
" return x**0.5\n",
"\n",
"\n",
"def f2(x):\n",
" return x ** 0.5\n",
" return x**0.5\n",
"\n",
"\n",
"# It's really the same.\n",
Expand Down Expand Up @@ -1612,7 +1612,7 @@
" for value in value_flat:\n",
" if isinstance(value, jnp.ndarray):\n",
" value = value.sum()\n",
" tot += value ** 2\n",
" tot += value**2\n",
" return tot\n",
"\n",
"\n",
Expand Down
Expand Up @@ -1267,7 +1267,7 @@
" plots.\n",
" \"\"\"\n",
" # fn plot args\n",
" x = tf.linspace(start_val, end_val, m_steps ** 2 + 1)\n",
" x = tf.linspace(start_val, end_val, m_steps**2 + 1)\n",
" y = fn(x)\n",
"\n",
" fig = plt.figure(figsize=(16, 4))\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/supplemental/labs/autoencoder.ipynb
Expand Up @@ -609,7 +609,7 @@
" filenames = sorted(filenames)\n",
" last = -1\n",
" for i, filename in enumerate(filenames):\n",
" frame = 2 * (i ** 0.5)\n",
" frame = 2 * (i**0.5)\n",
" if round(frame) > round(last):\n",
" last = frame\n",
" else:\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/supplemental/labs/deepconv_gan.ipynb
Expand Up @@ -828,7 +828,7 @@
" filenames = sorted(filenames)\n",
" last = -1\n",
" for i, filename in enumerate(filenames):\n",
" frame = 2 * (i ** 0.5)\n",
" frame = 2 * (i**0.5)\n",
" if round(frame) > round(last):\n",
" last = frame\n",
" else:\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/supplemental/solutions/autoencoder.ipynb
Expand Up @@ -653,7 +653,7 @@
" filenames = sorted(filenames)\n",
" last = -1\n",
" for i, filename in enumerate(filenames):\n",
" frame = 2 * (i ** 0.5)\n",
" frame = 2 * (i**0.5)\n",
" if round(frame) > round(last):\n",
" last = frame\n",
" else:\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/supplemental/solutions/deepconv_gan.ipynb
Expand Up @@ -888,7 +888,7 @@
" filenames = sorted(filenames)\n",
" last = -1\n",
" for i, filename in enumerate(filenames):\n",
" frame = 2 * (i ** 0.5)\n",
" frame = 2 * (i**0.5)\n",
" if round(frame) > round(last):\n",
" last = frame\n",
" else:\n",
Expand Down

0 comments on commit 55a9276

Please sign in to comment.