Skip to content

Commit

Permalink
adding test with local_modeling and global data params
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusGheorghe committed Feb 8, 2022
1 parent 11160fb commit bdcf083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 2 additions & 3 deletions neuralprophet/plot_model_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def check_df_name(m, df_name):
"Global modeling local normalization was used. Data will be denormalized according to global data params."
)
if df_name is not None and df_name not in m.data_params.df_names:
global_data_params = True
log.warning(
"Global modeling local normalization was used. Name {name!r} missing from data params. Data will be denormalized according to global data params.".format(
raise ValueError(
"Global modeling local normalization was used. Name {name!r} missing from data params.".format(
name=df_name
)
)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,8 @@ def test_global_modeling_local_normalization():
m.fit(train_dict, freq="D", local_modeling=True, local_time_normalization=True)
m.plot_parameters(df_name="dataset1")
m.plot_parameters()
m.plot_parameters(df_name="any_dataset")
with pytest.raises(ValueError):
m.plot_parameters(df_name="dataset5")
log.info("plot should work even with df_name=None or df_name not present in self.df_name")


Expand Down

0 comments on commit bdcf083

Please sign in to comment.