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

use future instead of deprecation warnings #849

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ dependencies:
- black
- polars
- "ray[tune]>=2.2.0"
- utilsforecast>=0.0.21
- utilsforecast>=0.0.24
4 changes: 2 additions & 2 deletions nbs/core.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
" \"In a future version the predictions will have the id as a column. \"\n",
" \"You can set the `NIXTLA_ID_AS_COL` environment variable \"\n",
" \"to adopt the new behavior and to suppress this warning.\",\n",
" category=DeprecationWarning,\n",
" category=FutureWarning,\n",
" )"
]
},
Expand Down Expand Up @@ -1306,7 +1306,7 @@
"nf = NeuralForecast(models=models, freq='M')\n",
"nf.fit(df=AirPassengersPanel_train)\n",
"with warnings.catch_warnings(record=True) as issued_warnings:\n",
" warnings.simplefilter('always', category=DeprecationWarning)\n",
" warnings.simplefilter('always', category=FutureWarning)\n",
" nf.predict()\n",
" nf.predict_insample()\n",
" nf.cross_validation(df=AirPassengersPanel_train)\n",
Expand Down
4 changes: 2 additions & 2 deletions nbs/tsdataset.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,15 @@
" if isinstance(df, pd.DataFrame) and df.index.name == id_col:\n",
" warnings.warn(\n",
" \"Passing the id as index is deprecated, please provide it as a column instead.\",\n",
" DeprecationWarning,\n",
" FutureWarning,\n",
" )\n",
" df = df.reset_index(id_col)\n",
" # Define indexes if not given\n",
" if static_df is not None:\n",
" if isinstance(static_df, pd.DataFrame) and static_df.index.name == id_col:\n",
" warnings.warn(\n",
" \"Passing the id as index is deprecated, please provide it as a column instead.\",\n",
" DeprecationWarning,\n",
" FutureWarning,\n",
" )\n",
" if sort_df:\n",
" static_df = ufp.sort(static_df, by=id_col)\n",
Expand Down
2 changes: 1 addition & 1 deletion neuralforecast/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _warn_id_as_idx():
"In a future version the predictions will have the id as a column. "
"You can set the `NIXTLA_ID_AS_COL` environment variable "
"to adopt the new behavior and to suppress this warning.",
category=DeprecationWarning,
category=FutureWarning,
)

# %% ../nbs/core.ipynb 10
Expand Down
4 changes: 2 additions & 2 deletions neuralforecast/tsdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,15 @@ def from_df(
if isinstance(df, pd.DataFrame) and df.index.name == id_col:
warnings.warn(
"Passing the id as index is deprecated, please provide it as a column instead.",
DeprecationWarning,
FutureWarning,
)
df = df.reset_index(id_col)
# Define indexes if not given
if static_df is not None:
if isinstance(static_df, pd.DataFrame) and static_df.index.name == id_col:
warnings.warn(
"Passing the id as index is deprecated, please provide it as a column instead.",
DeprecationWarning,
FutureWarning,
)
if sort_df:
static_df = ufp.sort(static_df, by=id_col)
Expand Down
2 changes: 1 addition & 1 deletion settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ language = English
custom_sidebar = True
license = apache2
status = 2
requirements = numpy>=1.21.6 pandas>=1.3.5 torch>=2.0.0 pytorch-lightning>=2.0.0 ray[tune]>=2.2.0 optuna utilsforecast>=0.0.21 numba
requirements = numpy>=1.21.6 pandas>=1.3.5 torch>=2.0.0 pytorch-lightning>=2.0.0 ray[tune]>=2.2.0 optuna utilsforecast>=0.0.24 numba
dev_requirements = nbdev black mypy flake8 matplotlib hyperopt polars pyarrow
nbs_path = nbs
doc_path = _docs
Expand Down
Loading