Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 52181308 authored by Clément Haëck's avatar Clément Haëck
Browse files

Set root_data in config file

parent d2633f25
......@@ -6,10 +6,17 @@ Collocate submesoscale fronts to phytoplankton levels using satellite imagery
- Download: Scripts for downloading data
- lib: Reusable code. Scripts for defining databases
- Compute: The actual code that does stuff. Each python script is accompanied
by a shell script to set the python environnement and launch it.
- Compute: Process data, compute diagnostics,... Each python script is accompanied
by a shell script to set the python environnement and launch it. If not, ./launch_python.py
can be used.
- Plots: Plotting scripts
The root directory containing data has to be specified in the file `lib/conf.ini` as
``` py
[main]
root_data: '/...'
```
## Requirements
......
"""General global variables."""
import configparser
import os
from os import path
from pathlib import Path
import argparse
import re
# Read config file
_config = configparser.ConfigParser()
_config_file = path.join(path.dirname(__file__), 'conf.ini')
if not path.isfile(_config_file):
raise RuntimeError("Missing configuration file lib/conf.ini")
_config.read(_config_file)
root = path.join(Path.home(), 'Documents/Work/Fronts')
root_data = path.join(Path.home(), 'Documents/Work/Data')
root_data = _config.get('main', 'root_data')
if not path.isdir(root_data):
raise NameError(f"root_data '{root_data}' is not a valid directory.")
root_plot = path.join(root_data, 'Plots')
box_lat = [36., 41.]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment