Skip to content

Conversation

Ailbhemit
Copy link
Contributor

An exception is raised if forecast dates were provided and they are not all equal. This option allows users to ignore provided forecast dates.

Copy link
Contributor

@SGeeversAtVortech SGeeversAtVortech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option is basically equivalent to preprocessing xml files by removing all forecast_date elements. I would suggest to rename the option as ignore_forecast_date.

My main concern is if this is the correct place to apply preprocessing on xml files. Unfortunately, I don't know if there are alternative ways to achieve this through fews, fews-io, or some other library.

pi_validate_timeseries = True

#: Read forecast date from timeseries_import
pi_read_forecast_date = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also describe this var in the class docstring.

self.timeseries_export_basename,
binary=self.pi_binary_timeseries,
pi_validate_times=False,
pi_read_forecast_date=True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use self.pi_read_forecast_date here as well?

pi_validate_timeseries = True

#: Read forecast date from timeseries_import
pi_read_forecast_date = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please describe this var in the class docstring.

self.timeseries_export_basename,
binary=self.pi_binary_timeseries,
pi_validate_times=False,
pi_read_forecast_date=True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we use here self.pi_read_forecast_date as well?

@jarsarasty
Copy link
Contributor

Hi @jackvreeken

Could you please review this PR?

pi_read_forecast_date=True,
make_new_file=False,
):
"""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update the docstring

if el is not None and pi_read_forecast_date:
forecast_datetime = self.__parse_date_time(el)
else:
# the timeseries has no forecastDate, so the forecastDate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this mean that you will now just get an error if all start datetimes don't match? That doesn't seem like much of an improvement

An exception is raised if forecast dates were provided and they are not all equal. This option allows users to ignore provided forecast dates.
Copy link

@Ailbhemit Ailbhemit marked this pull request as draft April 1, 2025 07:37
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

Successfully merging this pull request may close these issues.

4 participants