Skip to content

Commit 8780c3a

Browse files
committed
Merge branch 'main' of github.com:ClimateImpactLab/pyCIAM into feature/update-for-ice-sheet
2 parents f965ba7 + a150234 commit 8780c3a

File tree

14 files changed

+540
-410
lines changed

14 files changed

+540
-410
lines changed

.github/workflows/python-publish.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ jobs:
1414
deploy:
1515

1616
runs-on: ubuntu-latest
17-
17+
permissions:
18+
id-token: write
1819
steps:
19-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2021
- name: Set up Python
21-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2223
with:
2324
python-version: '3.x'
2425
- name: Install dependencies
@@ -30,5 +31,3 @@ jobs:
3031
- name: Publish distribution 📦 to PyPI
3132
if: startsWith(github.ref, 'refs/tags')
3233
uses: pypa/gh-action-pypi-publish@release/v1
33-
with:
34-
password: ${{ secrets.PYPI_API_TOKEN }}

HISTORY.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
History
22
=======
33

4-
v1.1.3 (unreleased)
5-
-------------------
4+
unreleased
5+
----------
6+
* Update GitHub actions versions
7+
8+
v1.2.0
9+
------
610
* Point `data-acquisition.ipynb` to updated Zenodo deposit that fixes the dtype of `subsets` variable in `diaz2016_inputs_raw.zarr.zip` to be bool rather than int8
711
* Variable name bugfix in `data-acquisition.ipynb`
12+
* Add netcdf versions of SLIIDERS and the pyCIAM results to `upload-zenodo.ipynb`
13+
* Update results in Zenodo record to use SLIIDERS v1.2
814

915
v1.1.2
1016
------

notebooks/models/create-surge-lookup-tables.ipynb

Lines changed: 64 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,23 @@
3030
{
3131
"cell_type": "code",
3232
"execution_count": 1,
33+
"id": "6b183aa3-366a-4f5f-bb95-5ef4bf48d438",
34+
"metadata": {
35+
"tags": []
36+
},
37+
"outputs": [],
38+
"source": [
39+
"%load_ext autoreload\n",
40+
"%autoreload 2"
41+
]
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": 2,
3346
"id": "cd4b2928-65a0-4733-9c71-fbefa85590be",
34-
"metadata": {},
47+
"metadata": {
48+
"tags": []
49+
},
3550
"outputs": [],
3651
"source": [
3752
"import sys\n",
@@ -41,16 +56,26 @@
4156
},
4257
{
4358
"cell_type": "code",
44-
"execution_count": 2,
59+
"execution_count": 3,
4560
"id": "afd03880-8e46-4d81-867d-bfb6505ea788",
46-
"metadata": {},
61+
"metadata": {
62+
"tags": []
63+
},
4764
"outputs": [
4865
{
4966
"name": "stderr",
5067
"output_type": "stream",
5168
"text": [
52-
"/srv/conda/envs/notebook/lib/python3.9/site-packages/dask_gateway/client.py:21: FutureWarning: format_bytes is deprecated and will be removed in a future release. Please use dask.utils.format_bytes instead.\n",
53-
" from distributed.utils import LoopRunner, format_bytes\n"
69+
"/srv/conda/envs/notebook/lib/python3.10/site-packages/google/cloud/storage/transfer_manager.py:30: UserWarning: The module `transfer_manager` is a preview feature. Functionality and API may change. This warning will be removed in a future release.\n",
70+
" warnings.warn(\n",
71+
"/home/jovyan/git-repos/pyCIAM-public/notebooks/models/../shared.py:3: UserWarning: Shapely 2.0 is installed, but because PyGEOS is also installed, GeoPandas will still use PyGEOS by default for now. To force to use and test Shapely 2.0, you have to set the environment variable USE_PYGEOS=0. You can do this before starting the Python process, or in your code before importing geopandas:\n",
72+
"\n",
73+
"import os\n",
74+
"os.environ['USE_PYGEOS'] = '0'\n",
75+
"import geopandas\n",
76+
"\n",
77+
"In a future release, GeoPandas will switch to using Shapely by default. If you are using PyGEOS directly (calling PyGEOS functions on geometries from GeoPandas), this will then stop working and you are encouraged to migrate from PyGEOS to Shapely 2.0 (https://shapely.readthedocs.io/en/latest/migration_pygeos.html).\n",
78+
" import geopandas as gpd\n"
5479
]
5580
}
5681
],
@@ -75,7 +100,7 @@
75100
},
76101
{
77102
"cell_type": "code",
78-
"execution_count": 3,
103+
"execution_count": 4,
79104
"id": "47979c48-7fff-49b4-b445-ea6bf746fa37",
80105
"metadata": {
81106
"tags": [
@@ -86,18 +111,20 @@
86111
"source": [
87112
"# When running on larger/scalable dask cluster, may wish to specify number of workers\n",
88113
"# Default is LocalCluster which will use the number of CPUs available on local machine\n",
89-
"# N_WORKERS_MIN = 7\n",
90-
"# N_WORKERS_MAX = 700\n",
114+
"N_WORKERS_MIN = 7\n",
115+
"N_WORKERS_MAX = 700\n",
91116
"SEG_CHUNKSIZE = 5\n",
92117
"\n",
93118
"PARAMS = pd.read_json(PATH_PARAMS)[\"values\"]"
94119
]
95120
},
96121
{
97122
"cell_type": "code",
98-
"execution_count": 4,
123+
"execution_count": 5,
99124
"id": "6104bced",
100-
"metadata": {},
125+
"metadata": {
126+
"tags": []
127+
},
101128
"outputs": [],
102129
"source": [
103130
"DMF_I = getattr(damage_funcs, PARAMS.dmf + \"_i\")\n",
@@ -106,70 +133,31 @@
106133
},
107134
{
108135
"cell_type": "code",
109-
"execution_count": 5,
136+
"execution_count": 6,
110137
"id": "dbb04b4a-14b8-4403-ad33-88bfe71bd8fc",
111-
"metadata": {},
138+
"metadata": {
139+
"tags": []
140+
},
112141
"outputs": [
113142
{
114143
"data": {
115-
"text/html": [
116-
"<div>\n",
117-
" <div style=\"width: 24px; height: 24px; background-color: #e1e1e1; border: 3px solid #9D9D9D; border-radius: 5px; position: absolute;\"> </div>\n",
118-
" <div style=\"margin-left: 48px;\">\n",
119-
" <h3 style=\"margin-bottom: 0px;\">Client</h3>\n",
120-
" <p style=\"color: #9D9D9D; margin-bottom: 0px;\">Client-f992a2c6-c6d1-11ed-862e-665816eadc72</p>\n",
121-
" <table style=\"width: 100%; text-align: left;\">\n",
122-
"\n",
123-
" <tr>\n",
124-
" \n",
125-
" <td style=\"text-align: left;\"><strong>Connection method:</strong> Cluster object</td>\n",
126-
" <td style=\"text-align: left;\"><strong>Cluster type:</strong> dask_gateway.GatewayCluster</td>\n",
127-
" \n",
128-
" </tr>\n",
129-
"\n",
130-
" \n",
131-
" <tr>\n",
132-
" <td style=\"text-align: left;\">\n",
133-
" <strong>Dashboard: </strong> <a href=\"/services/dask-gateway/clusters/daskhub-dev.e0f56d1ca0ae4a42b9352ad6b7204454/status\" target=\"_blank\">/services/dask-gateway/clusters/daskhub-dev.e0f56d1ca0ae4a42b9352ad6b7204454/status</a>\n",
134-
" </td>\n",
135-
" <td style=\"text-align: left;\"></td>\n",
136-
" </tr>\n",
137-
" \n",
138-
"\n",
139-
" </table>\n",
140-
"\n",
141-
" \n",
142-
" <details>\n",
143-
" <summary style=\"margin-bottom: 20px;\"><h3 style=\"display: inline;\">Cluster Info</h3></summary>\n",
144-
" <div style='background-color: #f2f2f2; display: inline-block; padding: 10px; border: 1px solid #999999;'>\n",
145-
" <h3>GatewayCluster</h3>\n",
146-
" <ul>\n",
147-
" <li><b>Name: </b>daskhub-dev.e0f56d1ca0ae4a42b9352ad6b7204454\n",
148-
" <li><b>Dashboard: </b><a href='/services/dask-gateway/clusters/daskhub-dev.e0f56d1ca0ae4a42b9352ad6b7204454/status' target='_blank'>/services/dask-gateway/clusters/daskhub-dev.e0f56d1ca0ae4a42b9352ad6b7204454/status</a>\n",
149-
" </ul>\n",
150-
"</div>\n",
151-
"\n",
152-
" </details>\n",
153-
" \n",
154-
"\n",
155-
" </div>\n",
156-
"</div>"
157-
],
144+
"application/vnd.jupyter.widget-view+json": {
145+
"model_id": "fcadb94377b4430d9c2964ac9c808c2a",
146+
"version_major": 2,
147+
"version_minor": 0
148+
},
158149
"text/plain": [
159-
"<Client: 'tls://10.4.102.2:8786' processes=0 threads=0, memory=0 B>"
150+
"VBox(children=(HTML(value='<h2>GatewayCluster</h2>'), HBox(children=(HTML(value='\\n<div>\\n<style scoped>\\n …"
160151
]
161152
},
162-
"execution_count": 5,
163153
"metadata": {},
164-
"output_type": "execute_result"
154+
"output_type": "display_data"
165155
}
166156
],
167157
"source": [
168-
"client = start_dask_cluster(\n",
169-
" # n_workers_min=N_WORKERS_MIN,\n",
170-
" # n_workers_max=N_WORKERS_MAX,\n",
171-
")\n",
172-
"client"
158+
"client, cluster = start_dask_cluster()\n",
159+
"cluster.adapt(minimum=N_WORKERS_MIN, maximum=N_WORKERS_MAX)\n",
160+
"cluster"
173161
]
174162
},
175163
{
@@ -182,7 +170,7 @@
182170
},
183171
{
184172
"cell_type": "code",
185-
"execution_count": 8,
173+
"execution_count": 7,
186174
"id": "1e823775-0d12-4e52-93d1-7e3586913e65",
187175
"metadata": {
188176
"tags": []
@@ -205,7 +193,7 @@
205193
" start_year=PARAMS.model_start,\n",
206194
" slr_0_years=PARAMS.slr_0_year,\n",
207195
" client=client,\n",
208-
" # client_kwargs={\"batch_size\": N_WORKERS_MAX},\n",
196+
" client_kwargs={\"batch_size\": N_WORKERS_MAX},\n",
209197
" force_overwrite=True,\n",
210198
" seg_chunksize=SEG_CHUNKSIZE,\n",
211199
" mc_dim=\"quantile\",\n",
@@ -223,9 +211,11 @@
223211
},
224212
{
225213
"cell_type": "code",
226-
"execution_count": 9,
214+
"execution_count": 11,
227215
"id": "f941a509-7035-4105-8b79-88a97e759737",
228-
"metadata": {},
216+
"metadata": {
217+
"tags": []
218+
},
229219
"outputs": [],
230220
"source": [
231221
"# ensure completion and close cluster\n",
@@ -237,23 +227,25 @@
237227
},
238228
{
239229
"cell_type": "code",
240-
"execution_count": 10,
230+
"execution_count": 12,
241231
"id": "15563792-1ba0-435a-9981-e2b15eaa8dcd",
242-
"metadata": {},
232+
"metadata": {
233+
"tags": []
234+
},
243235
"outputs": [
244236
{
245237
"data": {
246238
"text/plain": [
247239
"(None, None)"
248240
]
249241
},
250-
"execution_count": 10,
242+
"execution_count": 12,
251243
"metadata": {},
252244
"output_type": "execute_result"
253245
}
254246
],
255247
"source": [
256-
"client.cluster.close(), client.close()"
248+
"cluster.close(), client.close()"
257249
]
258250
}
259251
],
@@ -273,7 +265,7 @@
273265
"name": "python",
274266
"nbconvert_exporter": "python",
275267
"pygments_lexer": "ipython3",
276-
"version": "3.9.10"
268+
"version": "3.10.10"
277269
},
278270
"widgets": {
279271
"application/vnd.jupyter.widget-state+json": {

0 commit comments

Comments
 (0)