Skip to content

Commit

Permalink
Change error message for keyerror in NSC
Browse files Browse the repository at this point in the history
  • Loading branch information
knikolaou committed May 14, 2024
1 parent 585472a commit dc4ecd7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions papyrus/neural_state/neural_state_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@ def __call__(self, params: dict, data: dict, **kwargs) -> NeuralState:
if not all([key in data.keys() for key in self.data_keys]):
raise KeyError(
"The data dictionary needs to contain the keys: "
+ ", ".join(self.data_keys)
+ ". "
+ "The data dictionary contains the keys: "
+ ", ".join(data.keys())
+ ". "
+ f"{self.data_keys}."
+ f"Instead, the data dictionary contains the keys: {data.keys()}."
+ "Eather change the keys of the data dictionary or the data_keys "
+ "attribute of the NeuralStateCreator instance."
)
Expand Down

0 comments on commit dc4ecd7

Please sign in to comment.