Skip to content

Commit

Permalink
update arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuwq0 committed Nov 26, 2023
1 parent 74e0de1 commit 5a5b23c
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 20 deletions.
2 changes: 1 addition & 1 deletion EQNet
7 changes: 4 additions & 3 deletions slurm/convert_growclust.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# %%
def parse_args():
parser = argparse.ArgumentParser()
## true
parser.add_argument("root_path", nargs="?", type=str, default="local", help="root path")
parser.add_argument("region", nargs="?", type=str, default="demo", help="region")
parser.add_argument("--dtct", action="store_true")
args, unknown = parser.parse_known_args()
return args
Expand All @@ -24,8 +25,8 @@ def parse_args():
args = parse_args()

# %%
root_path = "local"
region = "demo"
root_path = args.root_path
region = args.region
result_path = f"{region}/growclust"
if not os.path.exists(f"{root_path}/{result_path}"):
os.makedirs(f"{root_path}/{result_path}")
Expand Down
7 changes: 4 additions & 3 deletions slurm/convert_hypodd.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@

def parse_args():
parser = argparse.ArgumentParser()
## true
parser.add_argument("root_path", nargs="?", type=str, default="local", help="root path")
parser.add_argument("region", nargs="?", type=str, default="demo", help="region")
parser.add_argument("--dt_cc", action="store_true", help="run convert_dtcc.py")
return parser.parse_args()


args = parse_args()

# %%
root_path = "local"
region = "demo"
root_path = args.root_path
region = args.region

result_path = f"{region}/hypodd"
if not os.path.exists(f"{root_path}/{result_path}"):
Expand Down
16 changes: 14 additions & 2 deletions slurm/plot_catalog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# %%
import argparse
import json
import os
from datetime import datetime
Expand All @@ -9,9 +10,20 @@
import pandas as pd
import plotly.graph_objects as go


# %%
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("root_path", nargs="?", type=str, default="local", help="root path")
parser.add_argument("region", nargs="?", type=str, default="demo", help="region")
return parser.parse_args()


args = parse_args()

# %%
root_path = "local"
region = "demo"
root_path = args.root_path
region = args.region

result_path = f"{region}/results"
figure_path = f"{region}/figures"
Expand Down
4 changes: 2 additions & 2 deletions slurm/run_cctorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--root_path", type=str, default="local", help="root path")
parser.add_argument("--region", type=str, default="demo", help="region")
parser.add_argument("root_path", nargs="?", type=str, default="local", help="root path")
parser.add_argument("region", nargs="?", type=str, default="demo", help="region")
parser.add_argument("--dtct_pair", action="store_true", help="run convert_dtcc.py")
return parser.parse_args()

Expand Down
11 changes: 8 additions & 3 deletions slurm/run_growclust_cc.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash
set -x
WORKING_DIR=$PWD
root_path="local"
region="demo"
if [ $# -eq 2 ]; then
root_path=$1
region=$2
else
root_path="local"
region="demo"
fi

if [ ! -d "$root_path/$region/growclust" ]; then
mkdir -p $root_path/$region/growclust
Expand Down Expand Up @@ -64,7 +69,7 @@ TT/tt.sg
* vpvs_factor rayparam_min (-1 = default)
1.732 0.0
* tt_dep0 tt_dep1 tt_ddep
0. 31. 1.
0. 71. 1.
* tt_del0 tt_del1 tt_ddel
0. 500. 2.
*
Expand Down
9 changes: 7 additions & 2 deletions slurm/run_growclust_ct.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/bin/bash
WORKING_DIR=$PWD
root_path="local"
region="demo"
if [ $# -eq 2 ]; then
root_path=$1
region=$2
else
root_path="local"
region="demo"
fi

if [ ! -d "$root_path/$region/growclust" ]; then
mkdir -p $root_path/$region/growclust
Expand Down
9 changes: 7 additions & 2 deletions slurm/run_hypodd_cc.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/bash
set -x
WORKING_DIR=$PWD
root_path="local"
region="demo"
if [ $# -eq 2 ]; then
root_path=$1
region=$2
else
root_path="local"
region="demo"
fi

if [ ! -d "$root_path/$region/hypodd" ]; then
mkdir -p $root_path/$region/hypodd
Expand Down
14 changes: 12 additions & 2 deletions slurm/run_hypodd_ct.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/bash
set -x
WORKING_DIR=$PWD
root_path="local"
region="demo"
if [ $# -eq 2 ]; then
root_path=$1
region=$2
else
root_path="local"
region="demo"
fi

if [ ! -d "$root_path/$region/hypodd" ]; then
mkdir -p $root_path/$region/hypodd
fi

cd $root_path/$region/hypodd

if [ ! -d "HypoDD" ]; then
Expand Down

0 comments on commit 5a5b23c

Please sign in to comment.