Skip to content

Commit 9edfb48

Browse files
authored
Merge pull request #387 from Labelbox/develop
3.11.1
2 parents 2259e01 + 4c53c9c commit 9edfb48

File tree

22 files changed

+754
-273
lines changed

22 files changed

+754
-273
lines changed

.github/teams.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
active-learning:
2+
- '@cssetian'
3+
- '@gszpak'
4+
- '@msokoloff1'
5+
- '@tomislav-peharda'
6+
- '@jtsodapop'
7+
- '@kozikkamil'
8+
- '@dubininsergey'
9+
- '@farkob'
10+
- '@attila-papai'
11+
- '@Juanbuhler'
12+
- '@sqlboy'
13+
- '@nmaswood'
14+
- '@gdj0nes'

.github/workflows/team-labeler.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
on: pull_request
2+
name: team-label
3+
jobs:
4+
team-labeler:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: JulienKode/[email protected]
8+
with:
9+
repo-token: '${{ secrets.GITHUB_TOKEN }}'

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Changelog
2+
# Version 3.11.1 (2022-01-10)
3+
## Fix
4+
* Make `TypedArray` class compatible with `numpy` versions `>= 1.22.0`
5+
* `project.upsert_review_queue` quotas can now be in the inclusive range [0,1]
6+
* Restore support for upserting html instructions to a project
27

38
# Version 3.11.0 (2021-12-15)
49

examples/basics/user_management.ipynb

Lines changed: 88 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
" * set and update organization roles\n",
1313
" * assign users to projects\n",
1414
" * set / update / revoke project role\n",
15-
" * delete users from org\n",
16-
"* User invite functions are currently experimental. This means that their interfaces could change."
15+
" * delete users from org"
1716
]
1817
},
1918
{
@@ -22,23 +21,45 @@
2221
"id": "limiting-terry",
2322
"metadata": {},
2423
"outputs": [],
25-
"source": "!pip install labelbox"
24+
"source": [
25+
"!pip install labelbox"
26+
]
2627
},
2728
{
2829
"cell_type": "code",
2930
"execution_count": 2,
3031
"id": "hungarian-recipient",
3132
"metadata": {},
3233
"outputs": [],
33-
"source": "from labelbox import Project, Dataset, Client, User\nfrom labelbox.schema.organization import ProjectRole\nfrom getpass import getpass\nimport os"
34+
"source": [
35+
"from labelbox import Project, Dataset, Client, User\n",
36+
"from labelbox.schema.organization import ProjectRole\n",
37+
"from getpass import getpass\n",
38+
"import os"
39+
]
3440
},
3541
{
3642
"cell_type": "code",
3743
"execution_count": 3,
3844
"id": "intended-course",
3945
"metadata": {},
4046
"outputs": [],
41-
"source": "# If you don't want to give google access to drive you can skip this cell\n# and manually set `API_KEY` below.\n\nCOLAB = \"google.colab\" in str(get_ipython())\nif COLAB:\n !pip install colab-env -qU\n from colab_env import envvar_handler\n envvar_handler.envload()\n\nAPI_KEY = os.environ.get(\"LABELBOX_API_KEY\")\nif not os.environ.get(\"LABELBOX_API_KEY\"):\n API_KEY = getpass(\"Please enter your labelbox api key\")\n if COLAB:\n envvar_handler.add_env(\"LABELBOX_API_KEY\", API_KEY)"
47+
"source": [
48+
"# If you don't want to give google access to drive you can skip this cell\n",
49+
"# and manually set `API_KEY` below.\n",
50+
"\n",
51+
"COLAB = \"google.colab\" in str(get_ipython())\n",
52+
"if COLAB:\n",
53+
" !pip install colab-env -qU\n",
54+
" from colab_env import envvar_handler\n",
55+
" envvar_handler.envload()\n",
56+
"\n",
57+
"API_KEY = os.environ.get(\"LABELBOX_API_KEY\")\n",
58+
"if not os.environ.get(\"LABELBOX_API_KEY\"):\n",
59+
" API_KEY = getpass(\"Please enter your labelbox api key\")\n",
60+
" if COLAB:\n",
61+
" envvar_handler.add_env(\"LABELBOX_API_KEY\", API_KEY)"
62+
]
4263
},
4364
{
4465
"cell_type": "markdown",
@@ -56,15 +77,26 @@
5677
"id": "polished-hampshire",
5778
"metadata": {},
5879
"outputs": [],
59-
"source": "ENDPOINT = \"https://api.labelbox.com/graphql\"\nclient = Client(api_key=API_KEY, endpoint=ENDPOINT, enable_experimental=True)\norganization = client.get_organization()"
80+
"source": [
81+
"ENDPOINT = \"https://api.labelbox.com/graphql\"\n",
82+
"client = Client(api_key=API_KEY, endpoint=ENDPOINT, enable_experimental=True)\n",
83+
"organization = client.get_organization()"
84+
]
6085
},
6186
{
6287
"cell_type": "code",
6388
"execution_count": 5,
6489
"id": "outer-cattle",
6590
"metadata": {},
6691
"outputs": [],
67-
"source": "# Please provide a dummy email here:\n# Preferrably one you can access. If you have a google account you can do email+1@<domain>.com\nDUMMY_EMAIL = \"< SET THIS >\"\n# This should be set to an account that you wan't to change the permissions for.\n# You could invite a new user, accept the invite and use that account if you don't want to effect any active users\nDUMMY_USER_ACCOUNT_ID = \"ckneh4n8c9qvq0706uwwg5i16\""
92+
"source": [
93+
"# Please provide a dummy email here:\n",
94+
"# Preferrably one you can access. If you have a google account you can do email+1@<domain>.com\n",
95+
"DUMMY_EMAIL = \"< SET THIS >\"\n",
96+
"# This should be set to an account that you wan't to change the permissions for.\n",
97+
"# You could invite a new user, accept the invite and use that account if you don't want to effect any active users\n",
98+
"DUMMY_USER_ACCOUNT_ID = \"ckneh4n8c9qvq0706uwwg5i16\""
99+
]
68100
},
69101
{
70102
"cell_type": "markdown",
@@ -94,7 +126,11 @@
94126
]
95127
}
96128
],
97-
"source": "roles = client.get_roles()\nfor name, role in roles.items():\n print(role.name, \":\", role.uid)"
129+
"source": [
130+
"roles = client.get_roles()\n",
131+
"for name, role in roles.items():\n",
132+
" print(role.name, \":\", role.uid)"
133+
]
98134
},
99135
{
100136
"cell_type": "markdown",
@@ -141,15 +177,20 @@
141177
"output_type": "execute_result"
142178
}
143179
],
144-
"source": "# First make sure that you have enough seats:\norganization.invite_limit()"
180+
"source": [
181+
"# First make sure that you have enough seats:\n",
182+
"organization.invite_limit()"
183+
]
145184
},
146185
{
147186
"cell_type": "code",
148187
"execution_count": 8,
149188
"id": "ready-housing",
150189
"metadata": {},
151190
"outputs": [],
152-
"source": "invite = organization.invite_user(DUMMY_EMAIL, roles[\"LABELER\"])"
191+
"source": [
192+
"invite = organization.invite_user(DUMMY_EMAIL, roles[\"LABELER\"])"
193+
]
153194
},
154195
{
155196
"cell_type": "code",
@@ -167,7 +208,11 @@
167208
]
168209
}
169210
],
170-
"source": "print(invite.created_at)\nprint(invite.organization_role_name)\nprint(invite.email)"
211+
"source": [
212+
"print(invite.created_at)\n",
213+
"print(invite.organization_role_name)\n",
214+
"print(invite.email)"
215+
]
171216
},
172217
{
173218
"cell_type": "markdown",
@@ -185,7 +230,13 @@
185230
"id": "nervous-firmware",
186231
"metadata": {},
187232
"outputs": [],
188-
"source": "project = client.create_project(name=\"test_user_management\")\nproject_role = ProjectRole(project=project, role=roles[\"REVIEWER\"])\ninvite = organization.invite_user(DUMMY_EMAIL,\n roles[\"NONE\"],\n project_roles=[project_role])"
233+
"source": [
234+
"project = client.create_project(name=\"test_user_management\")\n",
235+
"project_role = ProjectRole(project=project, role=roles[\"REVIEWER\"])\n",
236+
"invite = organization.invite_user(DUMMY_EMAIL,\n",
237+
" roles[\"NONE\"],\n",
238+
" project_roles=[project_role])"
239+
]
189240
},
190241
{
191242
"cell_type": "markdown",
@@ -211,7 +262,10 @@
211262
]
212263
}
213264
],
214-
"source": "users = list(organization.users())\nprint(users[0])"
265+
"source": [
266+
"users = list(organization.users())\n",
267+
"print(users[0])"
268+
]
215269
},
216270
{
217271
"cell_type": "markdown",
@@ -239,15 +293,30 @@
239293
]
240294
}
241295
],
242-
"source": "user = client._get_single(User, DUMMY_USER_ACCOUNT_ID)\n\n# Give the user organization level permissions\nuser.update_org_role(roles[\"LABELER\"])\nprint(user.org_role())\n# Restore project level permissions\nuser.update_org_role(roles[\"NONE\"])\nprint(user.org_role())\n# Make the user a labeler for the current project\nuser.upsert_project_role(project, roles[\"LABELER\"])\nprint(user.org_role())"
296+
"source": [
297+
"user = client._get_single(User, DUMMY_USER_ACCOUNT_ID)\n",
298+
"\n",
299+
"# Give the user organization level permissions\n",
300+
"user.update_org_role(roles[\"LABELER\"])\n",
301+
"print(user.org_role())\n",
302+
"# Restore project level permissions\n",
303+
"user.update_org_role(roles[\"NONE\"])\n",
304+
"print(user.org_role())\n",
305+
"# Make the user a labeler for the current project\n",
306+
"user.upsert_project_role(project, roles[\"LABELER\"])\n",
307+
"print(user.org_role())"
308+
]
243309
},
244310
{
245311
"cell_type": "code",
246312
"execution_count": 13,
247313
"id": "liquid-beast",
248314
"metadata": {},
249315
"outputs": [],
250-
"source": "# Remove the user from a project (Same as setting the project role to `roles.NONE`)\nuser.remove_from_project(project)"
316+
"source": [
317+
"# Remove the user from a project (Same as setting the project role to `roles.NONE`)\n",
318+
"user.remove_from_project(project)"
319+
]
251320
},
252321
{
253322
"cell_type": "markdown",
@@ -291,7 +360,9 @@
291360
"id": "veterinary-repository",
292361
"metadata": {},
293362
"outputs": [],
294-
"source": "project.delete()"
363+
"source": [
364+
"project.delete()"
365+
]
295366
}
296367
],
297368
"metadata": {
@@ -315,4 +386,4 @@
315386
},
316387
"nbformat": 4,
317388
"nbformat_minor": 5
318-
}
389+
}

0 commit comments

Comments
 (0)