From d10ea7fea82f3bde6540a363730b4cf45f8bf6ab Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Mon, 5 Aug 2024 11:31:08 +0530 Subject: [PATCH 1/4] initial fixture creationo --- notebooks/Fixtures/Fixtures.ipynb | 5450 +++++++++++++++++++++++++++++ 1 file changed, 5450 insertions(+) create mode 100644 notebooks/Fixtures/Fixtures.ipynb diff --git a/notebooks/Fixtures/Fixtures.ipynb b/notebooks/Fixtures/Fixtures.ipynb new file mode 100644 index 00000000000..d0eab1b803a --- /dev/null +++ b/notebooks/Fixtures/Fixtures.ipynb @@ -0,0 +1,5450 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "9ea56106-f616-47cf-8dd3-cbd2d774e624", + "metadata": {}, + "outputs": [], + "source": [ + "# What are main resources that need fixtures ?\n", + "# Launch Server - Datasite and Gateway\n", + "# Datasets\n", + "# Users - DO, DS, Admin\n", + "# UserCodes\n", + "# Create Jobs\n", + "# Clean Stores" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "89d7cbfc", + "metadata": {}, + "outputs": [], + "source": [ + "from enum import Enum\n", + "from syft.types.base import SyftBaseModel\n", + "from syft.abstract_server import ServerType\n", + "from syft.orchestra import ServerHandle\n", + "from syft.service.user.user_roles import ServiceRole\n", + "from syft.client.client import SyftClient\n", + "from syft.service.user.user import UserView\n", + "import syft as sy" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "b47e9080", + "metadata": {}, + "outputs": [], + "source": [ + "class DatasetType(Enum):\n", + " IMAGE = \"image\"\n", + " TABULAR = \"tabular\"\n", + "\n", + "\n", + "class UserConfig(SyftBaseModel):\n", + " role: ServiceRole\n", + " num: int = 1\n", + "\n", + "\n", + "class DatasetConfig(SyftBaseModel):\n", + " num: int = 1\n", + " type: DatasetType\n" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "99180601-4dd4-4d70-bc71-02af57edc04e", + "metadata": {}, + "outputs": [], + "source": [ + "class ServerConfig(SyftBaseModel):\n", + " server: ServerHandle\n", + " root_email: str = \"info@openmined.org\"\n", + " root_password: str = \"changethis\"\n", + "\n", + " @property\n", + " def root_client(self) -> SyftClient:\n", + " if not hasattr(self, \"_root_client\"):\n", + " self._root_client = self.server.login(email=self.root_email, password=self.root_password)\n", + " return self._root_client\n", + "\n", + "\n", + "class UserCodeConfig(SyftBaseModel):\n", + " num: int = 1\n", + "\n", + "\n", + "class FixtureConfig(SyftBaseModel):\n", + " server: ServerConfig\n", + " user: list[UserConfig]\n", + " dataset: list[DatasetConfig]\n", + " user_code: UserCodeConfig" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "59231950", + "metadata": {}, + "outputs": [], + "source": [ + "from faker import Faker\n", + "\n", + "class SyftFixture:\n", + " def __init__(self, config: dict) -> None:\n", + " self.config = FixtureConfig(**config)\n", + " self.root_client = self.config.server.root_client\n", + " self.faker = Faker()\n", + "\n", + " def add_users(self):\n", + " for user_config in self.config.user:\n", + " for _ in range(user_config.num):\n", + " password = self.faker.password()\n", + " user = self.root_client.api.services.user.create(\n", + " name=self.faker.name(),\n", + " email=self.faker.email(),\n", + " password=password,\n", + " password_verify=password,\n", + " institution=self.faker.company(),\n", + " website=self.faker.url(),\n", + " role=user_config.role\n", + " )\n", + " assert isinstance(user, UserView)\n", + "\n", + " def get_sample_tabular_data(self, split_ratio: float = 0.8):\n", + " tabular_data_url = \"https://github.com/OpenMined/datasets/blob/main/trade_flow/ca%20-%20feb%202021.csv?raw=True\"\n", + " tabular_data = pd.read_csv(tabular_data_url)\n", + " columns = tabular_data.shape[0]\n", + " private_index = int(split_ratio * columns)\n", + " private_data = tabular_data[:private_index]\n", + " mock_data = tabular_data[private_index:]\n", + " return private_data, mock_data\n", + "\n", + "\n", + " def get_sample_data(self, type: DatasetType) -> tuple:\n", + " if type == DatasetType.TABULAR:\n", + " return self.get_sample_tabular_data()\n", + " else:\n", + " raise NotImplementedError\n", + "\n", + " def add_datasets(self):\n", + " for dataset in range(self.config.dataset):\n", + " \n", + " private_data, mock_data = get_sample_data(dataset.type)\n", + " asset = sy.Asset(\n", + " name=self.faker.name(),\n", + " description=self.faker.text(),\n", + " data=private_data,\n", + " mock=mock_data,\n", + " )\n", + "\n", + " dataset = sy.Dataset(\n", + " name=self.faker.name(),\n", + " description=self.faker.text(),\n", + " url=self.faker.url(),\n", + " asset_list=[asset],\n", + " )\n", + " \n", + " res = self.root_client.upload_dataset(dataset)\n", + " assert not isinstance(dataset, sy.SyftError)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "d9954230-4b19-4c1c-8b35-488757d86741", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Starting test-domain server on 0.0.0.0:8081\n", + " Done.\n" + ] + }, + { + "data": { + "text/html": [ + "
SyftInfo:
You have launched a development server at http://0.0.0.0:8081.It is intended only for local use.

" + ], + "text/plain": [ + "SyftInfo: You have launched a development server at http://0.0.0.0:8081.It is intended only for local use." + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "server = sy.orchestra.launch(\"test-domain\", dev_mode=False, reset=True, port=8081)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "312d5348-f6d6-4ac3-8509-e75e04d651c6", + "metadata": {}, + "outputs": [], + "source": [ + "config = {\n", + " \"server\": {\"server\": server},\n", + " \"user\": [{\"role\": ServiceRole.DATA_OWNER, \"num\": 1}, {\"role\": ServiceRole.DATA_SCIENTIST, \"num\": 1}],\n", + " \"dataset\": [{\"type\": DatasetType.TABULAR, \"num\": 1}],\n", + " \"user_code\": {\"num\": 0},\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "780f9d26-380c-490f-af24-aef9f594ded7", + "metadata": {}, + "outputs": [], + "source": [ + "# server.login(email=config.server.root_email, password=config.server.root_password)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "b629f2bd-27f2-44ea-b4d3-f92592ece28c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Logged into as \n" + ] + }, + { + "data": { + "text/html": [ + "
SyftWarning:
You are using a default password. Please change the password using `[your_client].account.set_password([new_password])`.

" + ], + "text/plain": [ + "SyftWarning: You are using a default password. Please change the password using `[your_client].account.set_password([new_password])`." + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "fixture = SyftFixture(config)" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "645fe575-ed07-4c7c-9e75-6dc015ab0ec7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "
\n", + "
\n", + " \n", + "
\n", + "

UserView List

\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "

Total: 0

\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "fixture.root_client.users" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "f4801a44-5663-414a-92a5-8c1335181980", + "metadata": {}, + "outputs": [], + "source": [ + "fixture.add_users()" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "id": "e3edf94f-a7f8-4ec5-8e2d-da04e2300e26", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "
\n", + "
\n", + " \n", + "
\n", + "

UserView List

\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "

Total: 0

\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 38, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "fixture.root_client.api.services.user" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "93aabf06-85d0-4727-86e5-be06a8172078", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2962c18b-b8cb-4a72-b3de-e48c6461c83e", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.5" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From 88209c8268e37d8b834810ebe9f2906717fd2b30 Mon Sep 17 00:00:00 2001 From: Shubham Gupta Date: Tue, 13 Aug 2024 14:34:58 +0530 Subject: [PATCH 2/4] fix bugs - add info to show details of events added --- notebooks/Fixtures/Fixtures.ipynb | 329 ++++++++++++++++++++---------- 1 file changed, 218 insertions(+), 111 deletions(-) diff --git a/notebooks/Fixtures/Fixtures.ipynb b/notebooks/Fixtures/Fixtures.ipynb index d0eab1b803a..8e77ccf95e8 100644 --- a/notebooks/Fixtures/Fixtures.ipynb +++ b/notebooks/Fixtures/Fixtures.ipynb @@ -23,14 +23,21 @@ "metadata": {}, "outputs": [], "source": [ + "# stdlib\n", "from enum import Enum\n", - "from syft.types.base import SyftBaseModel\n", - "from syft.abstract_server import ServerType\n", - "from syft.orchestra import ServerHandle\n", - "from syft.service.user.user_roles import ServiceRole\n", + "\n", + "# third party\n", + "from faker import Faker\n", + "import pandas as pd\n", + "\n", + "# syft absolute\n", + "import syft as sy\n", + "from syft import autocache\n", "from syft.client.client import SyftClient\n", + "from syft.orchestra import ServerHandle\n", "from syft.service.user.user import UserView\n", - "import syft as sy" + "from syft.service.user.user_roles import ServiceRole\n", + "from syft.types.base import SyftBaseModel" ] }, { @@ -48,20 +55,15 @@ "class UserConfig(SyftBaseModel):\n", " role: ServiceRole\n", " num: int = 1\n", + " created: int = 0\n", "\n", "\n", "class DatasetConfig(SyftBaseModel):\n", " num: int = 1\n", - " type: DatasetType\n" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "99180601-4dd4-4d70-bc71-02af57edc04e", - "metadata": {}, - "outputs": [], - "source": [ + " type: DatasetType\n", + " created: int = 0\n", + "\n", + "\n", "class ServerConfig(SyftBaseModel):\n", " server: ServerHandle\n", " root_email: str = \"info@openmined.org\"\n", @@ -70,12 +72,15 @@ " @property\n", " def root_client(self) -> SyftClient:\n", " if not hasattr(self, \"_root_client\"):\n", - " self._root_client = self.server.login(email=self.root_email, password=self.root_password)\n", + " self._root_client = self.server.login(\n", + " email=self.root_email, password=self.root_password\n", + " )\n", " return self._root_client\n", "\n", "\n", "class UserCodeConfig(SyftBaseModel):\n", " num: int = 1\n", + " created: int = 0\n", "\n", "\n", "class FixtureConfig(SyftBaseModel):\n", @@ -87,13 +92,11 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 27, "id": "59231950", "metadata": {}, "outputs": [], "source": [ - "from faker import Faker\n", - "\n", "class SyftFixture:\n", " def __init__(self, config: dict) -> None:\n", " self.config = FixtureConfig(**config)\n", @@ -102,7 +105,8 @@ "\n", " def add_users(self):\n", " for user_config in self.config.user:\n", - " for _ in range(user_config.num):\n", + " users_to_create = user_config.num - user_config.created\n", + " for _ in range(users_to_create):\n", " password = self.faker.password()\n", " user = self.root_client.api.services.user.create(\n", " name=self.faker.name(),\n", @@ -111,20 +115,24 @@ " password_verify=password,\n", " institution=self.faker.company(),\n", " website=self.faker.url(),\n", - " role=user_config.role\n", + " role=user_config.role,\n", " )\n", " assert isinstance(user, UserView)\n", + " user_config.created += 1\n", "\n", " def get_sample_tabular_data(self, split_ratio: float = 0.8):\n", - " tabular_data_url = \"https://github.com/OpenMined/datasets/blob/main/trade_flow/ca%20-%20feb%202021.csv?raw=True\"\n", + " tabular_data_url = autocache(\n", + " \"https://github.com/OpenMined/datasets/blob/main/trade_flow/ca%20-%20feb%202021.csv?raw=True\"\n", + " )\n", " tabular_data = pd.read_csv(tabular_data_url)\n", + " stringcols = tabular_data.select_dtypes(include=\"object\").columns\n", + " tabular_data[stringcols] = tabular_data[stringcols].fillna(\"\").astype(str)\n", " columns = tabular_data.shape[0]\n", " private_index = int(split_ratio * columns)\n", " private_data = tabular_data[:private_index]\n", " mock_data = tabular_data[private_index:]\n", " return private_data, mock_data\n", "\n", - "\n", " def get_sample_data(self, type: DatasetType) -> tuple:\n", " if type == DatasetType.TABULAR:\n", " return self.get_sample_tabular_data()\n", @@ -132,48 +140,58 @@ " raise NotImplementedError\n", "\n", " def add_datasets(self):\n", - " for dataset in range(self.config.dataset):\n", - " \n", - " private_data, mock_data = get_sample_data(dataset.type)\n", - " asset = sy.Asset(\n", - " name=self.faker.name(),\n", - " description=self.faker.text(),\n", - " data=private_data,\n", - " mock=mock_data,\n", - " )\n", + " for dataset_config in self.config.dataset:\n", + " datasets_to_create = dataset_config.num - dataset_config.created\n", + " for _ in range(datasets_to_create):\n", + " dataset_name = f\"{self.faker.first_name()}-Dataset\"\n", + " private_data, mock_data = self.get_sample_data(dataset_config.type)\n", + " asset = sy.Asset(\n", + " name=f\"{dataset_name}-{self.faker.uuid4()[:6]}\",\n", + " description=self.faker.text(),\n", + " data=private_data,\n", + " mock=mock_data,\n", + " )\n", "\n", - " dataset = sy.Dataset(\n", - " name=self.faker.name(),\n", - " description=self.faker.text(),\n", - " url=self.faker.url(),\n", - " asset_list=[asset],\n", - " )\n", - " \n", - " res = self.root_client.upload_dataset(dataset)\n", - " assert not isinstance(dataset, sy.SyftError)" + " dataset = sy.Dataset(\n", + " name=dataset_name,\n", + " description=self.faker.text(),\n", + " url=self.faker.url(),\n", + " asset_list=[asset],\n", + " )\n", + " res = self.root_client.upload_dataset(dataset)\n", + " assert not isinstance(res, sy.SyftError)\n", + " dataset_config.created += 1\n", + "\n", + " def info(self):\n", + " _repr_ = \"\\nUsers: \"\n", + "\n", + " for user_conf in self.config.user:\n", + " _repr_ += f\"\\n\\t{user_conf.role.name}: {user_conf.created}/{user_conf.num}\"\n", + "\n", + " _repr_ += \"\\nDatasets:\"\n", + " for dataset_conf in self.config.dataset:\n", + " _repr_ += f\"\\n\\t{dataset_conf.type.name}: {dataset_conf.created}/{dataset_conf.num}\"\n", + " print(_repr_)\n", + "\n", + " def create(self) -> str:\n", + " self.add_users()\n", + " self.add_datasets()\n", + " print(self.info())" ] }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 28, "id": "d9954230-4b19-4c1c-8b35-488757d86741", "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Starting test-domain server on 0.0.0.0:8081\n", - " Done.\n" - ] - }, { "data": { "text/html": [ - "
SyftInfo:
You have launched a development server at http://0.0.0.0:8081.It is intended only for local use.

" + "
SyftInfo:
You have launched a development server at http://0.0.0.0:None.It is intended only for local use.

" ], "text/plain": [ - "SyftInfo: You have launched a development server at http://0.0.0.0:8081.It is intended only for local use." + "SyftInfo: You have launched a development server at http://0.0.0.0:None.It is intended only for local use." ] }, "metadata": {}, @@ -181,19 +199,22 @@ } ], "source": [ - "server = sy.orchestra.launch(\"test-domain\", dev_mode=False, reset=True, port=8081)" + "server = sy.orchestra.launch(\"test-domain\", dev_mode=False, reset=True)" ] }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 29, "id": "312d5348-f6d6-4ac3-8509-e75e04d651c6", "metadata": {}, "outputs": [], "source": [ "config = {\n", " \"server\": {\"server\": server},\n", - " \"user\": [{\"role\": ServiceRole.DATA_OWNER, \"num\": 1}, {\"role\": ServiceRole.DATA_SCIENTIST, \"num\": 1}],\n", + " \"user\": [\n", + " {\"role\": ServiceRole.DATA_OWNER, \"num\": 1},\n", + " {\"role\": ServiceRole.DATA_SCIENTIST, \"num\": 1},\n", + " ],\n", " \"dataset\": [{\"type\": DatasetType.TABULAR, \"num\": 1}],\n", " \"user_code\": {\"num\": 0},\n", "}" @@ -201,7 +222,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 30, "id": "780f9d26-380c-490f-af24-aef9f594ded7", "metadata": {}, "outputs": [], @@ -211,7 +232,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 31, "id": "b629f2bd-27f2-44ea-b4d3-f92592ece28c", "metadata": {}, "outputs": [ @@ -241,17 +262,51 @@ }, { "cell_type": "code", - "execution_count": 36, - "id": "645fe575-ed07-4c7c-9e75-6dc015ab0ec7", + "execution_count": 32, + "id": "899a89b2-ac1c-414d-9e15-7f9ae4b2186f", + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/tmp/ipykernel_122554/579099660.py:26: DtypeWarning: Columns (14) have mixed types. Specify dtype option on import or set low_memory=False.\n", + " tabular_data = pd.read_csv(tabular_data_url)\n", + "Uploading: Garrett-Dataset-5ff0e4: 100%|\u001b[32m█████████████████████████████████████████████████████████████████████████████████████████████\u001b[0m| 1/1 [00:00<00:00, 1.18it/s]\u001b[0m\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "Users: \n", + "\tDATA_OWNER: 1/1\n", + "\tDATA_SCIENTIST: 1/1\n", + "Datasets:\n", + "\tTABULAR: 1/1\n", + "None\n" + ] + } + ], + "source": [ + "fixture.create()" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "f4801a44-5663-414a-92a5-8c1335181980", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "
\n", + "
\n", + " \n", + "
\n", + "

UserView List

\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "

Total: 0

\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + "\n", + "" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "root_client.users" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "3c38d151-4109-4b58-a364-a72a664082e7", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
\n", + "\n", + "
\n", + "
\n", + " \n", + "
\n", + "

Dataset Dicttuple

\n", + "
\n", + "
\n", + "
\n", + " \n", + "
\n", + "
\n", + "

Total: 0

\n", + "
\n", + "
\n", + "
\n", + "\n", + "\n", + "\n", + "" ], "text/plain": [ - "SyftWarning: You are using a default password. Please change the password using `[your_client].account.set_password([new_password])`." + "" ] }, + "execution_count": 13, "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "fixture = SyftFixture(config)" - ] - }, - { - "cell_type": "code", - "execution_count": 32, - "id": "899a89b2-ac1c-414d-9e15-7f9ae4b2186f", - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/tmp/ipykernel_122554/579099660.py:26: DtypeWarning: Columns (14) have mixed types. Specify dtype option on import or set low_memory=False.\n", - " tabular_data = pd.read_csv(tabular_data_url)\n", - "Uploading: Garrett-Dataset-5ff0e4: 100%|\u001b[32m█████████████████████████████████████████████████████████████████████████████████████████████\u001b[0m| 1/1 [00:00<00:00, 1.18it/s]\u001b[0m\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "Users: \n", - "\tDATA_OWNER: 1/1\n", - "\tDATA_SCIENTIST: 1/1\n", - "Datasets:\n", - "\tTABULAR: 1/1\n", - "None\n" - ] + "output_type": "execute_result" } ], "source": [ - "fixture.create()" + "root_client.datasets" ] }, { "cell_type": "code", - "execution_count": 33, - "id": "f4801a44-5663-414a-92a5-8c1335181980", + "execution_count": 14, + "id": "a8267487-e3f2-4df7-86ff-37d27a77a0d0", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "\n", "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "\n", - "
\n", - "
\n", - " \n", - "
\n", - "

UserView List

\n", - "
\n", - "
\n", - "
\n", - " \n", - "
\n", - "
\n", - "

Total: 0

\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "root_client.users" ] }, { "cell_type": "code", - "execution_count": 13, - "id": "3c38d151-4109-4b58-a364-a72a664082e7", + "execution_count": null, + "id": "12", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "\n", - "
\n", - "
\n", - " \n", - "
\n", - "

Dataset Dicttuple

\n", - "
\n", - "
\n", - "
\n", - " \n", - "
\n", - "
\n", - "

Total: 0

\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "root_client.datasets" ] }, { "cell_type": "code", - "execution_count": 14, - "id": "a8267487-e3f2-4df7-86ff-37d27a77a0d0", + "execution_count": null, + "id": "13", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "\n", - "
\n", - "
\n", - " \n", - "
\n", - "

Request List

\n", - "
\n", - "
\n", - "
\n", - " \n", - "
\n", - "
\n", - "

Total: 0

\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "root_client.requests" ] }, { "cell_type": "code", - "execution_count": 15, - "id": "33415a5e-8202-4c2e-8504-d48e3f80f617", + "execution_count": null, + "id": "14", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
\n", - "\n", - "
\n", - "
\n", - " \n", - "
\n", - "

UserCode List

\n", - "
\n", - "
\n", - "
\n", - " \n", - "
\n", - "
\n", - "

Total: 0

\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - "\n", - "" - ], - "text/plain": [ - "" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "root_client.code" ] @@ -10885,7 +184,15 @@ { "cell_type": "code", "execution_count": null, - "id": "dfc30638-4c5c-4a17-ba73-b59a3c1244c3", + "id": "15", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16", "metadata": {}, "outputs": [], "source": [] diff --git a/notebooks/Fixtures/fixture_utils.py b/notebooks/Fixtures/fixture_utils.py index a6b4b03b54e..f5730085827 100644 --- a/notebooks/Fixtures/fixture_utils.py +++ b/notebooks/Fixtures/fixture_utils.py @@ -131,7 +131,7 @@ def _add_dataset(self, data_type: DatasetType): asset_list=[asset], ) res = self.root_client.upload_dataset(dataset) - assert not isinstance(res, sy.SyftError) + assert not isinstance(res, sy.SyftError), res def _add_datasets(self): for dataset_config in tqdm(self.config.dataset, desc="Datasets:", position=0): @@ -182,7 +182,8 @@ def _add_user_code(self): user_code_to_create = ( self.config.user_code.to_create - self.config.user_code.created ) - for _ in tqdm(range(user_code_to_create), desc="User Code", position=1): + print(f"Creating {user_code_to_create} user code.") + for _ in range(user_code_to_create): # Randomly choose a data scientist ds_user = choice(ds_users) if ds_user.email not in user_client_map: