Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(retrieve): Use input grib as target #88

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/anemoi/inference/commands/retrieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from earthkit.data.utils.dates import to_datetime

from ..config import load_config
from ..inputs.grib import GribInput
from ..inputs.mars import postproc
from ..runners.default import DefaultRunner
from . import Command
Expand All @@ -28,7 +29,7 @@ def add_arguments(self, command_parser):
command_parser.add_argument("config", type=str, help="Path to checkpoint")
command_parser.add_argument("--defaults", action="append", help="Sources of default values.")
command_parser.add_argument("--date", type=str, help="Date")
command_parser.add_argument("--output", type=str, help="Output file")
command_parser.add_argument("--output", type=str, default="/dev/stdout", help="Output file")
command_parser.add_argument("--staging-dates", type=str, help="Path to a file with staging dates")
command_parser.add_argument("--extra", action="append", help="Additional request values. Can be repeated")
command_parser.add_argument("overrides", nargs="*", help="Overrides.")
Expand All @@ -47,6 +48,10 @@ def run(self, args):

extra = postproc(grid, area)

input = runner.create_input()
if isinstance(input, GribInput):
extra["target"] = input.path

for r in args.extra or []:
k, v = r.split("=")
extra[k] = v
Expand Down
Loading