Skip to content

Commit

Permalink
Merge pull request #9301 from OpenMined/sb/move-helpers-backup
Browse files Browse the repository at this point in the history
Move helpers into syft utils
  • Loading branch information
BrendanSchell authored Sep 18, 2024
2 parents 32896af + ca9dee6 commit f6633f6
Show file tree
Hide file tree
Showing 30 changed files with 208 additions and 189 deletions.
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ repos:
packages/syft/src/syft/proto.*|
packages/syft/tests/syft/lib/python.*|
packages/grid.*|
packages/syft/src/syft/federated/model_serialization/protos.py
packages/syft/src/syft/federated/model_serialization/protos.py|
packages/syft/src/syft/util/test_helpers/.*|
)$
- repo: https://github.com/MarcoGorelli/absolufy-imports
Expand Down Expand Up @@ -161,6 +162,7 @@ repos:
"--non-interactive",
"--config-file=tox.ini",
]
exclude: ^(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
15 changes: 5 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,16 @@
"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.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
Loading

0 comments on commit f6633f6

Please sign in to comment.