Skip to content

Commit 6f984ae

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent dcb4633 commit 6f984ae

File tree

13 files changed

+263
-278
lines changed

13 files changed

+263
-278
lines changed

Untitled.ipynb

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,8 @@
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"import math\n",
24-
"import geopandas as gpd\n",
25-
"import numpy as np\n",
26-
"import pandas as pd\n",
27-
"import pystac_client\n",
28-
"import stackstac\n",
29-
"import torch\n",
30-
"import yaml\n",
31-
"from box import Box\n",
32-
"import matplotlib.pyplot as plt\n",
33-
"from rasterio.enums import Resampling\n",
34-
"from shapely import Point\n",
35-
"from sklearn import decomposition, svm\n",
36-
"#from torchvision.transformers import v2\n",
37-
"#from claymodule.module import ClayMAEModule"
23+
"# from torchvision.transformers import v2\n",
24+
"# from claymodule.module import ClayMAEModule"
3825
]
3926
},
4027
{
@@ -54,7 +41,7 @@
5441
"source": [
5542
"from torchvision import transforms\n",
5643
"\n",
57-
"print(hasattr(transforms, \"v2\"))\n"
44+
"print(hasattr(transforms, \"v2\"))"
5845
]
5946
},
6047
{
@@ -75,9 +62,7 @@
7562
]
7663
}
7764
],
78-
"source": [
79-
"from torchvision.transformers import v2"
80-
]
65+
"source": []
8166
},
8267
{
8368
"cell_type": "code",

Untitled1.ipynb

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"metadata": {},
88
"outputs": [],
99
"source": [
10-
"# Question 1 \n",
10+
"# Question 1\n",
1111
"\n",
1212
"pi = 3.14\n",
1313
"r = 5"
@@ -20,8 +20,7 @@
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"\n",
24-
"vol_sphere = 4/3*pi*r*r*r"
23+
"vol_sphere = 4 / 3 * pi * r * r * r"
2524
]
2625
},
2726
{
@@ -52,16 +51,15 @@
5251
"metadata": {},
5352
"outputs": [],
5453
"source": [
55-
"#Question 2\n",
54+
"# Question 2\n",
5655
"\n",
5756
"cover_price = 24.95\n",
5857
"discount = 0.4\n",
5958
"\n",
6059
"shipping_cost_first_copy = 3\n",
6160
"shipping_cost_next_copy = 0.75\n",
6261
"\n",
63-
"quantity = 60\n",
64-
"\n"
62+
"quantity = 60"
6563
]
6664
},
6765
{
@@ -135,7 +133,7 @@
135133
}
136134
],
137135
"source": [
138-
"#Question 3\n",
136+
"# Question 3\n",
139137
"# Start time\n",
140138
"start_hour = 6\n",
141139
"start_minute = 52\n",
@@ -144,14 +142,14 @@
144142
"start_seconds = (start_hour * 60 + start_minute) * 60\n",
145143
"\n",
146144
"# Pace times in seconds\n",
147-
"easy_pace_seconds = 8 * 60 + 15 # 1 mile at easy pace\n",
148-
"tempo_pace_seconds = 7 * 60 + 12 # per mile at tempo pace\n",
145+
"easy_pace_seconds = 8 * 60 + 15 # 1 mile at easy pace\n",
146+
"tempo_pace_seconds = 7 * 60 + 12 # per mile at tempo pace\n",
149147
"\n",
150148
"# Total run time in seconds\n",
151149
"total_run_seconds = (\n",
152-
" easy_pace_seconds + # first easy mile\n",
153-
" 3 * tempo_pace_seconds + # three tempo miles\n",
154-
" easy_pace_seconds # final easy mile\n",
150+
" easy_pace_seconds # first easy mile\n",
151+
" + 3 * tempo_pace_seconds # three tempo miles\n",
152+
" + easy_pace_seconds # final easy mile\n",
155153
")\n",
156154
"\n",
157155
"# End time in seconds\n",
@@ -163,7 +161,9 @@
163161
"end_second = end_seconds % 60\n",
164162
"\n",
165163
"# Display result\n",
166-
"print(f\"Home for breakfast at: {int(end_hour)}:{int(end_minute):02d}:{int(end_second):02d}\")\n"
164+
"print(\n",
165+
" f\"Home for breakfast at: {int(end_hour)}:{int(end_minute):02d}:{int(end_second):02d}\"\n",
166+
")"
167167
]
168168
},
169169
{
@@ -181,7 +181,7 @@
181181
}
182182
],
183183
"source": [
184-
"#Question 4\n",
184+
"# Question 4\n",
185185
"\n",
186186
"basic_salary = 5000\n",
187187
"\n",
@@ -191,7 +191,7 @@
191191
"\n",
192192
"gross_salary = basic_salary + dearness_allowance + hra\n",
193193
"\n",
194-
"print('Gross Salary of Ram: ',gross_salary)"
194+
"print(\"Gross Salary of Ram: \", gross_salary)"
195195
]
196196
},
197197
{
@@ -213,7 +213,7 @@
213213
}
214214
],
215215
"source": [
216-
"#Question 5\n",
216+
"# Question 5\n",
217217
"\n",
218218
"km = 100 # Example distance\n",
219219
"meters = km * 1000\n",
@@ -222,11 +222,11 @@
222222
"feet = inches / 12\n",
223223
"yards = feet / 3\n",
224224
"\n",
225-
"print(km, 'km in meters: ',meters)\n",
226-
"print(\"In centimeters:\",centimeters)\n",
227-
"print(\"In inches: \",inches)\n",
228-
"print(\"In feet: \",feet)\n",
229-
"print(\"In yards: \",yards)\n"
225+
"print(km, \"km in meters: \", meters)\n",
226+
"print(\"In centimeters:\", centimeters)\n",
227+
"print(\"In inches: \", inches)\n",
228+
"print(\"In feet: \", feet)\n",
229+
"print(\"In yards: \", yards)"
230230
]
231231
},
232232
{
@@ -244,11 +244,11 @@
244244
}
245245
],
246246
"source": [
247-
"#Question 6\n",
247+
"# Question 6\n",
248248
"\n",
249-
"fahrenheit = 98.6 \n",
249+
"fahrenheit = 98.6\n",
250250
"celsius = (fahrenheit - 32) * 5 / 9\n",
251-
"print(f\"Temperature: {fahrenheit}°F = {celsius:.2f}°C\")\n"
251+
"print(f\"Temperature: {fahrenheit}°F = {celsius:.2f}°C\")"
252252
]
253253
},
254254
{
@@ -258,10 +258,10 @@
258258
"metadata": {},
259259
"outputs": [],
260260
"source": [
261-
"#Question 7 \n",
261+
"# Question 7\n",
262262
"\n",
263263
"\n",
264-
"start_hour = 12 \n",
264+
"start_hour = 12\n",
265265
"start_min = 17\n",
266266
"\n",
267267
"time_in_min = start_hour * 60 + start_min\n",
@@ -330,7 +330,9 @@
330330
}
331331
],
332332
"source": [
333-
"print(f'If the event starts at {start_hour}:{start_min}, will end at {time_in_hours}:{time_in_mins}')"
333+
"print(\n",
334+
" f\"If the event starts at {start_hour}:{start_min}, will end at {time_in_hours}:{time_in_mins}\"\n",
335+
")"
334336
]
335337
},
336338
{

claymodel/callbacks_wandb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def on_validation_end(
265265
batch["pixels"][j + n_cols][0],
266266
cmap="viridis",
267267
)
268-
axs[2, j].set_title(f"Actual {j+n_cols}")
268+
axs[2, j].set_title(f"Actual {j + n_cols}")
269269
axs[2, j].axis("off")
270270

271271
# Plot predicted images in rows 1 and 3
@@ -274,7 +274,7 @@ def on_validation_end(
274274
axs[1, j].axis("off")
275275

276276
axs[3, j].imshow(pixels[j + n_cols][0], cmap="viridis")
277-
axs[3, j].set_title(f"Pred {j+n_cols}")
277+
axs[3, j].set_title(f"Pred {j + n_cols}")
278278
axs[3, j].axis("off")
279279

280280
self.logger.experiment.log({f"{platform}": wandb.Image(fig)})

claymodel/datamodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def setup(self, stage: Literal["fit", "predict"] | None = None) -> None:
258258
print(f"Total number of chips: {len(chips_path)}")
259259

260260
if stage == "fit":
261-
# Check how many unique platforms we have
261+
# Check how many unique platforms we have
262262
unique_platforms = set(chips_platform)
263263

264264
if len(unique_platforms) > 1:

claymodel/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ def posemb_sincos_2d_with_gsd(
3535

3636

3737
def posemb_sincos_1d(waves, dim, temperature: int = 10000, dtype=torch.float32):
38-
assert (
39-
dim % 2 == 0
40-
), "Feature dimension must be a multiple of 2 for sincos embedding"
38+
assert dim % 2 == 0, (
39+
"Feature dimension must be a multiple of 2 for sincos embedding"
40+
)
4141
waves = torch.arange(waves) if isinstance(waves, int) else waves
4242

4343
omega = torch.arange(dim // 2, device=waves.device) / (dim // 2 - 1)

docs/clay-v0/clay-v0-location-embeddings.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@
331331
"plt.scatter(latlon[:, 0], latlon[:, 1], c=latlon[:, 2], label=\"Actual\", alpha=0.3)\n",
332332
"\n",
333333
"for i in range(100):\n",
334-
" txt = f\"{latlon[:,0][i]:.2f},{latlon[:, 1][i]:.2f}\"\n",
334+
" txt = f\"{latlon[:, 0][i]:.2f},{latlon[:, 1][i]:.2f}\"\n",
335335
" plt.annotate(txt, (latlon[:, 0][i] + 1e-5, latlon[:, 1][i] + 1e-5))"
336336
]
337337
},

docs/references.bib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
% This file contains bibliography references for the Clay Foundation Model documentation
2-
% Currently empty but required by the Jupyter Book configuration
2+
% Currently empty but required by the Jupyter Book configuration

docs/tutorials/inference.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
"items = catalog.search(\n",
137137
" collections=[PLATFORM_NAME],\n",
138138
" bbox=[-122.6, 37.6, -122.35, 37.85],\n",
139-
" datetime=f\"{YEAR}-01-01T00:00:00Z/{YEAR+1}-01-01T00:00:00Z\",\n",
139+
" datetime=f\"{YEAR}-01-01T00:00:00Z/{YEAR + 1}-01-01T00:00:00Z\",\n",
140140
" max_items=100,\n",
141141
")\n",
142142
"\n",

0 commit comments

Comments
 (0)