-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'aiddata/develop' into cru_ts
- Loading branch information
Showing
46 changed files
with
1,829 additions
and
881 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
sedac_cookie |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[main] | ||
|
||
# Name of dataset | ||
name = GPWv4 | ||
|
||
# Paths of input and output directories | ||
raw_dir = /sciclone/aiddata10/REU/pre_geo/raw/gpw/gpw_v4_rev11 | ||
output_dir = /sciclone/aiddata10/REU/pre_geo/data/rasters/gpw/gpw_v4_rev11 | ||
|
||
# Years to process, must be separated by ", " | ||
years = 2000, 2005, 2010, 2015, 2020 | ||
|
||
sedac_cookie = None | ||
|
||
# Overwrite existing files? | ||
overwrite_download = False | ||
overwrite_extract = False | ||
overwrite_processing = False | ||
|
||
|
||
[run] | ||
|
||
backend = prefect | ||
task_runner = hpc | ||
run_parallel = True | ||
max_workers = 10 | ||
|
||
|
||
[github] | ||
|
||
repo = https://github.com/aiddata/geo-datasets.git | ||
branch = develop | ||
directory = gpw | ||
|
||
|
||
[deploy] | ||
|
||
deployment_name = GPWv4 | ||
version = 1 | ||
flow_file_name = flow | ||
flow_name = gpwv4 | ||
storage_block = geo-datasets-github | ||
work_queue = geodata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import os | ||
import sys | ||
from pathlib import Path | ||
from datetime import datetime | ||
from configparser import ConfigParser | ||
|
||
from prefect import flow | ||
from prefect.filesystems import GitHub | ||
|
||
|
||
config_file = "gpw/config.ini" | ||
config = ConfigParser() | ||
config.read(config_file) | ||
|
||
block_name = config["deploy"]["storage_block"] | ||
GitHub.load(block_name).get_directory("global_scripts") | ||
|
||
from main import GPWv4 | ||
|
||
tmp_dir = Path(os.getcwd()) / config["github"]["directory"] | ||
|
||
|
||
@flow | ||
def gpwv4(raw_dir, output_dir, years, sedac_cookie, overwrite_download, overwrite_extract, overwrite_processing, backend, task_runner, run_parallel, max_workers, log_dir): | ||
|
||
timestamp = datetime.today() | ||
time_str = timestamp.strftime("%Y_%m_%d_%H_%M") | ||
timestamp_log_dir = Path(log_dir) / time_str | ||
timestamp_log_dir.mkdir(parents=True, exist_ok=True) | ||
|
||
cluster = "vortex" | ||
|
||
cluster_kwargs = { | ||
"shebang": "#!/bin/tcsh", | ||
"resource_spec": "nodes=1:c18a:ppn=12", | ||
"walltime": "2:00:00", | ||
"cores": 5, | ||
"processes": 5, | ||
"memory": "30GB", | ||
"interface": "ib0", | ||
"job_extra_directives": [ | ||
"-j oe", | ||
], | ||
"job_script_prologue": [ | ||
"source /usr/local/anaconda3-2021.05/etc/profile.d/conda.csh", | ||
"module load anaconda3/2021.05", | ||
"conda activate geodata38", | ||
f"cd {tmp_dir}", | ||
], | ||
"log_directory": str(timestamp_log_dir), | ||
} | ||
|
||
|
||
class_instance = GPWv4(raw_dir, output_dir, years, sedac_cookie, overwrite_download, overwrite_extract, overwrite_processing) | ||
|
||
if task_runner != 'hpc': | ||
os.chdir(tmp_dir) | ||
class_instance.run(backend=backend, task_runner=task_runner, run_parallel=run_parallel, max_workers=max_workers, log_dir=timestamp_log_dir) | ||
else: | ||
class_instance.run(backend=backend, task_runner=task_runner, run_parallel=run_parallel, max_workers=max_workers, log_dir=timestamp_log_dir, cluster=cluster, cluster_kwargs=cluster_kwargs) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.