Skip to content

Commit e3dc9bb

Browse files
authored
feat: Support vscode metadata editor (#228)
1 parent 02eaa6b commit e3dc9bb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/anemoi/inference/commands/metadata.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
LOG = logging.getLogger(__name__)
2626

27+
EDITOR_OPTIONS = {"code": ["--wait"]}
28+
2729

2830
class Metadata(Command):
2931
"""Edit, remove, dump or load metadata from a checkpoint file."""
@@ -228,7 +230,7 @@ def _edit(self, args: Namespace, view: bool, cmd: str) -> None:
228230
with open(path, "w") as f:
229231
dump(metadata, f, **kwargs)
230232

231-
subprocess.check_call([cmd, path])
233+
subprocess.check_call([cmd, *EDITOR_OPTIONS.get(cmd, []), path])
232234

233235
if not view:
234236
with open(path) as f:

0 commit comments

Comments
 (0)