Skip to content

Commit 9022985

Browse files
authored
Add black-jupyter and nbstripout to pre-commit (#1915)
1 parent 13f9ca9 commit 9022985

File tree

384 files changed

+133903
-125154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+133903
-125154
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ repos:
1414
- repo: https://github.com/psf/black
1515
rev: 24.2.0
1616
hooks:
17-
- id: black
17+
- id: black-jupyter
18+
language_version: python3.11
1819

1920
- repo: https://github.com/codespell-project/codespell
2021
rev: v2.2.6
2122
hooks:
2223
- id: codespell
2324
args: [--toml, pyproject-codespell.precommit-toml]
25+
26+
- repo: https://github.com/kynan/nbstripout
27+
rev: 0.7.1
28+
hooks:
29+
- id: nbstripout

docs/notebooks/00_ee_auth_colab.ipynb

Lines changed: 85 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,87 @@
11
{
2-
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"source": [
6-
"<a href=\"https://colab.research.google.com/github/gee-community/geemap/blob/master/examples/notebooks/00_ee_auth_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>\n",
7-
"\n",
8-
"\n",
9-
"## Earth Engine Automatic Authentication on Google Colab\n",
10-
"\n",
11-
"### Step 1: Locating the Earth Engine Token\n",
12-
"\n",
13-
"1. Locate the Earth Engine token on your computer by navigating to the following file path based on your operating system:\n",
14-
"\n",
15-
" - Windows: C:\\\\Users\\\\USERNAME\\\\.config\\\\earthengine\\\\credentials\n",
16-
" - Linux: /home/USERNAME/.config/earthengine/credentials\n",
17-
" - MacOS: /Users/USERNAME/.config/earthengine/credentials\n",
18-
"\n",
19-
"2. Open the credentials file and copy the entire content to the clipboard.\n",
20-
"\n",
21-
" **Note:** Ensure that you do not share the content of the credentials file with others to prevent unauthorized access to your Earth Engine account.\n",
22-
"\n",
23-
"### Step 2: Creating the Secret in Google Colab\n",
24-
"\n",
25-
"1. Open your Google Colab notebook and click on the `secrets` tab.\n",
26-
"2. Create a new secret with the name `EARTHENGINE_TOKEN`.\n",
27-
"3. Paste the content from the clipboard into the `Value` input box of the created secret.\n",
28-
"4. Toggle the button on the left to allow notebook access to the secret.\n",
29-
"\n",
30-
"![](https://i.imgur.com/Z9R08uU.png)\n",
31-
"\n",
32-
"### Step 3: Installing the Required Version of geemap\n",
33-
"\n",
34-
"Ensure that you have installed geemap version 0.29.3 or later, as only these versions support the automatic authentication feature."
35-
],
36-
"metadata": {
37-
}
38-
},
39-
{
40-
"cell_type": "code",
41-
"source": [
42-
"%pip install -U geemap"
43-
],
44-
"metadata": {
45-
},
46-
"execution_count": null,
47-
"outputs": []
48-
},
49-
{
50-
"cell_type": "markdown",
51-
"source": [
52-
"### Step 4: Automatic Authentication with geemap\n",
53-
"\n",
54-
"To automatically authenticate Earth Engine using the EARTHENGINE_TOKEN in your Google Colab notebook, run the following code:"
55-
],
56-
"metadata": {
57-
}
58-
},
59-
{
60-
"cell_type": "code",
61-
"source": [
62-
"import geemap"
63-
],
64-
"metadata": {
65-
},
66-
"execution_count": null,
67-
"outputs": []
68-
},
69-
{
70-
"cell_type": "code",
71-
"source": [
72-
"m = geemap.Map()\n",
73-
"m"
74-
],
75-
"metadata": {
76-
},
77-
"execution_count": null,
78-
"outputs": []
79-
}
80-
],
81-
"metadata": {
82-
"colab": {
83-
"provenance": []
84-
},
85-
"kernelspec": {
86-
"display_name": "Python 3",
87-
"name": "python3"
88-
}
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"<a href=\"https://colab.research.google.com/github/gee-community/geemap/blob/master/examples/notebooks/00_ee_auth_colab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open in Colab\"/></a>\n",
8+
"\n",
9+
"\n",
10+
"## Earth Engine Automatic Authentication on Google Colab\n",
11+
"\n",
12+
"### Step 1: Locating the Earth Engine Token\n",
13+
"\n",
14+
"1. Locate the Earth Engine token on your computer by navigating to the following file path based on your operating system:\n",
15+
"\n",
16+
" - Windows: C:\\\\Users\\\\USERNAME\\\\.config\\\\earthengine\\\\credentials\n",
17+
" - Linux: /home/USERNAME/.config/earthengine/credentials\n",
18+
" - MacOS: /Users/USERNAME/.config/earthengine/credentials\n",
19+
"\n",
20+
"2. Open the credentials file and copy the entire content to the clipboard.\n",
21+
"\n",
22+
" **Note:** Ensure that you do not share the content of the credentials file with others to prevent unauthorized access to your Earth Engine account.\n",
23+
"\n",
24+
"### Step 2: Creating the Secret in Google Colab\n",
25+
"\n",
26+
"1. Open your Google Colab notebook and click on the `secrets` tab.\n",
27+
"2. Create a new secret with the name `EARTHENGINE_TOKEN`.\n",
28+
"3. Paste the content from the clipboard into the `Value` input box of the created secret.\n",
29+
"4. Toggle the button on the left to allow notebook access to the secret.\n",
30+
"\n",
31+
"![](https://i.imgur.com/Z9R08uU.png)\n",
32+
"\n",
33+
"### Step 3: Installing the Required Version of geemap\n",
34+
"\n",
35+
"Ensure that you have installed geemap version 0.29.3 or later, as only these versions support the automatic authentication feature."
36+
]
8937
},
90-
"nbformat": 4,
91-
"nbformat_minor": 0
92-
}
38+
{
39+
"cell_type": "code",
40+
"execution_count": null,
41+
"metadata": {},
42+
"outputs": [],
43+
"source": [
44+
"%pip install -U geemap"
45+
]
46+
},
47+
{
48+
"cell_type": "markdown",
49+
"metadata": {},
50+
"source": [
51+
"### Step 4: Automatic Authentication with geemap\n",
52+
"\n",
53+
"To automatically authenticate Earth Engine using the EARTHENGINE_TOKEN in your Google Colab notebook, run the following code:"
54+
]
55+
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": null,
59+
"metadata": {},
60+
"outputs": [],
61+
"source": [
62+
"import geemap"
63+
]
64+
},
65+
{
66+
"cell_type": "code",
67+
"execution_count": null,
68+
"metadata": {},
69+
"outputs": [],
70+
"source": [
71+
"m = geemap.Map()\n",
72+
"m"
73+
]
74+
}
75+
],
76+
"metadata": {
77+
"colab": {
78+
"provenance": []
79+
},
80+
"kernelspec": {
81+
"display_name": "Python 3",
82+
"name": "python3"
83+
}
84+
},
85+
"nbformat": 4,
86+
"nbformat_minor": 0
87+
}

0 commit comments

Comments
 (0)