Skip to content

Commit

Permalink
improve logger warning for non compatible data files
Browse files Browse the repository at this point in the history
  • Loading branch information
schumannj committed Jan 2, 2025
1 parent 4dffb74 commit d34b6a0
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/nomad_catalysis/schema_packages/catalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1830,14 +1830,22 @@ def check_and_read_data_file(self, archive, logger):
if self.data_file.endswith('NH3_Decomposition.h5'):
self.read_haber_data(archive, logger)
else:
logger.info("""This h5 file format might currently not be supported.
Pleasecontact the plugin developers if you want to add support for this.
""")
self.read_haber_data(archive, logger)
try:
self.read_haber_data(archive, logger)
except KeyError:
logger.warning(
"""No data is extracted from this h5 data file as the format is
not (yet) supported. This file contains a different data
structure or object names from currently supported h5 files for
catalysis. Please check if you can modify the structure or
contact the plugin developers if you want to add support for
this."""
)
else:
logger.error(
"""Data file format not supported. Please provide a
.csv, .xlsx or .h5 file."""
logger.warning(
"""Data file format not supported. No data is extracted from the
provided file. Please provide a standadized .csv, .xlsx or .h5 file,
if you want direct data extraction into the schema."""
)
return

Expand Down

0 comments on commit d34b6a0

Please sign in to comment.