From 76d18686b69b82bf290c6949a3d4945702956874 Mon Sep 17 00:00:00 2001 From: Stuart McAlpine Date: Tue, 26 Nov 2024 17:37:41 +0100 Subject: [PATCH 1/4] Be more explicit where pgpass file is --- docs/source/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 6b9afbd6..96247c14 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -77,4 +77,4 @@ ensure by doing .. code-block:: bash - chmod 600 .pgpass + chmod 600 ~/.pgpass From 557860bc1e85148a60274556396b0e1c07b2afd5 Mon Sep 17 00:00:00 2001 From: Stuart McAlpine Date: Tue, 26 Nov 2024 17:43:15 +0100 Subject: [PATCH 2/4] Add more links to where the notebooks are --- docs/source/tutorial_python.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/source/tutorial_python.rst b/docs/source/tutorial_python.rst index 2feb1141..22f9dc66 100644 --- a/docs/source/tutorial_python.rst +++ b/docs/source/tutorial_python.rst @@ -4,11 +4,13 @@ The ``dataregistry`` package ============================ The tutorials for the ``dataregistry`` package come in the form of Jupyter -Notebooks. +Notebooks (hosted in the ``docs/source/tutorial_notebooks`` directory in the +repository). These tutorial notebooks can be run interactively at NERSC (see :ref:`here ` for more info), or serve as standalone reference -material by viewing the notebooks on GitHub. +material by `viewing the notebooks on GitHub +`__. 1) Getting started with the data registry ----------------------------------------- From a6724066367826ae413ed02650875fcc2bcb4a41 Mon Sep 17 00:00:00 2001 From: Stuart McAlpine Date: Tue, 26 Nov 2024 17:49:55 +0100 Subject: [PATCH 3/4] Add mcalpine to random username in tutorial schema --- docs/source/tutorial_notebooks/datasets_deeper_look.ipynb | 3 ++- docs/source/tutorial_notebooks/pipelines.ipynb | 3 ++- docs/source/tutorial_notebooks/production_schema.ipynb | 3 ++- docs/source/tutorial_notebooks/query_datasets.ipynb | 3 ++- docs/source/tutorial_notebooks/register_datasets.ipynb | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/source/tutorial_notebooks/datasets_deeper_look.ipynb b/docs/source/tutorial_notebooks/datasets_deeper_look.ipynb index c4e4d606..10d035d6 100644 --- a/docs/source/tutorial_notebooks/datasets_deeper_look.ipynb +++ b/docs/source/tutorial_notebooks/datasets_deeper_look.ipynb @@ -41,7 +41,8 @@ "source": [ "# Come up with a random owner name to avoid clashes\n", "from random import randint\n", - "OWNER = \"tutorial_\" + str(randint(0,int(1e6)))\n", + "import os\n", + "OWNER = \"tutorial_\" + os.environ.get('USER') + '_' + str(randint(0,int(1e6)))\n", "\n", "import dataregistry\n", "print(f\"Working with dataregistry version: {dataregistry.__version__} as random owner {OWNER}\")" diff --git a/docs/source/tutorial_notebooks/pipelines.ipynb b/docs/source/tutorial_notebooks/pipelines.ipynb index 679579ac..160cad36 100644 --- a/docs/source/tutorial_notebooks/pipelines.ipynb +++ b/docs/source/tutorial_notebooks/pipelines.ipynb @@ -38,7 +38,8 @@ "source": [ "# Come up with a random owner name to avoid clashes\n", "from random import randint\n", - "OWNER = \"tutorial_\" + str(randint(0,int(1e6)))\n", + "import os\n", + "OWNER = \"tutorial_\" + os.environ.get('USER') + '_' + str(randint(0,int(1e6)))\n", "\n", "import dataregistry\n", "print(f\"Working with dataregistry version: {dataregistry.__version__} as random owner {OWNER}\")" diff --git a/docs/source/tutorial_notebooks/production_schema.ipynb b/docs/source/tutorial_notebooks/production_schema.ipynb index d3eb125e..26d69434 100644 --- a/docs/source/tutorial_notebooks/production_schema.ipynb +++ b/docs/source/tutorial_notebooks/production_schema.ipynb @@ -44,7 +44,8 @@ "source": [ "# Come up with a random owner name to avoid clashes\n", "from random import randint\n", - "OWNER = \"tutorial_\" + str(randint(0,int(1e6)))\n", + "import os\n", + "OWNER = \"tutorial_\" + os.environ.get('USER') + '_' + str(randint(0,int(1e6)))\n", "\n", "import dataregistry\n", "print(f\"Working with dataregistry version: {dataregistry.__version__} as random owner {OWNER}\")" diff --git a/docs/source/tutorial_notebooks/query_datasets.ipynb b/docs/source/tutorial_notebooks/query_datasets.ipynb index 5af3cb8f..e4b7fe10 100644 --- a/docs/source/tutorial_notebooks/query_datasets.ipynb +++ b/docs/source/tutorial_notebooks/query_datasets.ipynb @@ -39,7 +39,8 @@ "source": [ "# Come up with a random owner name to avoid clashes\n", "from random import randint\n", - "OWNER = \"tutorial_\" + str(randint(0,int(1e6)))\n", + "import os\n", + "OWNER = \"tutorial_\" + os.environ.get('USER') + '_' + str(randint(0,int(1e6)))\n", "\n", "import dataregistry\n", "print(f\"Working with dataregistry version: {dataregistry.__version__} as random owner {OWNER}\")" diff --git a/docs/source/tutorial_notebooks/register_datasets.ipynb b/docs/source/tutorial_notebooks/register_datasets.ipynb index 408ff9a1..f0755037 100644 --- a/docs/source/tutorial_notebooks/register_datasets.ipynb +++ b/docs/source/tutorial_notebooks/register_datasets.ipynb @@ -46,7 +46,8 @@ "source": [ "# Come up with a random owner name to avoid clashes\n", "from random import randint\n", - "OWNER = \"tutorial_\" + str(randint(0,int(1e6)))\n", + "import os\n", + "OWNER = \"tutorial_\" + os.environ.get('USER') + '_' + str(randint(0,int(1e6)))\n", "\n", "import dataregistry\n", "print(f\"Working with dataregistry version: {dataregistry.__version__} as random owner {OWNER}\")" From 9e7cc7465cd8be708612e1ff939b842e5024dd7a Mon Sep 17 00:00:00 2001 From: Stuart McAlpine Date: Tue, 26 Nov 2024 17:53:32 +0100 Subject: [PATCH 4/4] Add note about reg_reader premissions in tutorial schema --- docs/source/tutorial_notebooks/register_datasets.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/tutorial_notebooks/register_datasets.ipynb b/docs/source/tutorial_notebooks/register_datasets.ipynb index f0755037..6178e2f7 100644 --- a/docs/source/tutorial_notebooks/register_datasets.ipynb +++ b/docs/source/tutorial_notebooks/register_datasets.ipynb @@ -158,7 +158,9 @@ "id": "d22523db-ae92-4474-bb96-5ad98a404d61", "metadata": {}, "source": [ - "For these tutorials, there is a stand alone working (`tutorial_working`) and production (`tutorial_production`) tutorial schema that we will connect to as to not interupt the default DESC schemas with random entries. If you are practicing using the `dataregistry` outwith these tutorial notebooks, feel free to also use the tutorial schemas for your entries. " + "For these tutorials, there is a stand alone working (`tutorial_working`) and production (`tutorial_production`) tutorial schema that we will connect to as to not interupt the default DESC schemas with random entries. If you are practicing using the `dataregistry` outwith these tutorial notebooks, feel free to also use the tutorial schemas for your entries.\n", + "\n", + "Note the `reg_reader` has write access to the tutorial schema, for testing within these notebooks, however only the `reg_writer` account can write to the working schema." ] }, {