diff --git a/src/nomad_simulations/properties/spectral_profile.py b/src/nomad_simulations/properties/spectral_profile.py index 87583dd5..6707ba80 100644 --- a/src/nomad_simulations/properties/spectral_profile.py +++ b/src/nomad_simulations/properties/spectral_profile.py @@ -585,15 +585,15 @@ def generate_from_contributions(self, logger: BoundLogger) -> None: # TODO check if this method is general enough if self.xanes_spectrum is not None and self.exafs_spectrum is not None: # Concatenate XANE and EXAFS `Energy` grid points - xanes_energies = get_variables(self.xanes_spectrum.variables, Energy) - exafs_energies = get_variables(self.exafs_spectrum.variables, Energy) - if len(xanes_energies) == 0 or len(exafs_energies) == 0: + xanes_variables = get_variables(self.xanes_spectrum.variables, Energy) + exafs_variables = get_variables(self.exafs_spectrum.variables, Energy) + if len(xanes_variables) == 0 or len(exafs_variables) == 0: logger.warning( 'Could not extract the `Energy` grid points from XANES or EXAFS.' ) return - xanes_energies = xanes_energies[0].points - exafs_energies = exafs_energies[0].points + xanes_energies = xanes_variables[0].points + exafs_energies = exafs_variables[0].points if xanes_energies.max() > exafs_energies.min(): logger.warning( 'The XANES `Energy` grid points are not below the EXAFS `Energy` grid points.' diff --git a/tests/test_permittivity.py b/tests/test_permittivity.py index 7bead913..23743588 100644 --- a/tests/test_permittivity.py +++ b/tests/test_permittivity.py @@ -108,7 +108,10 @@ def test_resolve_type(self, variables: Optional[List[Variables]], result: str): ], ) def test_extract_absorption_spectra( - self, variables: Optional[List[Variables]], value: Optional[np.array], result + self, + variables: Optional[List[Variables]], + value: Optional[np.ndarray], + result: Optional[List[float]], ): """ Test the `extract_absorption_spectra` method. The `result` in the last valid case corresponds to the imaginary part of