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

Perform check of input format of timedata argument #883

Closed
tnatt opened this issue Nov 27, 2024 · 1 comment
Closed

Perform check of input format of timedata argument #883

tnatt opened this issue Nov 27, 2024 · 1 comment
Assignees

Comments

@tnatt
Copy link
Collaborator

tnatt commented Nov 27, 2024

If the timedata argument is entered as a single list with one date e.g. timedata=["20240506"]
timedata_item will be a string in the function below and the unpacking is giving value="2" and label="0240506"

def _get_fmu_time_object(self, timedata_item: list[str]) -> Timestamp:
"""
Returns a Timestamp from a timedata item on list
format: ["20200101", "monitor"] where the first item is a date and
the last item is an optional label
"""
value, *label = timedata_item

We need to either:

  1. add check and provide descriptive error message to the user if the timedata argument is entered as a single list
  2. add support for the single list format (which is a bit more intuitive than having to give it in as a double list). The double list could then only be used when a label needs to be attached to a date.
@tnatt
Copy link
Collaborator Author

tnatt commented Nov 28, 2024

Closed in #885

@tnatt tnatt closed this as completed Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant