-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjob_launcher.py
More file actions
51 lines (40 loc) · 1.45 KB
/
job_launcher.py
File metadata and controls
51 lines (40 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
"""
Legacy job launcher for backward compatibility.
DEPRECATED: This script is maintained for backward compatibility.
For new code, please use the structured CLI:
- fimmia <command> [args...] (e.g., fimmia train --train_dataset_path=...)
- shift-attack [args...] (e.g., shift-attack --dataset=bookmia --attack=bag_of_words)
See README.md for more information.
"""
import importlib
import argparse
import sys
import warnings
from pathlib import Path
sys.path.append(str(Path(__file__).parent))
def parse_args():
parser = argparse.ArgumentParser(
description="Legacy job runner (deprecated - use structured CLI instead)",
epilog=(
"Note: This script is deprecated. Use 'fimmia <command>' or 'shift-attack' instead. "
"See README.md for migration guide."
),
)
parser.add_argument("--script", type=str, required=True, help="path to script")
return parser.parse_known_args()[0]
def main():
# Show deprecation warning
warnings.warn(
"job_launcher.py is deprecated. Please use the structured CLI instead:\n"
" - fimmia <command> [args...] for FiMMIA operations\n"
" - shift-attack [args...] for shift detection attacks\n"
"See README.md for details.",
DeprecationWarning,
stacklevel=2,
)
args = parse_args()
module = importlib.import_module(args.script)
module.main()
if __name__ == "__main__":
main()