From 3bd859bfe16660a90a6fd3385fc7e085ec22d217 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos <ankostis@gmail.com> Date: Wed, 18 May 2022 01:10:25 +0300 Subject: [PATCH] rename(scripts) U/PSTORE-->U/PEOS (& avoid PS1 hint) --- README.md | 18 +++++++++--------- example.py | 2 +- setup-account.sh | 8 ++++---- src/uds4jrc/config.py | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 1b2632d..960d637 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ preloaded in *eos-dirs* (read section below about Nextcloud mapping). 2. Clone this repo inside your **"personal-eos" dir** (`/eos/jeodpp/home/users/$USER`): ```bash - cd $/eos/jeodpp/home/users/$USER # use $USTORE var in the future + cd $/eos/jeodpp/home/users/$USER # use $UEOS var in the future git clone https://jeodpp.jrc.ec.europa.eu/apps/gitlab/use_cases/legent/uds-scripts.git/ \ && cd uds-scripts ``` @@ -113,9 +113,9 @@ Work with the above dirs is facilitated by the definitons of these Python and ENVIRONMENT (after installation) variables: ```bash -export USTORE="/eos/jeodpp/home/users/${USER}" +export UEOS="/eos/jeodpp/home/users/${USER}" export UTRANS="/eos/jeodpp/home/users/${USER}/transfer" -export PSTORE="/eos/jeodpp/data/projects/LEGENT" +export PEOS="/eos/jeodpp/data/projects/LEGENT" export PTRANS="/eos/jeodpp/data/projects/LEGENT/transfer" ``` @@ -124,14 +124,14 @@ export PTRANS="/eos/jeodpp/data/projects/LEGENT/transfer" * activate you conda-env: ```bash - cd $USTORE/uds-scripts - conda activate $USTORE/uds-scripts/env + cd $UEOS/uds-scripts + conda activate $UEOS/uds-scripts/env ``` or launch PyCharm/VSCode. * **Create ANOTHER working folder for you code & data** - under `USTORE/idea-1` so as to let others view (read-only) + under `UEOS/idea-1` so as to let others view (read-only) your intermediate result (or `cd` to your private home-dir, ie `~/idea-1`). * *--(process data)--* @@ -141,7 +141,7 @@ export PTRANS="/eos/jeodpp/data/projects/LEGENT/transfer" * update db (only for users with adb admin credentials) * copy/move specific files for/to the folders synced by the *nextcloud-agent*, -* or update the "public-eos" dir `PSTORE` (if you're certain about the results). +* or update the "public-eos" dir `PEOS` (if you're certain about the results). ### 2.1. Sample code @@ -155,8 +155,8 @@ df = pd.DataFrame.from_records(eea_2020_flattened.find()) ... # process your data -save_to_parquet(df, Config.USTORE, 'test.parquet') -save_to_excel(df, Config.USTORE, 'test.xlsx') +save_to_parquet(df, Config.UEOS, 'test.parquet') +save_to_excel(df, Config.UEOS, 'test.xlsx') ``` > **TIP:** Don't store your pandas in CSVs, they are big, slow and loose precision. diff --git a/example.py b/example.py index cd07162..4b67065 100755 --- a/example.py +++ b/example.py @@ -10,4 +10,4 @@ df = pd.DataFrame.from_records(eea_raw_data.find({}, {'_id': 0}).limit(10)) ... # process your data -save_to_parquet(df, Config.USTORE, 'test.parquet') +save_to_parquet(df, Config.UEOS, 'test.parquet') diff --git a/setup-account.sh b/setup-account.sh index 0a4d9ce..e31aaec 100755 --- a/setup-account.sh +++ b/setup-account.sh @@ -153,8 +153,8 @@ function upd20_bashrc_ustore_vars { cat >> "$check_file" <<- EOF ## UDS: BDAP Storage locations -export PSTORE="/eos/jeodpp/data/projects/LEGENT" -export USTORE="/eos/jeodpp/home/users/${USER}" +export PEOS="/eos/jeodpp/data/projects/LEGENT" +export UEOS="/eos/jeodpp/home/users/${USER}" export UTRANS="/eos/jeodpp/home/users/${USER}/transfer" export PTRANS="/eos/jeodpp/data/projects/LEGENT/transfer" @@ -296,8 +296,8 @@ function upd20_ipython_ustore_vars { mkdir -p $(dirname "$check_file") cat > "$check_file" <<- EOF ## BDAP Storage locations -PSTORE="/eos/jeodpp/data/projects/LEGENT" -USTORE="/eos/jeodpp/home/users/${USER}" +PEOS="/eos/jeodpp/data/projects/LEGENT" +UEOS="/eos/jeodpp/home/users/${USER}" UTRANS="/eos/jeodpp/home/users/${USER}/transfer" PTRANS="/eos/jeodpp/data/projects/LEGENT/transfer" diff --git a/src/uds4jrc/config.py b/src/uds4jrc/config.py index e98275c..578989c 100755 --- a/src/uds4jrc/config.py +++ b/src/uds4jrc/config.py @@ -9,9 +9,9 @@ USER = getpass.getuser() class Config(mysecrets.Secrets): - USTORE = f"/eos/jeodpp/home/users/{USER}" + UEOS = f"/eos/jeodpp/home/users/{USER}" UTRANS = f"/eos/jeodpp/home/users/{USER}/transfer" - PSTORE = "/eos/jeodpp/data/projects/LEGENT" + PEOS = "/eos/jeodpp/data/projects/LEGENT" PTRANS = "/eos/jeodpp/data/projects/LEGENT/transfer" EEA_2013 = { -- GitLab