Skip to content

Commit

Permalink
Make terminal commands start with disdrodb prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed Nov 3, 2023
1 parent 8911365 commit 55518c6
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ or set up the (temporary) environment variable `DISDRODB_BASE_DIR` in your termi
To download all data stored into the DISDRODB Decentralized Data Archive, you just have to run the following command:

```bash
download_disdrodb_archive
disdrodb_download_archive
```

#### 💫 Transform the raw data to standardized netCDF files.
Expand All @@ -83,7 +83,7 @@ If you want to convert all stations raw data into standardized netCDF4 files, ru

```bash

run_disdrodb_l0
disdrodb_run_l0

```

Expand Down
4 changes: 2 additions & 2 deletions disdrodb/l0/l0_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ def run_disdrodb_l0a_station(
# Define command
cmd = " ".join(
[
"run_disdrodb_l0a_station",
"disdrodb_run_l0a_station",
# Station arguments
data_source,
campaign_name,
Expand Down Expand Up @@ -812,7 +812,7 @@ def run_disdrodb_l0b_station(
# Define command
cmd = " ".join(
[
"run_disdrodb_l0b_station",
"disdrodb_run_l0b_station",
# Station arguments
data_source,
campaign_name,
Expand Down
2 changes: 1 addition & 1 deletion disdrodb/l0/l0b_nc_concat.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def run_disdrodb_l0b_concat_station(
"""
cmd = " ".join(
[
"run_disdrodb_l0b_concat_station",
"disdrodb_run_l0b_concat_station",
data_source,
campaign_name,
station_name,
Expand Down
6 changes: 3 additions & 3 deletions disdrodb/l0/scripts/run_disdrodb_l0a.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def run_disdrodb_l0a(
from disdrodb.l0.l0_processing import run_disdrodb_l0a

# Parse data_sources, campaign_names and station arguments
print(data_sources)
print(campaign_names)
print(station_names)
# print(data_sources)
# print(campaign_names)
# print(station_names)

data_sources = parse_arg_to_list(data_sources)
campaign_names = parse_arg_to_list(campaign_names)
Expand Down
2 changes: 2 additions & 0 deletions disdrodb/l0/scripts/run_disdrodb_l0a_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def run_disdrodb_l0a_station(
from dask.distributed import Client, LocalCluster

from disdrodb.api.io import get_disdrodb_path
from disdrodb.configs import get_base_dir
from disdrodb.l0.l0_reader import get_station_reader_function

# -------------------------------------------------------------------------.
Expand All @@ -108,6 +109,7 @@ def run_disdrodb_l0a_station(
Client(cluster)
# -------------------------------------------------------------------------.
# Get reader
base_dir = get_base_dir(base_dir)
reader = get_station_reader_function(
base_dir=base_dir,
data_source=data_source,
Expand Down
2 changes: 2 additions & 0 deletions disdrodb/l0/scripts/run_disdrodb_l0b_concat_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ def run_disdrodb_l0b_concat_station(
If not specified, uses path specified in the DISDRODB active configuration. \n
"""
from disdrodb.api.io import get_disdrodb_path
from disdrodb.configs import get_base_dir
from disdrodb.l0.l0b_nc_concat import _concatenate_netcdf_files

# Retrieve processed_dir
base_dir = get_base_dir(base_dir)
processed_dir = get_disdrodb_path(
base_dir=base_dir,
product_level="L0B",
Expand Down
2 changes: 2 additions & 0 deletions disdrodb/l0/scripts/run_disdrodb_l0b_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def run_disdrodb_l0b_station(
from dask.distributed import Client, LocalCluster

from disdrodb.api.io import get_disdrodb_path
from disdrodb.configs import get_base_dir
from disdrodb.l0.l0_processing import run_l0b

# -------------------------------------------------------------------------.
Expand All @@ -108,6 +109,7 @@ def run_disdrodb_l0b_station(

# -------------------------------------------------------------------------.
# Define processed dir
base_dir = get_base_dir(base_dir)
processed_dir = get_disdrodb_path(
base_dir=base_dir,
product_level="L0B",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/contribute_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ To do so, run the following command:

.. code:: bash
export DISDRODB_BASE_DIR="<the_path_to_a_copy_of_the_disdrodb-data_you_edited/DISDRODB"
run_disdrodb_l0 --data_sources <your_data_source> --campaign_names <your_new_campaign>
disdrodb_run_l0 --data_sources <your_data_source> --campaign_names <your_new_campaign>
::note
If the correctness of the reader has already been tested, you can add the ``--debugging_mode True`` parameter to just run the processing
Expand Down
2 changes: 1 addition & 1 deletion docs/source/data_download.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ To download all data stored into the DISDRODB Decentralized Data Archive, you ju

.. code:: bash
download_disdrodb_archive --data_sources <data_source> --campaign_names <campaign_name> --station_names <station_name> --force true
disdrodb_download_archive --data_sources <data_source> --campaign_names <campaign_name> --station_names <station_name> --force true
The ``data_sources``, ``campaign_names`` and ``station_names`` parameters are optional and are meant to restrict the download processing to a specific
data source, campaign, or station.
Expand Down
14 changes: 7 additions & 7 deletions docs/source/l0_processing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ There are two ways of process a station using DISDRODB.

.. code-block::
run_disdrodb_l0_station <data_source> <campaign_name> <station_name> [parameters]
disdrodb_run_l0_station <data_source> <campaign_name> <station_name> [parameters]
Example :

.. code-block::
run_disdrodb_l0_station EPFL_2008 10 --l0a_processing True --l0b_processing True --force True --verbose True --parallel False
disdrodb_run_l0_station EPFL_2008 10 --l0a_processing True --l0b_processing True --force True --verbose True --parallel False
Type ``run_disdrodb_l0_station --help`` in the terminal to get more information on the possible parameters.
Type ``disdrodb_run_l0_station --help`` in the terminal to get more information on the possible parameters.


2. By calling a python function
Expand Down Expand Up @@ -98,21 +98,21 @@ For example, if only ``--campaign_names`` are specified, DISDRODB will process o

.. code-block::
run_disdrodb_l0 --data_sources <data_sources> --campaign_names <campaign_names> --station_names <station_names> [parameters]
disdrodb_run_l0 --data_sources <data_sources> --campaign_names <campaign_names> --station_names <station_names> [parameters]
Example :

.. code-block:: bash
run_disdrodb_l0 --campaign_names EPFL_2008 --l0a_processing True --l0b_processing True --parallel False
disdrodb_run_l0 --campaign_names EPFL_2008 --l0a_processing True --l0b_processing True --parallel False
To specify multiple campaigns you can do the follow

.. code-block:: bash
run_disdrodb_l0 --campaign_names 'EPFL_2008 LOCARNO_2018' --l0a_processing True --l0b_processing True --parallel False
disdrodb_run_l0 --campaign_names 'EPFL_2008 LOCARNO_2018' --l0a_processing True --l0b_processing True --parallel False
Type ``run_disdrodb_l0 --help`` in the terminal to get more information on the possible parameters.
Type ``disdrodb_run_l0 --help`` in the terminal to get more information on the possible parameters.


2. By calling a python function
Expand Down
8 changes: 4 additions & 4 deletions docs/source/readers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -486,27 +486,27 @@ To run the processing of a single station, you can run:

.. code-block:: bash
run_disdrodb_l0_station <data_source> <campaign_name> <station_name> [parameters]
disdrodb_run_l0_station <data_source> <campaign_name> <station_name> [parameters]
For example, to process the data of station 10 of the EPFL_2008 campaign, you would run:

.. code-block:: bash
run_disdrodb_l0_station EPFL EPFL_2008 10 --force True --verbose True --parallel False
disdrodb_run_l0_station EPFL EPFL_2008 10 --force True --verbose True --parallel False
If no problems arise, try to run the processing for all stations within a campaign, with:

.. code-block:: bash
run_disdrodb_l0 --data_sources <data_sources> --campaign_names <campaign_names> [parameters]
disdrodb_run_l0 --data_sources <data_sources> --campaign_names <campaign_names> [parameters]
For example, to process all stations of the EPFL_2008 campaign, you would run:

.. code-block:: bash
run_disdrodb_l0 --data_sources EPFL --campaign_names EPFL_2008 --force True --verbose True --parallel False
disdrodb_run_l0 --data_sources EPFL --campaign_names EPFL_2008 --force True --verbose True --parallel False
.. note::
Expand Down
10 changes: 8 additions & 2 deletions docs/source/software_structure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ The current software structure is described below:
| ├── 📜 checks.py
| ├── 📜 info.py
| ├── 📜 io.py
| ├── 📜 metadata.py
| ├── 📁 metadata
| ├── 📁 scripts
| ├── 📜 check_metadata_archive.py
| ├── 📜 check_metadata.py
| ├── 📜 info.py
| ├── 📜 io.py
| ├── 📜 manipulation.py
| ├── 📜 standards.py
| ├── 📁 data_transfer
| ├── 📜 download_data.py
| ├── 📜 upload_data.py
Expand All @@ -33,7 +40,6 @@ The current software structure is described below:
| ├── 📜 run_disdrodb_l0b_concat.py
| ├── 📜 run_disdrodb_l0b_concat_station.py
| ├── 📜 check_configs.py
| ├── 📜 check_metadata.py
| ├── 📜 check_standards.py
| ├── 📜 io.py
| ├── 📜 issue.py
Expand Down
22 changes: 11 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ packages = ["disdrodb"]

[project.scripts]
# L0A
run_disdrodb_l0a_station="disdrodb.l0.scripts.run_disdrodb_l0a_station:run_disdrodb_l0a_station"
run_disdrodb_l0a="disdrodb.l0.scripts.run_disdrodb_l0a:run_disdrodb_l0a"
disdrodb_run_l0a_station="disdrodb.l0.scripts.run_disdrodb_l0a_station:run_disdrodb_l0a_station"
disdrodb_run_l0a="disdrodb.l0.scripts.run_disdrodb_l0a:run_disdrodb_l0a"
# L0B
run_disdrodb_l0b_station="disdrodb.l0.scripts.run_disdrodb_l0b_station:run_disdrodb_l0b_station"
run_disdrodb_l0_station="disdrodb.l0.scripts.run_disdrodb_l0_station:run_disdrodb_l0_station"
disdrodb_run_l0b_station="disdrodb.l0.scripts.run_disdrodb_l0b_station:run_disdrodb_l0b_station"
disdrodb_run_l0_station="disdrodb.l0.scripts.run_disdrodb_l0_station:run_disdrodb_l0_station"
# L0B concatenation
run_disdrodb_l0b_concat_station="disdrodb.l0.scripts.run_disdrodb_l0b_concat_station:run_disdrodb_l0b_concat_station"
run_disdrodb_l0b_concat="disdrodb.l0.scripts.run_disdrodb_l0b_concat:run_disdrodb_l0b_concat"
disdrodb_run_l0b_concat_station="disdrodb.l0.scripts.run_disdrodb_l0b_concat_station:run_disdrodb_l0b_concat_station"
disdrodb_run_l0b_concat="disdrodb.l0.scripts.run_disdrodb_l0b_concat:run_disdrodb_l0b_concat"
# L0
run_disdrodb_l0b="disdrodb.l0.scripts.run_disdrodb_l0b:run_disdrodb_l0b"
run_disdrodb_l0="disdrodb.l0.scripts.run_disdrodb_l0:run_disdrodb_l0"
disdrodb_run_l0b="disdrodb.l0.scripts.run_disdrodb_l0b:run_disdrodb_l0b"
disdrodb_run_l0="disdrodb.l0.scripts.run_disdrodb_l0:run_disdrodb_l0"
# Data transfer
download_disdrodb_archive="disdrodb.data_transfer.scripts.download_disdrodb_archive:download_disdrodb_archive"
upload_disdrodb_archive="disdrodb.data_transfer.scripts.upload_disdrodb_archive:upload_disdrodb_archive"
disdrodb_download_archive="disdrodb.data_transfer.scripts.download_disdrodb_archive:download_disdrodb_archive"
disdrodb_upload_archive="disdrodb.data_transfer.scripts.upload_disdrodb_archive:upload_disdrodb_archive"
# Metadata archive
disdrodb_check_metadata_archive="disdrodb.metadata.scripts.disdrodb_check_metadata_archive:disdrodb_check_metadata_archive"
disdrodb_check_metadata_archive="disdrodb.metadata.scripts.check_metadata_archive:check_metadata_archive"

[tool.ruff]
select = ["F",
Expand Down
4 changes: 2 additions & 2 deletions tutorials/reader_preparation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2593,13 +2593,13 @@
"To run the processing of a single station, just run: \n",
" \n",
"```\n",
"run_disdrodb_l0_station <DATA_SOURCE> <CAMPAIGN_NAME> <STATION_NAME> -l0b True -f True -v True -d False\n",
"disdrodb_run_l0_station <DATA_SOURCE> <CAMPAIGN_NAME> <STATION_NAME> -l0b True -f True -v True -d False\n",
"```\n",
"\n",
"To run the processing on all stations of a given campaign, just run: \n",
" \n",
"```\n",
"run_disdrodb_l0 --data_sources <DATA_SOURCE> --campaign_names <CAMPAIGN_NAME> -f True -v True -d False\n",
"disdrodb_run_l0 --data_sources <DATA_SOURCE> --campaign_names <CAMPAIGN_NAME> -f True -v True -d False\n",
"```\n",
"\n",
"Have a look [here](https://disdrodb.readthedocs.io/en/latest/readers.html#running-a-reader) for a full documentation on how to run specific DISDRODB L0 processing. \n",
Expand Down

0 comments on commit 55518c6

Please sign in to comment.