Skip to content

Commit

Permalink
Add OSF io for the hackathon
Browse files Browse the repository at this point in the history
  • Loading branch information
ninamiolane committed Apr 28, 2022
1 parent 9aef412 commit 72048df
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
20 changes: 10 additions & 10 deletions notebooks/download_and_upload_with_osf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
"source": [
"# Download and Upload with OSF\n",
"\n",
"This tutorial shows how to download and upload cryo-EM datasets using the `osf` module from `ioSPI`, that interact with the [Open Science Foundation (OSF)](https://osf.io/) framework.\n",
"This tutorial shows how to download and upload cryo-EM datasets using the `datasets` module from `ioSPI`, that interact with the [Open Science Foundation (OSF)](https://osf.io/) framework.\n",
"\n",
"OSF is an initiative that aims to increase the openness, reproducibility and integrity of scientific research. Among other functionalities, it is possible to upload scientific data which can be accessed by an Application Programming Interface (API). \n",
"\n",
"``ioSPI`` offers functionalities that allow uploading and accessing cryo-EM data using:\n",
"- either, in order to get started: using the class `Project` that leverages the package `osfclient`\n",
"- or, if the user requires finer control: using the class `OSFProject` which follows `OSF APIv2`. \n",
"- or, if the user requires finer control: using the class `OSFUpload` which follows `OSF APIv2`. \n",
"\n",
"This tutorial introduces both options."
]
Expand All @@ -38,17 +38,17 @@
"\n",
"The email address and the token will be needed to connect to different OSF projects.\n",
"\n",
"We import the `osf` module from `ioSPI`:"
"We import the `datasets` module from `ioSPI`:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "e74dd634",
"metadata": {},
"outputs": [],
"source": [
"from ioSPI.ioSPI import osf"
"from ioSPI.ioSPI import datasets"
]
},
{
Expand Down Expand Up @@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "febfdedd",
"metadata": {},
"outputs": [
Expand All @@ -100,7 +100,7 @@
}
],
"source": [
"cryoem_simulated_project = osf.Project(\n",
"cryoem_simulated_project = datasets.Project(\n",
" username=\"[email protected]\", \n",
" token=\"HBGGBOJcLYQfadEKIOyXJiLTum3ydXK4nGP3KmbkYUeBuYkZma9LPBSYennQn92gjP2NHn\",\n",
" project_id=\"7g42j\")"
Expand All @@ -120,7 +120,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "f4f5b054",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -2299,7 +2299,7 @@
"text": [
"\r",
" 0%| | 0.00/4.22k [00:00<?, ?bytes/s]\r",
"100%|██████████| 4.22k/4.22k [00:00<00:00, 8.24Mbytes/s]\n"
"100%|██████████| 4.22k/4.22k [00:00<00:00, 9.90Mbytes/s]\n"
]
}
],
Expand Down Expand Up @@ -2329,7 +2329,7 @@
"This will create a new project page, as the one we are using here.\n",
"- Save the project ID of the project you just created!\n",
"\n",
"You should then create a new `my_project` object of the class `osf.Project` with the new project ID.\n",
"You should then create a new `my_project` object of the class `datasets.Project` with the new project ID.\n",
"\n",
"For the purpose of this tutorial, however, we will stay with our original project cryoEM simulated and use our object `cryoem_simulated_project`.\n",
"\n",
Expand Down
28 changes: 14 additions & 14 deletions notebooks/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"from ioSPI import particle_metadata\n",
"from ioSPI.ioSPI import particle_metadata\n",
"\n",
"class Config:\n",
" \"\"\"Class to instantiate the config object.\"\"\"\n",
Expand All @@ -55,7 +55,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -72,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand All @@ -97,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -173,7 +173,7 @@
"0 13 14 "
]
},
"execution_count": 8,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -192,7 +192,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -210,7 +210,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -226,14 +226,14 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 9,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"# Created by the starfile Python package (version 0.4.11) at 11:16:57 on 09/03/2022\n",
"# Created by the starfile Python package (version 0.4.11) at 17:35:08 on 27/04/2022\n",
"\n",
"data_\n",
"\n",
Expand Down Expand Up @@ -279,11 +279,11 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"from ioSPI import datasets"
"from ioSPI.ioSPI import datasets"
]
},
{
Expand Down Expand Up @@ -409,7 +409,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -423,7 +423,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.10.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 72048df

Please sign in to comment.