Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move helpers into utils #9301

Merged
merged 11 commits into from
Sep 18, 2024
Next Next commit
Moving helpers into its own module without helpers
Co-authored-by: Brendan Schell <brendanschell1@gmail.com>
  • Loading branch information
snwagh and BrendanSchell committed Sep 18, 2024
commit e7179e62b006d9b9f63e1d182ff6a715f6e2487e
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ repos:
"--non-interactive",
"--config-file=tox.ini",
]
excludes: ^packages/syft/src/syft/util/test_helpers

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,12 @@
"metadata": {},
"outputs": [],
"source": [
"# isort: off\n",
"# stdlib\n",
"from os import environ as env\n",
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft import test_helpers # noqa: F401\n",
"\n",
"# third party\n",
"from email_helpers import get_email_server\n",
"# isort: on"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Launch & login"
"from syft.util.test_helpers.email_helpers import get_email_server"
]
},
{
Expand Down Expand Up @@ -249,7 +237,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
67 changes: 27 additions & 40 deletions notebooks/scenarios/bigquery/001-scale-delete-worker-pools.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,13 @@
"metadata": {},
"outputs": [],
"source": [
"# isort: off\n",
"# stdlib\n",
"import os\n",
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft import test_helpers # noqa: F401\n",
"\n",
"# third party\n",
"from email_helpers import Timeout\n",
"from email_helpers import get_email_server\n",
"# isort: on"
"from syft.util.test_helpers.email_helpers import Timeout\n",
"from syft.util.test_helpers.email_helpers import get_email_server"
]
},
{
Expand All @@ -40,14 +35,6 @@
"id": "2",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"environment = os.environ.get(\"ORCHESTRA_DEPLOYMENT_TYPE\", \"python\")\n",
"\n",
Expand All @@ -60,7 +47,7 @@
},
{
"cell_type": "markdown",
"id": "4",
"id": "3",
"metadata": {},
"source": [
"### Launch server & login"
Expand All @@ -69,7 +56,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "5",
"id": "4",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -86,7 +73,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "6",
"id": "5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -96,7 +83,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "7",
"id": "6",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -108,7 +95,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "8",
"id": "7",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -118,7 +105,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "9",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -128,15 +115,15 @@
},
{
"cell_type": "markdown",
"id": "10",
"id": "9",
"metadata": {},
"source": [
"### Scale Worker pool"
]
},
{
"cell_type": "markdown",
"id": "11",
"id": "10",
"metadata": {},
"source": [
"##### Scale up"
Expand All @@ -145,7 +132,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -159,7 +146,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "13",
"id": "12",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -169,7 +156,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "14",
"id": "13",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -189,7 +176,7 @@
},
{
"cell_type": "markdown",
"id": "15",
"id": "14",
"metadata": {},
"source": [
"##### Scale down"
Expand All @@ -198,7 +185,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "15",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -213,7 +200,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -232,7 +219,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "18",
"id": "17",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -245,7 +232,7 @@
},
{
"cell_type": "markdown",
"id": "19",
"id": "18",
"metadata": {},
"source": [
"#### Delete Worker Pool"
Expand All @@ -254,7 +241,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -267,7 +254,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "21",
"id": "20",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -277,7 +264,7 @@
},
{
"cell_type": "markdown",
"id": "22",
"id": "21",
"metadata": {},
"source": [
"#### Re-launch the default worker pool"
Expand All @@ -286,7 +273,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "23",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -296,7 +283,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "24",
"id": "23",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -310,7 +297,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "25",
"id": "24",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -324,7 +311,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "26",
"id": "25",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -334,7 +321,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "27",
"id": "26",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -344,7 +331,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "28",
"id": "27",
"metadata": {},
"outputs": [],
"source": []
Expand Down
14 changes: 7 additions & 7 deletions notebooks/scenarios/bigquery/010-setup-bigquery-pool.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@
"metadata": {},
"outputs": [],
"source": [
"# isort: off\n",
"# stdlib\n",
"import os\n",
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft import test_helpers # noqa: F401\n",
"from syft import test_settings\n",
"\n",
"# third party\n",
"from email_helpers import get_email_server\n",
"# isort: on"
"from syft.util.test_helpers.email_helpers import get_email_server"
]
},
{
Expand Down Expand Up @@ -526,6 +521,11 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "syft",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
Expand All @@ -536,7 +536,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
16 changes: 6 additions & 10 deletions notebooks/scenarios/bigquery/011-users-emails-passwords.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,17 @@
"metadata": {},
"outputs": [],
"source": [
"# isort: off\n",
"# stdlib\n",
"import os\n",
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft import test_helpers # noqa: F401\n",
"\n",
"# third party\n",
"from email_helpers import SENDER\n",
"from email_helpers import create_user\n",
"from email_helpers import get_email_server\n",
"from email_helpers import make_user\n",
"from email_helpers import save_users\n",
"# isort: on"
"from syft import get_helpers # noqa: F401\n",
"from syft.util.test_helpers.email_helpers import SENDER\n",
"from syft.util.test_helpers.email_helpers import create_user\n",
"from syft.util.test_helpers.email_helpers import get_email_server\n",
"from syft.util.test_helpers.email_helpers import make_user\n",
"from syft.util.test_helpers.email_helpers import save_users"
]
},
{
Expand Down
13 changes: 4 additions & 9 deletions notebooks/scenarios/bigquery/020-configure-api.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,17 @@
"metadata": {},
"outputs": [],
"source": [
"# isort: off\n",
"# stdlib\n",
"\n",
"# syft absolute\n",
"import syft as sy\n",
"from syft import test_helpers # noqa: F401\n",
"from syft import test_settings\n",
"\n",
"# third party\n",
"from apis import make_schema\n",
"from apis import make_submit_query\n",
"from apis import make_test_query\n",
"from syft.util.test_helpers.apis import make_schema\n",
"from syft.util.test_helpers.apis import make_submit_query\n",
"from syft.util.test_helpers.apis import make_test_query\n",
"\n",
"# run email server\n",
"from email_helpers import get_email_server\n",
"# isort: on"
"from syft.util.test_helpers.email_helpers import get_email_server"
]
},
{
Expand Down
Loading