[weather-sp] : better formatting of date & time in output template

Open Beginner friendly
#535 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start by locating the weather-sp output-template handling and the logic that substitutes date and time values. Check the relevant existing tests, if present, then verify that a pattern can format the time as 12:00:00 while preserving the current date and time behavior.

Written by the indexing model from the issue text.

Description

enhancement good first issue weather-sp

Example:

For a file gs://test-input/test-file.grib the output file pattern is gs://test-output/splits/test-file_{date}-{time}.grib.
Then for date = 20200101, time = 1200, the output file for that split will be gs://test-output/splits/test-file_20200101-1200.grib.

But what if user want's output file as gs://test-output/splits/test-file_20200101-12:00:00.grib -- basically format date & time as per the need.

For such cases he can provide output file pattern as gs://test-output/splits/test-file_{date}-{datetime.strptime(f"{time}", "%H%M").strftime("%H:%M:%S")}.grib.

Make necessary changes for supporting this :) most probably just need to import datetime library and minor tweaking in logic.

Dominant language
Python
Stars
252
Forks
60
Avg merge
8d 4h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/weather-tools

All issues in google/weather-tools

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.