|
1 | 1 | #!/usr/bin/env python3
|
2 | 2 |
|
3 |
| -import argparse, textwrap |
| 3 | +import argparse |
| 4 | +import textwrap |
4 | 5 | import os
|
5 | 6 |
|
6 | 7 | parser = argparse.ArgumentParser(
|
7 | 8 | description="ADIOS json file parser step 2 (step 1 is use compare.sh to collect properties from json)"
|
8 | 9 | )
|
9 | 10 |
|
10 | 11 | TAGS = {
|
11 |
| - "input_dir": "dataDir", ## key name for input direcory is "dataDir" |
| 12 | + "input_dir": "dataDir", # key name for input direcory is "dataDir" |
12 | 13 | "rank": "whichRank", ##
|
13 | 14 | "out": "plotPrefix", ##
|
14 | 15 | "showfig": "showFig", ##
|
15 |
| - "attr": "jsonAttr", ## key refer to specific json attr |
16 |
| - "zero": "zeroIf", ## key refer to a min number to be treated as 0. Spot the first rank with this value, and only plot up to this rank. |
| 16 | + "attr": "jsonAttr", # key refer to specific json attr |
| 17 | + "zero": "zeroIf", # key refer to a min number to be treated as 0. Spot the first rank with this value, and only plot up to this rank. |
17 | 18 | "level": "levelAxis",
|
18 | 19 | }
|
19 | 20 |
|
20 | 21 | TAGS_DEFAULT = {
|
21 |
| - "input_dir": "outs/", ## key name for input direcory defaults to "outs/" |
| 22 | + "input_dir": "outs/", # key name for input direcory defaults to "outs/" |
22 | 23 | "rank": 0, ##
|
23 | 24 | "out": "plot", ##
|
24 | 25 | "showfig": "False", ##
|
25 |
| - "attr": "ES", ## default json attr to look at is ES |
26 |
| - "zero": "0.000001", ## ignore if smaller than |
27 |
| - "level": "False", ## whether left/right axises (if both exist) should display same range |
| 26 | + "attr": "ES", # default json attr to look at is ES |
| 27 | + "zero": "0.000001", # ignore if smaller than |
| 28 | + "level": "False", # whether left/right axises (if both exist) should display same range |
28 | 29 | }
|
29 | 30 |
|
30 | 31 | parser.add_argument(
|
@@ -115,12 +116,3 @@ def parse_vars(items):
|
115 | 116 | parser.error(f"showFig must be 'True' or 'False', got '{command_options[TAGS['level']]}'")
|
116 | 117 | command_options[TAGS["showfig"]] = showFig_val == "true"
|
117 | 118 |
|
118 |
| -# command_options[TAGS["level"]] = eval(command_options[TAGS["level"]]) |
119 |
| - |
120 |
| -# valid_keys = set(TAGS.values()) |
121 |
| -# for key in command_options: |
122 |
| -# if key not in valid_keys: |
123 |
| -# parser.warn(f"Invalid option key: '{key}'. Valid keys are: {', '.join(valid_keys)}") |
124 |
| -#### allow extra options #### |
125 |
| - |
126 |
| -# print (command_options) |
0 commit comments