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

PiMixin: Enable support for ignoring provided forecast dates #1656

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

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.

SGeeversAtVortech and others added 25 commits October 8, 2024 11:52
workflows: add work flow based on the gitlab ci workflow
Use the correct workflow status badge in the README.md.
Provide some information on the migration from gitlab to github
and how to update the git remote url.
Update the autogenereted versioneer.py and _version.py files
with the latest versioneer package.
This makes versioneer compatible with python 3.12.
Remove the upper limit on numpy and scipy versions.
The older versions are no longer compatible with python 3.12.
Fix string-to-datetime/float conversions in loading csv files
for latest numpy version.
With the latest numpy.genfromtxt, strings are not always passed
to converters in byte format but sometimes in plain text format.
Fix the except clause when model transferring a model failed
due to an incompatible cache file.
Raise the error only when no cache file was used.
Use -999 instead of nan when missing values are indicated by -999.
Include tests using python 3.12.
Move the cross reference just above the section name,
instead of in the middle of the section.

Sphinx expects references to be just above sections/figures/tables.
Update install instructions for Python 3.12.
Installing rtc-tools with Python 3.12 requires installation of
setuptools.
Use np.genfromtxt instead of np.recfromcsv,
since the latter is deprecated.
Remove the deprecated function get_html_theme_path.
Remove gitlab CI/CD yaml file,
since the repository has moved to github.
Replace gitlab references with github references where applicable.
Replace gitlab with github reference for downloading examples.
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.

@@ -44,6 +44,9 @@ class PIMixin(IOMixin):
#: Check consistency of timeseries
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.

@@ -101,6 +105,7 @@ def read(self):
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?

@@ -41,6 +41,9 @@ class PIMixin(IOMixin):
#: Check consistency of timeseries
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.

@@ -103,6 +107,7 @@ def read(self):
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?

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