Skip to content

Commit 93d2720

Browse files
authored
Minor adjustments to DIAdem load script (#65)
1 parent b161af5 commit 93d2720

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

assets/diadem_load.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,29 @@ def Close(self):
3232

3333

3434
# ------------------------------------------------------
35-
# Start this script like: python D:\python\DIAdem_Start.py --DataPlugin_Name="TDM" --data_file="Example.tdm"
35+
# Start this script like: python diadem_load.py --DataPlugin_Name="CSV" --data_file="Example.csv"
3636
# ------------------------------------------------------
3737
def main():
3838
import optparse
3939
# get the parameter from argument list or work with some defaults for testing
4040
parser = optparse.OptionParser()
4141
parser.add_option("--DataPlugin_Name",
42-
help="plugin name",
43-
dest="DP_Name", default="Touchstone_Complex")
42+
help="DataPlugin name",
43+
dest="DP_Name")
4444

4545
parser.add_option("--data_file",
4646
help="Data file to load with the DataPlugin",
47-
dest="DataFileName", default="d:\\python\\monopole_2port_Z_MA.s2p")
47+
dest="DataFileName")
4848

4949
# ------------------------------------------------------
5050
(opts, args) = parser.parse_args()
51+
52+
if opts.DP_Name == None or opts.DataFileName == None:
53+
parser.print_help()
54+
return
55+
5156
print("----- Start to Load Data with \"" + opts.DP_Name +
52-
"\" DataPlugin and the file \""+opts.DataFileName + "\"--------")
57+
"\" DataPlugin and the file \"" + opts.DataFileName + "\"--------")
5358

5459
# ------------------------------------------------------
5560
dd = RunDIAdem()

0 commit comments

Comments
 (0)