feat!: allows new seed spec instead of cli arg, removes old cli arg
All checks were successful
gitea-physics/deepdog/pipeline/head This commit looks good
All checks were successful
gitea-physics/deepdog/pipeline/head This commit looks good
This commit is contained in:
parent
2105754911
commit
7108dd0111
@ -30,18 +30,6 @@ def parse_args() -> argparse.Namespace:
|
|||||||
help="A json file with the indexify config for parsing job indexes. Will skip if not present",
|
help="A json file with the indexify config for parsing job indexes. Will skip if not present",
|
||||||
default="",
|
default="",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
"--seed-index",
|
|
||||||
type=int,
|
|
||||||
help='take an integer to append as a "seed" key with range at end of indexify dict. Skip if <= 0',
|
|
||||||
default=0,
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--seed-fieldname",
|
|
||||||
type=str,
|
|
||||||
help='if --seed-index is set, the fieldname to append to the indexifier. "seed" by default',
|
|
||||||
default="seed",
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--coalesced-keys",
|
"--coalesced-keys",
|
||||||
type=str,
|
type=str,
|
||||||
|
@ -51,9 +51,13 @@ def main(args: argparse.Namespace):
|
|||||||
indexifier = None
|
indexifier = None
|
||||||
if args.indexify_json:
|
if args.indexify_json:
|
||||||
with open(args.indexify_json, "r") as indexify_json_file:
|
with open(args.indexify_json, "r") as indexify_json_file:
|
||||||
indexify_data = json.load(indexify_json_file)
|
indexify_spec = json.load(indexify_json_file)
|
||||||
if args.seed_index > 0:
|
indexify_data = indexify_spec["indexes"]
|
||||||
indexify_data[args.seed_fieldname] = list(range(args.seed_index))
|
if "seed_spec" in indexify_spec:
|
||||||
|
seed_spec = indexify_spec["seed_spec"]
|
||||||
|
indexify_data[seed_spec["field_name"]] = list(
|
||||||
|
range(seed_spec["num_seeds"])
|
||||||
|
)
|
||||||
# _logger.debug(f"Indexifier data looks like {indexify_data}")
|
# _logger.debug(f"Indexifier data looks like {indexify_data}")
|
||||||
indexifier = deepdog.indexify.Indexifier(indexify_data)
|
indexifier = deepdog.indexify.Indexifier(indexify_data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user