Skip to content

Commit

Permalink
Merge if conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ka-sarthak committed Dec 19, 2024
1 parent ac39a30 commit 3fa6263
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/nomad_measurements/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,13 @@ def add_dataset(
dataset = DatasetModel(
**params,
)
if validate_path and self.valid_dataset_paths:
if path not in self.valid_dataset_paths:
self.logger.warning(f'Invalid dataset path "{path}".')
return
if (
validate_path
and self.valid_dataset_paths
and path not in self.valid_dataset_paths
):
self.logger.warning(f'Invalid dataset path "{path}".')
return

# handle the pint.Quantity and add data
if isinstance(dataset.data, pint.Quantity):
Expand Down

0 comments on commit 3fa6263

Please sign in to comment.