Skip to content

Commit

Permalink
Revert changes to validate-project testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dc-almeida committed Oct 31, 2024
1 parent b284d31 commit 2df7b82
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions nomenclature/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import yaml

from nomenclature.definition import DataStructureDefinition
from nomenclature.config import NomenclatureConfig
from nomenclature.processor import (
DataValidator,
RegionProcessor,
Expand Down Expand Up @@ -145,16 +144,12 @@ def assert_valid_structure(
f"Definitions directory not found: {path / definitions}"
)

if not dimensions: # if "dimensions" were not specified
if path / "nomenclature.yaml" in path.iterdir():
dimensions = NomenclatureConfig.from_file(
path / "nomenclature.yaml"
).dimensions
if dimensions == (): # if "dimensions" were not specified
dimensions = [x.stem for x in (path / definitions).iterdir() if x.is_dir()]
if not dimensions:
dimensions = [x.stem for x in (path / definitions).iterdir() if x.is_dir()]
if not dimensions:
raise FileNotFoundError(f"`definitions` directory is empty: {definitions}")

raise FileNotFoundError(
f"`definitions` directory is empty: {path / definitions}"
)
_check_mappings(path, definitions, dimensions, mappings)
_check_processor_directory(
path,
Expand Down

0 comments on commit 2df7b82

Please sign in to comment.