"## Add and push new simulations to the CoReDB - Notebook\n",
"\n",
"This notebook:\n",
"1. Adds simulations to the `dbkeys` and prepares its corresponding folder in the `CoRe_DB_clone` path\n",
"2. Adds their runs with metadata and h5 file.\n",
"3. Updates the CoRe DB index json file\n",
"4. Writes in each simulation folder a `.gitattributes` file to add the `data.h5` file to the LFS storage\n",
"5. Initializes and creates the git repositories \n",
"6. Pushes everything to [https://core-gitlfs.tpi.uni-jena.de/](https://core-gitlfs.tpi.uni-jena.de/)\n",
"\n",
"Note: The repositories are created as *private* projects. For now it's only possible to change this on the website under `Settings -> Visibility, project features, permissions` for each repo.\n",
"\n",
"Pre-requisites:\n",
"- Make sure you have enough access rights to push\n",
"- Add your ssh-key to `gitlab` [here](https://core-gitlfs.tpi.uni-jena.de/-/profile/keys). If it had a passphrase, avoid typing it every time by:\n",
" - Starting the **ssh-agent**: ``` eval `ssh-agent -s` ```\n",
" - Add key and enter passphrase: `ssh-add ~/.ssh/keyname` and you're set!\n",
"- This script assumes that the simulations already exist in a common directory (in this case in `tullio:/data/numrel/DATABASE/Release02/`) with their correct run folders with `data.h5` + `metadata.txt`\n",
"- In this particular case we had already the `metadata_main.txt` and `metadata.txt`'s, but should work anyways by defining your own metadata dictionary.\n",
"- Assumes the CoRe_DB_clone directory is in `tullio:/data/numrel/DATABASE/CoRe_DB_clone`\n",
"\n",
"[*Last Updated: 10/2022 AG*]"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"import numpy as np\n",
"from watpy.coredb.coredb import *\n",
"from watpy.coredb.metadata import *\n",
"from watpy.utils.ioutils import *\n",
"from watpy.utils.coreh5 import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The function below does the git magic. Modify if you find a way to make the repo public from the beginning."
## Add and push new simulations to the CoReDB - Notebook
This notebook:
1. Adds simulations to the `dbkeys` and prepares its corresponding folder in the `CoRe_DB_clone` path
2. Adds their runs with metadata and h5 file.
3. Updates the CoRe DB index json file
4. Writes in each simulation folder a `.gitattributes` file to add the `data.h5` file to the LFS storage
5. Initializes and creates the git repositories
6. Pushes everything to [https://core-gitlfs.tpi.uni-jena.de/](https://core-gitlfs.tpi.uni-jena.de/)
Note: The repositories are created as *private* projects. For now it's only possible to change this on the website under `Settings -> Visibility, project features, permissions` for each repo.
Pre-requisites:
- Make sure you have enough access rights to push
- Add your ssh-key to `gitlab`[here](https://core-gitlfs.tpi.uni-jena.de/-/profile/keys). If it had a passphrase, avoid typing it every time by:
- Starting the **ssh-agent**: ``` eval `ssh-agent -s` ```
- Add key and enter passphrase: `ssh-add ~/.ssh/keyname` and you're set!
- This script assumes that the simulations already exist in a common directory (in this case in `tullio:/data/numrel/DATABASE/Release02/`) with their correct run folders with `data.h5` + `metadata.txt`
- In this particular case we had already the `metadata_main.txt` and `metadata.txt`'s, but should work anyways by defining your own metadata dictionary.
- Assumes the CoRe_DB_clone directory is in `tullio:/data/numrel/DATABASE/CoRe_DB_clone`
[*Last Updated: 10/2022 AG*]
%% Cell type:code id: tags:
``` python
importos
importnumpyasnp
fromwatpy.coredb.coredbimport*
fromwatpy.coredb.metadataimport*
fromwatpy.utils.ioutilsimport*
fromwatpy.utils.coreh5import*
```
%% Cell type:markdown id: tags:
The function below does the git magic. Modify if you find a way to make the repo public from the beginning.